| /** |
| * Copyright (c) 2011, 2015 - Lunifera GmbH (Gross Enzersdorf, Austria), 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 |
| * |
| * Contributors: |
| * Florian Pirchner - Initial implementation |
| */ |
| package org.eclipse.osbp.ecview.core.extension.model.extension.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.common.util.EMap; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.EObject; |
| import org.eclipse.emf.ecore.EStructuralFeature; |
| import org.eclipse.emf.ecore.InternalEObject; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; |
| import org.eclipse.emf.ecore.util.EDataTypeUniqueEList; |
| import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
| import org.eclipse.emf.ecore.util.EcoreEMap; |
| import org.eclipse.emf.ecore.util.EcoreUtil; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| import org.eclipse.osbp.ecview.core.common.model.core.CoreModelPackage; |
| import org.eclipse.osbp.ecview.core.common.model.core.YCssAble; |
| import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddable; |
| import org.eclipse.osbp.ecview.core.common.model.core.YView; |
| import org.eclipse.osbp.ecview.core.common.model.core.impl.YStringToStringMapImpl; |
| import org.eclipse.osbp.ecview.core.common.model.datatypes.DatatypesFactory; |
| import org.eclipse.osbp.ecview.core.common.model.datatypes.YDatadescription; |
| import org.eclipse.osbp.ecview.core.extension.model.extension.ExtensionModelPackage; |
| import org.eclipse.osbp.ecview.core.extension.model.extension.YTab; |
| import org.eclipse.osbp.ecview.core.extension.model.extension.YTabSheet; |
| |
| // TODO: Auto-generated Javadoc |
| /** |
| * <!-- begin-user-doc --> An implementation of the model object ' |
| * <em><b>YTab</b></em>'. <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.ecview.core.extension.model.extension.impl.YTabImpl#getTags <em>Tags</em>}</li> |
| * <li>{@link org.eclipse.osbp.ecview.core.extension.model.extension.impl.YTabImpl#getId <em>Id</em>}</li> |
| * <li>{@link org.eclipse.osbp.ecview.core.extension.model.extension.impl.YTabImpl#getName <em>Name</em>}</li> |
| * <li>{@link org.eclipse.osbp.ecview.core.extension.model.extension.impl.YTabImpl#getProperties <em>Properties</em>}</li> |
| * <li>{@link org.eclipse.osbp.ecview.core.extension.model.extension.impl.YTabImpl#getCssClass <em>Css Class</em>}</li> |
| * <li>{@link org.eclipse.osbp.ecview.core.extension.model.extension.impl.YTabImpl#getCssID <em>Css ID</em>}</li> |
| * <li>{@link org.eclipse.osbp.ecview.core.extension.model.extension.impl.YTabImpl#getParent <em>Parent</em>}</li> |
| * <li>{@link org.eclipse.osbp.ecview.core.extension.model.extension.impl.YTabImpl#getEmbeddable <em>Embeddable</em>}</li> |
| * <li>{@link org.eclipse.osbp.ecview.core.extension.model.extension.impl.YTabImpl#getDatadescription <em>Datadescription</em>}</li> |
| * <li>{@link org.eclipse.osbp.ecview.core.extension.model.extension.impl.YTabImpl#getOrphanDatadescriptions <em>Orphan Datadescriptions</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class YTabImpl extends MinimalEObjectImpl.Container implements YTab { |
| /** |
| * The cached value of the '{@link #getTags() <em>Tags</em>}' attribute list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTags() |
| * @generated |
| * @ordered |
| */ |
| protected EList<String> tags; |
| /** |
| * The default value of the '{@link #getId() <em>Id</em>}' attribute. <!-- |
| * begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @see #getId() |
| * @generated |
| * @ordered |
| */ |
| protected static final String ID_EDEFAULT = null; |
| /** |
| * The cached value of the '{@link #getId() <em>Id</em>}' attribute. <!-- |
| * begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @see #getId() |
| * @generated |
| * @ordered |
| */ |
| protected String id = ID_EDEFAULT; |
| /** |
| * The default value of the '{@link #getName() <em>Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getName() |
| * @generated |
| * @ordered |
| */ |
| protected static final String NAME_EDEFAULT = null; |
| /** |
| * The cached value of the '{@link #getName() <em>Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getName() |
| * @generated |
| * @ordered |
| */ |
| protected String name = NAME_EDEFAULT; |
| /** |
| * The cached value of the '{@link #getProperties() <em>Properties</em>}' map. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getProperties() |
| * @generated |
| * @ordered |
| */ |
| protected EMap<String, String> properties; |
| /** |
| * The default value of the '{@link #getCssClass() <em>Css Class</em>}' attribute. |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * @see #getCssClass() |
| * @generated |
| * @ordered |
| */ |
| protected static final String CSS_CLASS_EDEFAULT = null; |
| /** |
| * The cached value of the '{@link #getCssClass() <em>Css Class</em>}' attribute. |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * @see #getCssClass() |
| * @generated |
| * @ordered |
| */ |
| protected String cssClass = CSS_CLASS_EDEFAULT; |
| /** |
| * The default value of the '{@link #getCssID() <em>Css ID</em>}' attribute. |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * @see #getCssID() |
| * @generated |
| * @ordered |
| */ |
| protected static final String CSS_ID_EDEFAULT = null; |
| /** |
| * The cached value of the '{@link #getCssID() <em>Css ID</em>}' attribute. |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * @see #getCssID() |
| * @generated |
| * @ordered |
| */ |
| protected String cssID = CSS_ID_EDEFAULT; |
| /** |
| * The cached value of the '{@link #getEmbeddable() <em>Embeddable</em>}' containment reference. |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * @see #getEmbeddable() |
| * @generated |
| * @ordered |
| */ |
| protected YEmbeddable embeddable; |
| |
| /** |
| * The cached value of the '{@link #getDatadescription() <em>Datadescription</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDatadescription() |
| * @generated |
| * @ordered |
| */ |
| protected YDatadescription datadescription; |
| |
| /** |
| * The cached value of the '{@link #getOrphanDatadescriptions() <em>Orphan Datadescriptions</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getOrphanDatadescriptions() |
| * @generated |
| * @ordered |
| */ |
| protected EList<YDatadescription> orphanDatadescriptions; |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @generated |
| */ |
| protected YTabImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the e class |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return ExtensionModelPackage.Literals.YTAB; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the cached value of the '{@link #getId() <em>Id</em>}' attribute |
| * @generated |
| */ |
| public String getId() { |
| return id; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param newId |
| * the new cached value of the '{@link #getId() <em>Id</em>}' |
| * attribute |
| * @generated |
| */ |
| public void setId(String newId) { |
| String oldId = id; |
| id = newId; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ExtensionModelPackage.YTAB__ID, oldId, id)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the cached value of the '{@link #getName() <em>Name</em>}' |
| * attribute |
| * @generated |
| */ |
| public String getName() { |
| return name; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param newName |
| * the new cached value of the '{@link #getName() <em>Name</em>}' |
| * attribute |
| * @generated |
| */ |
| public void setName(String newName) { |
| String oldName = name; |
| name = newName; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ExtensionModelPackage.YTAB__NAME, oldName, name)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the cached value of the '{@link #getTags() <em>Tags</em>}' |
| * attribute list |
| * @generated |
| */ |
| public EList<String> getTags() { |
| if (tags == null) { |
| tags = new EDataTypeUniqueEList<String>(String.class, this, ExtensionModelPackage.YTAB__TAGS); |
| } |
| return tags; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the cached value of the '{@link #getProperties() |
| * <em>Properties</em>}' map |
| * @generated |
| */ |
| public EMap<String, String> getProperties() { |
| if (properties == null) { |
| properties = new EcoreEMap<String,String>(CoreModelPackage.Literals.YSTRING_TO_STRING_MAP, YStringToStringMapImpl.class, this, ExtensionModelPackage.YTAB__PROPERTIES); |
| } |
| return properties; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the cached value of the '{@link #getCssClass() |
| * <em>Css Class</em>}' attribute |
| * @generated |
| */ |
| public String getCssClass() { |
| return cssClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param newCssClass |
| * the new cached value of the '{@link #getCssClass() |
| * <em>Css Class</em>}' attribute |
| * @generated |
| */ |
| public void setCssClass(String newCssClass) { |
| String oldCssClass = cssClass; |
| cssClass = newCssClass; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ExtensionModelPackage.YTAB__CSS_CLASS, oldCssClass, cssClass)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the cached value of the '{@link #getCssID() <em>Css ID</em>}' |
| * attribute |
| * @generated |
| */ |
| public String getCssID() { |
| return cssID; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param newCssID |
| * the new cached value of the '{@link #getCssID() |
| * <em>Css ID</em>}' attribute |
| * @generated |
| */ |
| public void setCssID(String newCssID) { |
| String oldCssID = cssID; |
| cssID = newCssID; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ExtensionModelPackage.YTAB__CSS_ID, oldCssID, cssID)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the parent |
| * @generated |
| */ |
| public YTabSheet getParent() { |
| if (eContainerFeatureID() != ExtensionModelPackage.YTAB__PARENT) return null; |
| return (YTabSheet)eContainer(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the y tab sheet |
| * @generated |
| */ |
| public YTabSheet basicGetParent() { |
| if (eContainerFeatureID() != ExtensionModelPackage.YTAB__PARENT) return null; |
| return (YTabSheet)eInternalContainer(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param newParent |
| * the new parent |
| * @param msgs |
| * the msgs |
| * @return the notification chain |
| * @generated |
| */ |
| public NotificationChain basicSetParent(YTabSheet newParent, |
| NotificationChain msgs) { |
| msgs = eBasicSetContainer((InternalEObject)newParent, ExtensionModelPackage.YTAB__PARENT, msgs); |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param newParent |
| * the new parent |
| * @generated |
| */ |
| public void setParent(YTabSheet newParent) { |
| if (newParent != eInternalContainer() || (eContainerFeatureID() != ExtensionModelPackage.YTAB__PARENT && newParent != null)) { |
| if (EcoreUtil.isAncestor(this, newParent)) |
| throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); |
| NotificationChain msgs = null; |
| if (eInternalContainer() != null) |
| msgs = eBasicRemoveFromContainer(msgs); |
| if (newParent != null) |
| msgs = ((InternalEObject)newParent).eInverseAdd(this, ExtensionModelPackage.YTAB_SHEET__TABS, YTabSheet.class, msgs); |
| msgs = basicSetParent(newParent, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ExtensionModelPackage.YTAB__PARENT, newParent, newParent)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the cached value of the '{@link #getEmbeddable() |
| * <em>Embeddable</em>}' containment reference |
| * @generated |
| */ |
| public YEmbeddable getEmbeddable() { |
| if (embeddable != null && embeddable.eIsProxy()) { |
| InternalEObject oldEmbeddable = (InternalEObject)embeddable; |
| embeddable = (YEmbeddable)eResolveProxy(oldEmbeddable); |
| if (embeddable != oldEmbeddable) { |
| InternalEObject newEmbeddable = (InternalEObject)embeddable; |
| NotificationChain msgs = oldEmbeddable.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ExtensionModelPackage.YTAB__EMBEDDABLE, null, null); |
| if (newEmbeddable.eInternalContainer() == null) { |
| msgs = newEmbeddable.eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ExtensionModelPackage.YTAB__EMBEDDABLE, null, msgs); |
| } |
| if (msgs != null) msgs.dispatch(); |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, ExtensionModelPackage.YTAB__EMBEDDABLE, oldEmbeddable, embeddable)); |
| } |
| } |
| return embeddable; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the y embeddable |
| * @generated |
| */ |
| public YEmbeddable basicGetEmbeddable() { |
| return embeddable; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param newEmbeddable |
| * the new embeddable |
| * @param msgs |
| * the msgs |
| * @return the notification chain |
| * @generated |
| */ |
| public NotificationChain basicSetEmbeddable(YEmbeddable newEmbeddable, |
| NotificationChain msgs) { |
| YEmbeddable oldEmbeddable = embeddable; |
| embeddable = newEmbeddable; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ExtensionModelPackage.YTAB__EMBEDDABLE, oldEmbeddable, newEmbeddable); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the cached value of the '{@link #getDatadescription() |
| * <em>Datadescription</em>}' reference |
| * @generated |
| */ |
| public YDatadescription getDatadescription() { |
| if (datadescription != null && datadescription.eIsProxy()) { |
| InternalEObject oldDatadescription = (InternalEObject)datadescription; |
| datadescription = (YDatadescription)eResolveProxy(oldDatadescription); |
| if (datadescription != oldDatadescription) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, ExtensionModelPackage.YTAB__DATADESCRIPTION, oldDatadescription, datadescription)); |
| } |
| } |
| return datadescription; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the y datadescription |
| * @generated |
| */ |
| public YDatadescription basicGetDatadescription() { |
| return datadescription; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param newDatadescription |
| * the new cached value of the '{@link #getDatadescription() |
| * <em>Datadescription</em>}' reference |
| * @generated |
| */ |
| public void setDatadescription(YDatadescription newDatadescription) { |
| YDatadescription oldDatadescription = datadescription; |
| datadescription = newDatadescription; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ExtensionModelPackage.YTAB__DATADESCRIPTION, oldDatadescription, datadescription)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the cached value of the '{@link #getOrphanDatadescriptions() |
| * <em>Orphan Datadescriptions</em>}' containment reference list |
| * @generated |
| */ |
| public EList<YDatadescription> getOrphanDatadescriptions() { |
| if (orphanDatadescriptions == null) { |
| orphanDatadescriptions = new EObjectContainmentEList.Resolving<YDatadescription>(YDatadescription.class, this, ExtensionModelPackage.YTAB__ORPHAN_DATADESCRIPTIONS); |
| } |
| return orphanDatadescriptions; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param newEmbeddable |
| * the new cached value of the '{@link #getEmbeddable() |
| * <em>Embeddable</em>}' containment reference |
| * @generated |
| */ |
| public void setEmbeddable(YEmbeddable newEmbeddable) { |
| if (newEmbeddable != embeddable) { |
| NotificationChain msgs = null; |
| if (embeddable != null) |
| msgs = ((InternalEObject)embeddable).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ExtensionModelPackage.YTAB__EMBEDDABLE, null, msgs); |
| if (newEmbeddable != null) |
| msgs = ((InternalEObject)newEmbeddable).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ExtensionModelPackage.YTAB__EMBEDDABLE, null, msgs); |
| msgs = basicSetEmbeddable(newEmbeddable, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ExtensionModelPackage.YTAB__EMBEDDABLE, newEmbeddable, newEmbeddable)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the view gen |
| * @generated |
| */ |
| public YView getViewGen() { |
| // TODO: implement this method |
| // Ensure that you remove @generated or mark it @generated NOT |
| throw new UnsupportedOperationException(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the view |
| * @generated NOT |
| */ |
| public YView getView() { |
| EObject container = eContainer(); |
| if (container instanceof YView) { |
| return (YView) container; |
| } else if (container instanceof YTabSheet) { |
| return ((YTabSheet) container).getView(); |
| } |
| return null; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param otherEnd |
| * the other end |
| * @param featureID |
| * the feature id |
| * @param msgs |
| * the msgs |
| * @return the notification chain |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseAdd(InternalEObject otherEnd, |
| int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case ExtensionModelPackage.YTAB__PARENT: |
| if (eInternalContainer() != null) |
| msgs = eBasicRemoveFromContainer(msgs); |
| return basicSetParent((YTabSheet)otherEnd, msgs); |
| } |
| return super.eInverseAdd(otherEnd, featureID, msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param otherEnd |
| * the other end |
| * @param featureID |
| * the feature id |
| * @param msgs |
| * the msgs |
| * @return the notification chain |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, |
| int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case ExtensionModelPackage.YTAB__PROPERTIES: |
| return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs); |
| case ExtensionModelPackage.YTAB__PARENT: |
| return basicSetParent(null, msgs); |
| case ExtensionModelPackage.YTAB__EMBEDDABLE: |
| return basicSetEmbeddable(null, msgs); |
| case ExtensionModelPackage.YTAB__ORPHAN_DATADESCRIPTIONS: |
| return ((InternalEList<?>)getOrphanDatadescriptions()).basicRemove(otherEnd, msgs); |
| } |
| return super.eInverseRemove(otherEnd, featureID, msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param msgs |
| * the msgs |
| * @return the notification chain |
| * @generated |
| */ |
| @Override |
| public NotificationChain eBasicRemoveFromContainerFeature( |
| NotificationChain msgs) { |
| switch (eContainerFeatureID()) { |
| case ExtensionModelPackage.YTAB__PARENT: |
| return eInternalContainer().eInverseRemove(this, ExtensionModelPackage.YTAB_SHEET__TABS, YTabSheet.class, msgs); |
| } |
| return super.eBasicRemoveFromContainerFeature(msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param featureID |
| * the feature id |
| * @param resolve |
| * the resolve |
| * @param coreType |
| * the core type |
| * @return the object |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case ExtensionModelPackage.YTAB__TAGS: |
| return getTags(); |
| case ExtensionModelPackage.YTAB__ID: |
| return getId(); |
| case ExtensionModelPackage.YTAB__NAME: |
| return getName(); |
| case ExtensionModelPackage.YTAB__PROPERTIES: |
| if (coreType) return getProperties(); |
| else return getProperties().map(); |
| case ExtensionModelPackage.YTAB__CSS_CLASS: |
| return getCssClass(); |
| case ExtensionModelPackage.YTAB__CSS_ID: |
| return getCssID(); |
| case ExtensionModelPackage.YTAB__PARENT: |
| if (resolve) return getParent(); |
| return basicGetParent(); |
| case ExtensionModelPackage.YTAB__EMBEDDABLE: |
| if (resolve) return getEmbeddable(); |
| return basicGetEmbeddable(); |
| case ExtensionModelPackage.YTAB__DATADESCRIPTION: |
| if (resolve) return getDatadescription(); |
| return basicGetDatadescription(); |
| case ExtensionModelPackage.YTAB__ORPHAN_DATADESCRIPTIONS: |
| return getOrphanDatadescriptions(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param featureID |
| * the feature id |
| * @param newValue |
| * the new value |
| * @generated |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case ExtensionModelPackage.YTAB__TAGS: |
| getTags().clear(); |
| getTags().addAll((Collection<? extends String>)newValue); |
| return; |
| case ExtensionModelPackage.YTAB__ID: |
| setId((String)newValue); |
| return; |
| case ExtensionModelPackage.YTAB__NAME: |
| setName((String)newValue); |
| return; |
| case ExtensionModelPackage.YTAB__PROPERTIES: |
| ((EStructuralFeature.Setting)getProperties()).set(newValue); |
| return; |
| case ExtensionModelPackage.YTAB__CSS_CLASS: |
| setCssClass((String)newValue); |
| return; |
| case ExtensionModelPackage.YTAB__CSS_ID: |
| setCssID((String)newValue); |
| return; |
| case ExtensionModelPackage.YTAB__PARENT: |
| setParent((YTabSheet)newValue); |
| return; |
| case ExtensionModelPackage.YTAB__EMBEDDABLE: |
| setEmbeddable((YEmbeddable)newValue); |
| return; |
| case ExtensionModelPackage.YTAB__DATADESCRIPTION: |
| setDatadescription((YDatadescription)newValue); |
| return; |
| case ExtensionModelPackage.YTAB__ORPHAN_DATADESCRIPTIONS: |
| getOrphanDatadescriptions().clear(); |
| getOrphanDatadescriptions().addAll((Collection<? extends YDatadescription>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param featureID |
| * the feature id |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case ExtensionModelPackage.YTAB__TAGS: |
| getTags().clear(); |
| return; |
| case ExtensionModelPackage.YTAB__ID: |
| setId(ID_EDEFAULT); |
| return; |
| case ExtensionModelPackage.YTAB__NAME: |
| setName(NAME_EDEFAULT); |
| return; |
| case ExtensionModelPackage.YTAB__PROPERTIES: |
| getProperties().clear(); |
| return; |
| case ExtensionModelPackage.YTAB__CSS_CLASS: |
| setCssClass(CSS_CLASS_EDEFAULT); |
| return; |
| case ExtensionModelPackage.YTAB__CSS_ID: |
| setCssID(CSS_ID_EDEFAULT); |
| return; |
| case ExtensionModelPackage.YTAB__PARENT: |
| setParent((YTabSheet)null); |
| return; |
| case ExtensionModelPackage.YTAB__EMBEDDABLE: |
| setEmbeddable((YEmbeddable)null); |
| return; |
| case ExtensionModelPackage.YTAB__DATADESCRIPTION: |
| setDatadescription((YDatadescription)null); |
| return; |
| case ExtensionModelPackage.YTAB__ORPHAN_DATADESCRIPTIONS: |
| getOrphanDatadescriptions().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param featureID |
| * the feature id |
| * @return true, if successful |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case ExtensionModelPackage.YTAB__TAGS: |
| return tags != null && !tags.isEmpty(); |
| case ExtensionModelPackage.YTAB__ID: |
| return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id); |
| case ExtensionModelPackage.YTAB__NAME: |
| return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); |
| case ExtensionModelPackage.YTAB__PROPERTIES: |
| return properties != null && !properties.isEmpty(); |
| case ExtensionModelPackage.YTAB__CSS_CLASS: |
| return CSS_CLASS_EDEFAULT == null ? cssClass != null : !CSS_CLASS_EDEFAULT.equals(cssClass); |
| case ExtensionModelPackage.YTAB__CSS_ID: |
| return CSS_ID_EDEFAULT == null ? cssID != null : !CSS_ID_EDEFAULT.equals(cssID); |
| case ExtensionModelPackage.YTAB__PARENT: |
| return basicGetParent() != null; |
| case ExtensionModelPackage.YTAB__EMBEDDABLE: |
| return embeddable != null; |
| case ExtensionModelPackage.YTAB__DATADESCRIPTION: |
| return datadescription != null; |
| case ExtensionModelPackage.YTAB__ORPHAN_DATADESCRIPTIONS: |
| return orphanDatadescriptions != null && !orphanDatadescriptions.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param derivedFeatureID |
| * the derived feature id |
| * @param baseClass |
| * the base class |
| * @return the int |
| * @generated |
| */ |
| @Override |
| public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { |
| if (baseClass == YCssAble.class) { |
| switch (derivedFeatureID) { |
| case ExtensionModelPackage.YTAB__CSS_CLASS: return CoreModelPackage.YCSS_ABLE__CSS_CLASS; |
| case ExtensionModelPackage.YTAB__CSS_ID: return CoreModelPackage.YCSS_ABLE__CSS_ID; |
| default: return -1; |
| } |
| } |
| return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param baseFeatureID |
| * the base feature id |
| * @param baseClass |
| * the base class |
| * @return the int |
| * @generated |
| */ |
| @Override |
| public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) { |
| if (baseClass == YCssAble.class) { |
| switch (baseFeatureID) { |
| case CoreModelPackage.YCSS_ABLE__CSS_CLASS: return ExtensionModelPackage.YTAB__CSS_CLASS; |
| case CoreModelPackage.YCSS_ABLE__CSS_ID: return ExtensionModelPackage.YTAB__CSS_ID; |
| default: return -1; |
| } |
| } |
| return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the string |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (tags: "); |
| result.append(tags); |
| result.append(", id: "); |
| result.append(id); |
| result.append(", name: "); |
| result.append(name); |
| result.append(", cssClass: "); |
| result.append(cssClass); |
| result.append(", cssID: "); |
| result.append(cssID); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| /** |
| * Sets the label by creating a new datadescription. |
| * |
| * @param label |
| * the new label |
| */ |
| public void setLabel(String label) { |
| YDatadescription ds = getDatadescription(); |
| if (ds == null) { |
| setDatadescription(createDatadescription(label)); |
| getOrphanDatadescriptions().add(getDatadescription()); |
| } else { |
| ds.setLabel(label); |
| } |
| } |
| |
| /** |
| * Sets the label i18nKey by creating a new datadescription. |
| * |
| * @param i18nKey |
| * the new label i18n key |
| */ |
| public void setLabelI18nKey(String i18nKey) { |
| YDatadescription ds = getDatadescription(); |
| if (ds == null) { |
| setDatadescription(createDatadescriptionForI18n(i18nKey)); |
| getOrphanDatadescriptions().add(getDatadescription()); |
| } else { |
| ds.setLabelI18nKey(i18nKey); |
| } |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.osbp.ecview.core.extension.model.extension.YTab#getLabel() |
| */ |
| @Override |
| public String getLabel() { |
| YDatadescription ds = getDatadescription(); |
| return ds != null ? ds.getLabel() : null; |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.osbp.ecview.core.extension.model.extension.YTab#getLabelI18nKey() |
| */ |
| @Override |
| public String getLabelI18nKey() { |
| YDatadescription ds = getDatadescription(); |
| return ds != null ? ds.getLabelI18nKey() : null; |
| } |
| |
| /** |
| * Creates the datadescription. |
| * |
| * @param label |
| * the label |
| * @return the y datadescription |
| */ |
| protected YDatadescription createDatadescription(String label) { |
| YDatadescription dsc = DatatypesFactory.eINSTANCE |
| .createYDatadescription(); |
| dsc.setLabel(label); |
| return dsc; |
| } |
| |
| /** |
| * Creates the datadescription for i18n. |
| * |
| * @param i18nKey |
| * the i18n key |
| * @return the y datadescription |
| */ |
| protected YDatadescription createDatadescriptionForI18n(String i18nKey) { |
| YDatadescription dsc = DatatypesFactory.eINSTANCE |
| .createYDatadescription(); |
| dsc.setLabelI18nKey(i18nKey); |
| return dsc; |
| } |
| |
| } // YTabImpl |