diff options
Diffstat (limited to 'extraplugins/diagram-definition/org.eclipse.papyrus.dd/src/org/eclipse/papyrus/dd/dg/impl/StyleRuleImpl.java')
-rw-r--r-- | extraplugins/diagram-definition/org.eclipse.papyrus.dd/src/org/eclipse/papyrus/dd/dg/impl/StyleRuleImpl.java | 80 |
1 files changed, 44 insertions, 36 deletions
diff --git a/extraplugins/diagram-definition/org.eclipse.papyrus.dd/src/org/eclipse/papyrus/dd/dg/impl/StyleRuleImpl.java b/extraplugins/diagram-definition/org.eclipse.papyrus.dd/src/org/eclipse/papyrus/dd/dg/impl/StyleRuleImpl.java index a091e6bd91f..cba09617cd0 100644 --- a/extraplugins/diagram-definition/org.eclipse.papyrus.dd/src/org/eclipse/papyrus/dd/dg/impl/StyleRuleImpl.java +++ b/extraplugins/diagram-definition/org.eclipse.papyrus.dd/src/org/eclipse/papyrus/dd/dg/impl/StyleRuleImpl.java @@ -1,11 +1,11 @@ /** * Copyright (c) 2014 CEA LIST. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * CEA LIST - Initial API and implementation */ @@ -41,7 +41,7 @@ import org.eclipse.papyrus.dd.dg.StyleSelector; * <li>{@link org.eclipse.papyrus.dd.dg.impl.StyleRuleImpl#getStyle <em>Style</em>}</li> * </ul> * </p> - * + * * @generated */ public class StyleRuleImpl extends MinimalEObjectImpl.Container implements StyleRule { @@ -49,7 +49,7 @@ public class StyleRuleImpl extends MinimalEObjectImpl.Container implements Style /** * The cached value of the '{@link #getSelectors() <em>Selector</em>}' containment reference list. * <!-- begin-user-doc --> <!-- end-user-doc --> - * + * * @see #getSelectors() * @generated * @ordered @@ -59,7 +59,7 @@ public class StyleRuleImpl extends MinimalEObjectImpl.Container implements Style /** * The cached value of the '{@link #getStyle() <em>Style</em>}' containment reference. * <!-- begin-user-doc --> <!-- end-user-doc --> - * + * * @see #getStyle() * @generated * @ordered @@ -68,7 +68,7 @@ public class StyleRuleImpl extends MinimalEObjectImpl.Container implements Style /** * <!-- begin-user-doc --> <!-- end-user-doc --> - * + * * @generated */ protected StyleRuleImpl() { @@ -77,7 +77,7 @@ public class StyleRuleImpl extends MinimalEObjectImpl.Container implements Style /** * <!-- begin-user-doc --> <!-- end-user-doc --> - * + * * @generated */ @Override @@ -87,11 +87,12 @@ public class StyleRuleImpl extends MinimalEObjectImpl.Container implements Style /** * <!-- begin-user-doc --> <!-- end-user-doc --> - * + * * @generated */ + @Override public EList<StyleSelector> getSelectors() { - if(selectors == null) { + if (selectors == null) { selectors = new EObjectContainmentEList<StyleSelector>(StyleSelector.class, this, DGPackage.STYLE_RULE__SELECTOR); } return selectors; @@ -99,60 +100,67 @@ public class StyleRuleImpl extends MinimalEObjectImpl.Container implements Style /** * <!-- begin-user-doc --> <!-- end-user-doc --> - * + * * @generated */ + @Override public Style getStyle() { return style; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> - * + * * @generated */ public NotificationChain basicSetStyle(Style newStyle, NotificationChain msgs) { Style oldStyle = style; style = newStyle; - if(eNotificationRequired()) { + if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DGPackage.STYLE_RULE__STYLE, oldStyle, newStyle); - if(msgs == null) + if (msgs == null) { msgs = notification; - else + } else { msgs.add(notification); + } } return msgs; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> - * + * * @generated */ + @Override public void setStyle(Style newStyle) { - if(newStyle != style) { + if (newStyle != style) { NotificationChain msgs = null; - if(style != null) - msgs = ((InternalEObject)style).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DGPackage.STYLE_RULE__STYLE, null, msgs); - if(newStyle != null) - msgs = ((InternalEObject)newStyle).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DGPackage.STYLE_RULE__STYLE, null, msgs); + if (style != null) { + msgs = ((InternalEObject) style).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DGPackage.STYLE_RULE__STYLE, null, msgs); + } + if (newStyle != null) { + msgs = ((InternalEObject) newStyle).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DGPackage.STYLE_RULE__STYLE, null, msgs); + } msgs = basicSetStyle(newStyle, msgs); - if(msgs != null) + if (msgs != null) { msgs.dispatch(); - } else if(eNotificationRequired()) + } + } else if (eNotificationRequired()) { eNotify(new ENotificationImpl(this, Notification.SET, DGPackage.STYLE_RULE__STYLE, newStyle, newStyle)); + } } /** * <!-- begin-user-doc --> <!-- end-user-doc --> - * + * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch(featureID) { + switch (featureID) { case DGPackage.STYLE_RULE__SELECTOR: - return ((InternalEList<?>)getSelectors()).basicRemove(otherEnd, msgs); + return ((InternalEList<?>) getSelectors()).basicRemove(otherEnd, msgs); case DGPackage.STYLE_RULE__STYLE: return basicSetStyle(null, msgs); } @@ -161,12 +169,12 @@ public class StyleRuleImpl extends MinimalEObjectImpl.Container implements Style /** * <!-- begin-user-doc --> <!-- end-user-doc --> - * + * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch(featureID) { + switch (featureID) { case DGPackage.STYLE_RULE__SELECTOR: return getSelectors(); case DGPackage.STYLE_RULE__STYLE: @@ -177,19 +185,19 @@ public class StyleRuleImpl extends MinimalEObjectImpl.Container implements Style /** * <!-- begin-user-doc --> <!-- end-user-doc --> - * + * * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { - switch(featureID) { + switch (featureID) { case DGPackage.STYLE_RULE__SELECTOR: getSelectors().clear(); - getSelectors().addAll((Collection<? extends StyleSelector>)newValue); + getSelectors().addAll((Collection<? extends StyleSelector>) newValue); return; case DGPackage.STYLE_RULE__STYLE: - setStyle((Style)newValue); + setStyle((Style) newValue); return; } super.eSet(featureID, newValue); @@ -197,17 +205,17 @@ public class StyleRuleImpl extends MinimalEObjectImpl.Container implements Style /** * <!-- begin-user-doc --> <!-- end-user-doc --> - * + * * @generated */ @Override public void eUnset(int featureID) { - switch(featureID) { + switch (featureID) { case DGPackage.STYLE_RULE__SELECTOR: getSelectors().clear(); return; case DGPackage.STYLE_RULE__STYLE: - setStyle((Style)null); + setStyle((Style) null); return; } super.eUnset(featureID); @@ -215,12 +223,12 @@ public class StyleRuleImpl extends MinimalEObjectImpl.Container implements Style /** * <!-- begin-user-doc --> <!-- end-user-doc --> - * + * * @generated */ @Override public boolean eIsSet(int featureID) { - switch(featureID) { + switch (featureID) { case DGPackage.STYLE_RULE__SELECTOR: return selectors != null && !selectors.isEmpty(); case DGPackage.STYLE_RULE__STYLE: |