Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2006-01-10 18:15:00 +0000
committeratikhomirov2006-01-10 18:15:00 +0000
commita1661f8715f8c6e9f8d90c98d6fe0fcce927f9e9 (patch)
tree1526aabbf20cb6a5bb759752f3f22f49be2a8828 /plugins/org.eclipse.gmf.tooldef
parentfb523ba8b7faec05c8ccac41ad57a66483eff580 (diff)
downloadorg.eclipse.gmf-tooling-a1661f8715f8c6e9f8d90c98d6fe0fcce927f9e9.tar.gz
org.eclipse.gmf-tooling-a1661f8715f8c6e9f8d90c98d6fe0fcce927f9e9.tar.xz
org.eclipse.gmf-tooling-a1661f8715f8c6e9f8d90c98d6fe0fcce927f9e9.zip
multiple values in the generic style selector
Diffstat (limited to 'plugins/org.eclipse.gmf.tooldef')
-rw-r--r--plugins/org.eclipse.gmf.tooldef/models/tooldef.ecore3
-rw-r--r--plugins/org.eclipse.gmf.tooldef/models/tooldef.genmodel2
-rw-r--r--plugins/org.eclipse.gmf.tooldef/src/org/eclipse/gmf/tooldef/GMFToolPackage.java12
-rw-r--r--plugins/org.eclipse.gmf.tooldef/src/org/eclipse/gmf/tooldef/GenericStyleSelector.java29
-rw-r--r--plugins/org.eclipse.gmf.tooldef/src/org/eclipse/gmf/tooldef/impl/GMFToolPackageImpl.java8
-rw-r--r--plugins/org.eclipse.gmf.tooldef/src/org/eclipse/gmf/tooldef/impl/GenericStyleSelectorImpl.java75
6 files changed, 55 insertions, 74 deletions
diff --git a/plugins/org.eclipse.gmf.tooldef/models/tooldef.ecore b/plugins/org.eclipse.gmf.tooldef/models/tooldef.ecore
index 5968f5105..4da7de4cf 100644
--- a/plugins/org.eclipse.gmf.tooldef/models/tooldef.ecore
+++ b/plugins/org.eclipse.gmf.tooldef/models/tooldef.ecore
@@ -114,7 +114,8 @@
</eOperations>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="GenericStyleSelector" eSuperTypes="#//StyleSelector">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="#//AppearanceStyle"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="values" lowerBound="1"
+ upperBound="-1" eType="#//AppearanceStyle"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EEnum" name="AppearanceStyle">
<eLiterals name="Font"/>
diff --git a/plugins/org.eclipse.gmf.tooldef/models/tooldef.genmodel b/plugins/org.eclipse.gmf.tooldef/models/tooldef.genmodel
index 663c89f07..fe74fbc23 100644
--- a/plugins/org.eclipse.gmf.tooldef/models/tooldef.genmodel
+++ b/plugins/org.eclipse.gmf.tooldef/models/tooldef.genmodel
@@ -101,7 +101,7 @@
</genOperations>
</genClasses>
<genClasses ecoreClass="tooldef.ecore#//GenericStyleSelector">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute tooldef.ecore#//GenericStyleSelector/value"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute tooldef.ecore#//GenericStyleSelector/values"/>
</genClasses>
</genPackages>
</genmodel:GenModel>
diff --git a/plugins/org.eclipse.gmf.tooldef/src/org/eclipse/gmf/tooldef/GMFToolPackage.java b/plugins/org.eclipse.gmf.tooldef/src/org/eclipse/gmf/tooldef/GMFToolPackage.java
index ab6e14fc5..756b61a79 100644
--- a/plugins/org.eclipse.gmf.tooldef/src/org/eclipse/gmf/tooldef/GMFToolPackage.java
+++ b/plugins/org.eclipse.gmf.tooldef/src/org/eclipse/gmf/tooldef/GMFToolPackage.java
@@ -1140,13 +1140,13 @@ public interface GMFToolPackage extends EPackage {
int GENERIC_STYLE_SELECTOR = 25;
/**
- * The feature id for the '<em><b>Value</b></em>' attribute.
+ * The feature id for the '<em><b>Values</b></em>' attribute list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int GENERIC_STYLE_SELECTOR__VALUE = STYLE_SELECTOR_FEATURE_COUNT + 0;
+ int GENERIC_STYLE_SELECTOR__VALUES = STYLE_SELECTOR_FEATURE_COUNT + 0;
/**
* The number of structural features of the '<em>Generic Style Selector</em>' class.
@@ -1734,15 +1734,15 @@ public interface GMFToolPackage extends EPackage {
EClass getGenericStyleSelector();
/**
- * Returns the meta object for the attribute '{@link org.eclipse.gmf.tooldef.GenericStyleSelector#getValue <em>Value</em>}'.
+ * Returns the meta object for the attribute list '{@link org.eclipse.gmf.tooldef.GenericStyleSelector#getValues <em>Values</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Value</em>'.
- * @see org.eclipse.gmf.tooldef.GenericStyleSelector#getValue()
+ * @return the meta object for the attribute list '<em>Values</em>'.
+ * @see org.eclipse.gmf.tooldef.GenericStyleSelector#getValues()
* @see #getGenericStyleSelector()
* @generated
*/
- EAttribute getGenericStyleSelector_Value();
+ EAttribute getGenericStyleSelector_Values();
/**
* Returns the meta object for enum '{@link org.eclipse.gmf.tooldef.StandardToolKind <em>Standard Tool Kind</em>}'.
diff --git a/plugins/org.eclipse.gmf.tooldef/src/org/eclipse/gmf/tooldef/GenericStyleSelector.java b/plugins/org.eclipse.gmf.tooldef/src/org/eclipse/gmf/tooldef/GenericStyleSelector.java
index c07bf6f6e..69c68e068 100644
--- a/plugins/org.eclipse.gmf.tooldef/src/org/eclipse/gmf/tooldef/GenericStyleSelector.java
+++ b/plugins/org.eclipse.gmf.tooldef/src/org/eclipse/gmf/tooldef/GenericStyleSelector.java
@@ -6,6 +6,8 @@
*/
package org.eclipse.gmf.tooldef;
+import org.eclipse.emf.common.util.EList;
+
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Generic Style Selector</b></em>'.
@@ -14,7 +16,7 @@ package org.eclipse.gmf.tooldef;
* <p>
* The following features are supported:
* <ul>
- * <li>{@link org.eclipse.gmf.tooldef.GenericStyleSelector#getValue <em>Value</em>}</li>
+ * <li>{@link org.eclipse.gmf.tooldef.GenericStyleSelector#getValues <em>Values</em>}</li>
* </ul>
* </p>
*
@@ -24,32 +26,21 @@ package org.eclipse.gmf.tooldef;
*/
public interface GenericStyleSelector extends StyleSelector {
/**
- * Returns the value of the '<em><b>Value</b></em>' attribute.
+ * Returns the value of the '<em><b>Values</b></em>' attribute list.
+ * The list contents are of type {@link org.eclipse.gmf.tooldef.AppearanceStyle}.
* The literals are from the enumeration {@link org.eclipse.gmf.tooldef.AppearanceStyle}.
* <!-- begin-user-doc -->
* <p>
- * If the meaning of the '<em>Value</em>' attribute isn't clear,
+ * If the meaning of the '<em>Values</em>' attribute list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
- * @return the value of the '<em>Value</em>' attribute.
- * @see org.eclipse.gmf.tooldef.AppearanceStyle
- * @see #setValue(AppearanceStyle)
- * @see org.eclipse.gmf.tooldef.GMFToolPackage#getGenericStyleSelector_Value()
- * @model
- * @generated
- */
- AppearanceStyle getValue();
-
- /**
- * Sets the value of the '{@link org.eclipse.gmf.tooldef.GenericStyleSelector#getValue <em>Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value</em>' attribute.
+ * @return the value of the '<em>Values</em>' attribute list.
* @see org.eclipse.gmf.tooldef.AppearanceStyle
- * @see #getValue()
+ * @see org.eclipse.gmf.tooldef.GMFToolPackage#getGenericStyleSelector_Values()
+ * @model type="org.eclipse.gmf.tooldef.AppearanceStyle" required="true"
* @generated
*/
- void setValue(AppearanceStyle value);
+ EList getValues();
} // GenericStyleSelector
diff --git a/plugins/org.eclipse.gmf.tooldef/src/org/eclipse/gmf/tooldef/impl/GMFToolPackageImpl.java b/plugins/org.eclipse.gmf.tooldef/src/org/eclipse/gmf/tooldef/impl/GMFToolPackageImpl.java
index 9dc303c9b..439911469 100644
--- a/plugins/org.eclipse.gmf.tooldef/src/org/eclipse/gmf/tooldef/impl/GMFToolPackageImpl.java
+++ b/plugins/org.eclipse.gmf.tooldef/src/org/eclipse/gmf/tooldef/impl/GMFToolPackageImpl.java
@@ -800,7 +800,7 @@ public class GMFToolPackageImpl extends EPackageImpl implements GMFToolPackage {
* <!-- end-user-doc -->
* @generated
*/
- public EAttribute getGenericStyleSelector_Value() {
+ public EAttribute getGenericStyleSelector_Values() {
return (EAttribute) genericStyleSelectorEClass.getEStructuralFeatures().get(0);
}
@@ -937,7 +937,7 @@ public class GMFToolPackageImpl extends EPackageImpl implements GMFToolPackage {
styleSelectorEClass = createEClass(STYLE_SELECTOR);
genericStyleSelectorEClass = createEClass(GENERIC_STYLE_SELECTOR);
- createEAttribute(genericStyleSelectorEClass, GENERIC_STYLE_SELECTOR__VALUE);
+ createEAttribute(genericStyleSelectorEClass, GENERIC_STYLE_SELECTOR__VALUES);
// Create enums
standardToolKindEEnum = createEEnum(STANDARD_TOOL_KIND);
@@ -1100,8 +1100,8 @@ public class GMFToolPackageImpl extends EPackageImpl implements GMFToolPackage {
addEParameter(op, ecorePackage.getEJavaObject(), "style", 0, 1);
initEClass(genericStyleSelectorEClass, GenericStyleSelector.class, "GenericStyleSelector", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getGenericStyleSelector_Value(), this.getAppearanceStyle(), "value", null, 0, 1, GenericStyleSelector.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID,
- IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getGenericStyleSelector_Values(), this.getAppearanceStyle(), "values", null, 1, -1, GenericStyleSelector.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE,
+ !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
// Initialize enums and add enum literals
initEEnum(standardToolKindEEnum, StandardToolKind.class, "StandardToolKind");
diff --git a/plugins/org.eclipse.gmf.tooldef/src/org/eclipse/gmf/tooldef/impl/GenericStyleSelectorImpl.java b/plugins/org.eclipse.gmf.tooldef/src/org/eclipse/gmf/tooldef/impl/GenericStyleSelectorImpl.java
index 27e6fc517..b6fe61e81 100644
--- a/plugins/org.eclipse.gmf.tooldef/src/org/eclipse/gmf/tooldef/impl/GenericStyleSelectorImpl.java
+++ b/plugins/org.eclipse.gmf.tooldef/src/org/eclipse/gmf/tooldef/impl/GenericStyleSelectorImpl.java
@@ -6,14 +6,14 @@
*/
package org.eclipse.gmf.tooldef.impl;
-import org.eclipse.emf.common.notify.Notification;
+import java.util.Collection;
+import java.util.Iterator;
+import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
-
+import org.eclipse.emf.ecore.util.EDataTypeUniqueEList;
import org.eclipse.gmf.tooldef.AppearanceStyle;
import org.eclipse.gmf.tooldef.GMFToolPackage;
import org.eclipse.gmf.tooldef.GenericStyleSelector;
@@ -25,7 +25,7 @@ import org.eclipse.gmf.tooldef.GenericStyleSelector;
* <p>
* The following features are implemented:
* <ul>
- * <li>{@link org.eclipse.gmf.tooldef.impl.GenericStyleSelectorImpl#getValue <em>Value</em>}</li>
+ * <li>{@link org.eclipse.gmf.tooldef.impl.GenericStyleSelectorImpl#getValues <em>Values</em>}</li>
* </ul>
* </p>
*
@@ -33,24 +33,14 @@ import org.eclipse.gmf.tooldef.GenericStyleSelector;
*/
public class GenericStyleSelectorImpl extends EObjectImpl implements GenericStyleSelector {
/**
- * The default value of the '{@link #getValue() <em>Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValue()
- * @generated
- * @ordered
- */
- protected static final AppearanceStyle VALUE_EDEFAULT = AppearanceStyle.FONT_LITERAL;
-
- /**
- * The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
+ * The cached value of the '{@link #getValues() <em>Values</em>}' attribute list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see #getValue()
+ * @see #getValues()
* @generated
* @ordered
*/
- protected AppearanceStyle value = VALUE_EDEFAULT;
+ protected EList values = null;
/**
* <!-- begin-user-doc -->
@@ -75,20 +65,11 @@ public class GenericStyleSelectorImpl extends EObjectImpl implements GenericStyl
* <!-- end-user-doc -->
* @generated
*/
- public AppearanceStyle getValue() {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setValue(AppearanceStyle newValue) {
- AppearanceStyle oldValue = value;
- value = newValue == null ? VALUE_EDEFAULT : newValue;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, GMFToolPackage.GENERIC_STYLE_SELECTOR__VALUE, oldValue, value));
+ public EList getValues() {
+ if (values == null) {
+ values = new EDataTypeUniqueEList(AppearanceStyle.class, this, GMFToolPackage.GENERIC_STYLE_SELECTOR__VALUES);
+ }
+ return values;
}
/**
@@ -100,7 +81,14 @@ public class GenericStyleSelectorImpl extends EObjectImpl implements GenericStyl
if (false == style instanceof EObject) {
return false;
}
- return ((EObject) style).eClass().getName().equals(getValue().getName() + "Style");
+ final String styleName = ((EObject) style).eClass().getName();
+ for (Iterator it = getValues().iterator(); it.hasNext(); ) {
+ AppearanceStyle s = (AppearanceStyle) it.next();
+ if (styleName.equals(s.getName() + "Style")) {
+ return true;
+ }
+ }
+ return false;
}
/**
@@ -110,8 +98,8 @@ public class GenericStyleSelectorImpl extends EObjectImpl implements GenericStyl
*/
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
- case GMFToolPackage.GENERIC_STYLE_SELECTOR__VALUE:
- return getValue();
+ case GMFToolPackage.GENERIC_STYLE_SELECTOR__VALUES:
+ return getValues();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -123,8 +111,9 @@ public class GenericStyleSelectorImpl extends EObjectImpl implements GenericStyl
*/
public void eSet(int featureID, Object newValue) {
switch (featureID) {
- case GMFToolPackage.GENERIC_STYLE_SELECTOR__VALUE:
- setValue((AppearanceStyle) newValue);
+ case GMFToolPackage.GENERIC_STYLE_SELECTOR__VALUES:
+ getValues().clear();
+ getValues().addAll((Collection) newValue);
return;
}
super.eSet(featureID, newValue);
@@ -137,8 +126,8 @@ public class GenericStyleSelectorImpl extends EObjectImpl implements GenericStyl
*/
public void eUnset(int featureID) {
switch (featureID) {
- case GMFToolPackage.GENERIC_STYLE_SELECTOR__VALUE:
- setValue(VALUE_EDEFAULT);
+ case GMFToolPackage.GENERIC_STYLE_SELECTOR__VALUES:
+ getValues().clear();
return;
}
super.eUnset(featureID);
@@ -151,8 +140,8 @@ public class GenericStyleSelectorImpl extends EObjectImpl implements GenericStyl
*/
public boolean eIsSet(int featureID) {
switch (featureID) {
- case GMFToolPackage.GENERIC_STYLE_SELECTOR__VALUE:
- return value != VALUE_EDEFAULT;
+ case GMFToolPackage.GENERIC_STYLE_SELECTOR__VALUES:
+ return values != null && !values.isEmpty();
}
return super.eIsSet(featureID);
}
@@ -167,8 +156,8 @@ public class GenericStyleSelectorImpl extends EObjectImpl implements GenericStyl
return super.toString();
StringBuffer result = new StringBuffer(super.toString());
- result.append(" (value: ");
- result.append(value);
+ result.append(" (values: ");
+ result.append(values);
result.append(')');
return result.toString();
}

Back to the top