| /** |
| * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Based on ideas from Xtext, Xtend, Xcore |
| * |
| * Contributors: |
| * Joerg Riegel - Initial implementation |
| * |
| */ |
| package org.eclipse.osbp.xtext.perspective.impl; |
| |
| import java.util.Collection; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.notify.NotificationChain; |
| |
| import org.eclipse.emf.common.util.EList; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| |
| import org.eclipse.osbp.xtext.perspective.PerspectiveDslPackage; |
| import org.eclipse.osbp.xtext.perspective.PerspectiveElement; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Perspective Element</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.perspective.impl.PerspectiveElementImpl#getElementId <em>Element Id</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.perspective.impl.PerspectiveElementImpl#getAccessibilityPhrase <em>Accessibility Phrase</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.perspective.impl.PerspectiveElementImpl#getContainerData <em>Container Data</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.perspective.impl.PerspectiveElementImpl#getElements <em>Elements</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class PerspectiveElementImpl extends PerspectiveLazyResolverImpl implements PerspectiveElement { |
| /** |
| * The default value of the '{@link #getElementId() <em>Element Id</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getElementId() |
| * @generated |
| * @ordered |
| */ |
| protected static final String ELEMENT_ID_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getElementId() <em>Element Id</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getElementId() |
| * @generated |
| * @ordered |
| */ |
| protected String elementId = ELEMENT_ID_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getAccessibilityPhrase() <em>Accessibility Phrase</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAccessibilityPhrase() |
| * @generated |
| * @ordered |
| */ |
| protected static final String ACCESSIBILITY_PHRASE_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getAccessibilityPhrase() <em>Accessibility Phrase</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAccessibilityPhrase() |
| * @generated |
| * @ordered |
| */ |
| protected String accessibilityPhrase = ACCESSIBILITY_PHRASE_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getContainerData() <em>Container Data</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getContainerData() |
| * @generated |
| * @ordered |
| */ |
| protected static final String CONTAINER_DATA_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getContainerData() <em>Container Data</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getContainerData() |
| * @generated |
| * @ordered |
| */ |
| protected String containerData = CONTAINER_DATA_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getElements() <em>Elements</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getElements() |
| * @generated |
| * @ordered |
| */ |
| protected EList<PerspectiveElement> elements; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected PerspectiveElementImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return PerspectiveDslPackage.Literals.PERSPECTIVE_ELEMENT; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getElementId() { |
| return elementId; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setElementId(String newElementId) { |
| String oldElementId = elementId; |
| elementId = newElementId; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, PerspectiveDslPackage.PERSPECTIVE_ELEMENT__ELEMENT_ID, oldElementId, elementId)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getAccessibilityPhrase() { |
| return accessibilityPhrase; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setAccessibilityPhrase(String newAccessibilityPhrase) { |
| String oldAccessibilityPhrase = accessibilityPhrase; |
| accessibilityPhrase = newAccessibilityPhrase; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, PerspectiveDslPackage.PERSPECTIVE_ELEMENT__ACCESSIBILITY_PHRASE, oldAccessibilityPhrase, accessibilityPhrase)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getContainerData() { |
| return containerData; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setContainerData(String newContainerData) { |
| String oldContainerData = containerData; |
| containerData = newContainerData; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, PerspectiveDslPackage.PERSPECTIVE_ELEMENT__CONTAINER_DATA, oldContainerData, containerData)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<PerspectiveElement> getElements() { |
| if (elements == null) { |
| elements = new EObjectContainmentEList<PerspectiveElement>(PerspectiveElement.class, this, PerspectiveDslPackage.PERSPECTIVE_ELEMENT__ELEMENTS); |
| } |
| return elements; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case PerspectiveDslPackage.PERSPECTIVE_ELEMENT__ELEMENTS: |
| return ((InternalEList<?>)getElements()).basicRemove(otherEnd, msgs); |
| } |
| return super.eInverseRemove(otherEnd, featureID, msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case PerspectiveDslPackage.PERSPECTIVE_ELEMENT__ELEMENT_ID: |
| return getElementId(); |
| case PerspectiveDslPackage.PERSPECTIVE_ELEMENT__ACCESSIBILITY_PHRASE: |
| return getAccessibilityPhrase(); |
| case PerspectiveDslPackage.PERSPECTIVE_ELEMENT__CONTAINER_DATA: |
| return getContainerData(); |
| case PerspectiveDslPackage.PERSPECTIVE_ELEMENT__ELEMENTS: |
| return getElements(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case PerspectiveDslPackage.PERSPECTIVE_ELEMENT__ELEMENT_ID: |
| setElementId((String)newValue); |
| return; |
| case PerspectiveDslPackage.PERSPECTIVE_ELEMENT__ACCESSIBILITY_PHRASE: |
| setAccessibilityPhrase((String)newValue); |
| return; |
| case PerspectiveDslPackage.PERSPECTIVE_ELEMENT__CONTAINER_DATA: |
| setContainerData((String)newValue); |
| return; |
| case PerspectiveDslPackage.PERSPECTIVE_ELEMENT__ELEMENTS: |
| getElements().clear(); |
| getElements().addAll((Collection<? extends PerspectiveElement>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case PerspectiveDslPackage.PERSPECTIVE_ELEMENT__ELEMENT_ID: |
| setElementId(ELEMENT_ID_EDEFAULT); |
| return; |
| case PerspectiveDslPackage.PERSPECTIVE_ELEMENT__ACCESSIBILITY_PHRASE: |
| setAccessibilityPhrase(ACCESSIBILITY_PHRASE_EDEFAULT); |
| return; |
| case PerspectiveDslPackage.PERSPECTIVE_ELEMENT__CONTAINER_DATA: |
| setContainerData(CONTAINER_DATA_EDEFAULT); |
| return; |
| case PerspectiveDslPackage.PERSPECTIVE_ELEMENT__ELEMENTS: |
| getElements().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case PerspectiveDslPackage.PERSPECTIVE_ELEMENT__ELEMENT_ID: |
| return ELEMENT_ID_EDEFAULT == null ? elementId != null : !ELEMENT_ID_EDEFAULT.equals(elementId); |
| case PerspectiveDslPackage.PERSPECTIVE_ELEMENT__ACCESSIBILITY_PHRASE: |
| return ACCESSIBILITY_PHRASE_EDEFAULT == null ? accessibilityPhrase != null : !ACCESSIBILITY_PHRASE_EDEFAULT.equals(accessibilityPhrase); |
| case PerspectiveDslPackage.PERSPECTIVE_ELEMENT__CONTAINER_DATA: |
| return CONTAINER_DATA_EDEFAULT == null ? containerData != null : !CONTAINER_DATA_EDEFAULT.equals(containerData); |
| case PerspectiveDslPackage.PERSPECTIVE_ELEMENT__ELEMENTS: |
| return elements != null && !elements.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (elementId: "); |
| result.append(elementId); |
| result.append(", accessibilityPhrase: "); |
| result.append(accessibilityPhrase); |
| result.append(", containerData: "); |
| result.append(containerData); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //PerspectiveElementImpl |