diff options
author | Eike Stepper | 2013-10-22 16:51:57 +0000 |
---|---|---|
committer | Eike Stepper | 2013-10-22 16:51:57 +0000 |
commit | 7a74ca646b78f03a3fc266b95c0f8351dcbcffc2 (patch) | |
tree | 74c361b8fd304f452d0a7f375dcd966748aea182 /plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences | |
parent | 262e082974e7c6bb38d9ae9b61d7c6fa661802e4 (diff) | |
download | cdo-7a74ca646b78f03a3fc266b95c0f8351dcbcffc2.tar.gz cdo-7a74ca646b78f03a3fc266b95c0f8351dcbcffc2.tar.xz cdo-7a74ca646b78f03a3fc266b95c0f8351dcbcffc2.zip |
Enrich the preferences model
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences')
11 files changed, 1554 insertions, 322 deletions
diff --git a/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/PreferenceItem.java b/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/PreferenceItem.java new file mode 100644 index 0000000000..edc6ae9f0b --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/PreferenceItem.java @@ -0,0 +1,147 @@ +/** + */ +package org.eclipse.emf.cdo.releng.preferences; + +import org.eclipse.emf.ecore.EObject; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Preference Item</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * <ul> + * <li>{@link org.eclipse.emf.cdo.releng.preferences.PreferenceItem#getRoot <em>Root</em>}</li> + * <li>{@link org.eclipse.emf.cdo.releng.preferences.PreferenceItem#getScope <em>Scope</em>}</li> + * <li>{@link org.eclipse.emf.cdo.releng.preferences.PreferenceItem#getAbsolutePath <em>Absolute Path</em>}</li> + * <li>{@link org.eclipse.emf.cdo.releng.preferences.PreferenceItem#getScopeRelativePath <em>Scope Relative Path</em>}</li> + * <li>{@link org.eclipse.emf.cdo.releng.preferences.PreferenceItem#getName <em>Name</em>}</li> + * </ul> + * </p> + * + * @see org.eclipse.emf.cdo.releng.preferences.PreferencesPackage#getPreferenceItem() + * @model abstract="true" + * @generated + */ +public interface PreferenceItem extends EObject +{ + /** + * Returns the value of the '<em><b>Root</b></em>' reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Root</em>' reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Root</em>' reference. + * @see org.eclipse.emf.cdo.releng.preferences.PreferencesPackage#getPreferenceItem_Root() + * @model resolveProxies="false" transient="true" changeable="false" volatile="true" derived="true" + * @generated + */ + PreferenceNode getRoot(); + + /** + * Returns the value of the '<em><b>Absolute Path</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Absolute Path</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Absolute Path</em>' attribute. + * @see org.eclipse.emf.cdo.releng.preferences.PreferencesPackage#getPreferenceItem_AbsolutePath() + * @model required="true" transient="true" changeable="false" volatile="true" derived="true" + * @generated + */ + String getAbsolutePath(); + + /** + * Returns the value of the '<em><b>Scope Relative Path</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Scope Relative Path</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Scope Relative Path</em>' attribute. + * @see org.eclipse.emf.cdo.releng.preferences.PreferencesPackage#getPreferenceItem_ScopeRelativePath() + * @model required="true" transient="true" changeable="false" volatile="true" derived="true" + * @generated + */ + String getScopeRelativePath(); + + /** + * Returns the value of the '<em><b>Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Name</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Name</em>' attribute. + * @see #setName(String) + * @see org.eclipse.emf.cdo.releng.preferences.PreferencesPackage#getPreferenceItem_Name() + * @model required="true" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.emf.cdo.releng.preferences.PreferenceItem#getName <em>Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Name</em>' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the '<em><b>Scope</b></em>' reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Scope</em>' reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Scope</em>' reference. + * @see org.eclipse.emf.cdo.releng.preferences.PreferencesPackage#getPreferenceItem_Scope() + * @model resolveProxies="false" transient="true" changeable="false" volatile="true" derived="true" + * @generated + */ + PreferenceNode getScope(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model kind="operation" + * @generated + */ + PreferenceNode getParent(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model + * @generated + */ + PreferenceItem getItem(String path); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model + * @generated + */ + PreferenceItem getInScope(String scopeName); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model kind="operation" + * @generated + */ + PreferenceItem getInScope(); + +} // PreferenceItem diff --git a/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/PreferenceNode.java b/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/PreferenceNode.java index 9b24a2c5d4..9c1674f3b0 100644 --- a/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/PreferenceNode.java +++ b/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/PreferenceNode.java @@ -11,7 +11,6 @@ package org.eclipse.emf.cdo.releng.preferences; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; /** * <!-- begin-user-doc --> @@ -21,10 +20,9 @@ import org.eclipse.emf.ecore.EObject; * <p> * The following features are supported: * <ul> - * <li>{@link org.eclipse.emf.cdo.releng.preferences.PreferenceNode#getChildren <em>Children</em>}</li> * <li>{@link org.eclipse.emf.cdo.releng.preferences.PreferenceNode#getParent <em>Parent</em>}</li> + * <li>{@link org.eclipse.emf.cdo.releng.preferences.PreferenceNode#getChildren <em>Children</em>}</li> * <li>{@link org.eclipse.emf.cdo.releng.preferences.PreferenceNode#getProperties <em>Properties</em>}</li> - * <li>{@link org.eclipse.emf.cdo.releng.preferences.PreferenceNode#getName <em>Name</em>}</li> * <li>{@link org.eclipse.emf.cdo.releng.preferences.PreferenceNode#getLocation <em>Location</em>}</li> * </ul> * </p> @@ -33,7 +31,7 @@ import org.eclipse.emf.ecore.EObject; * @model * @generated */ -public interface PreferenceNode extends EObject +public interface PreferenceNode extends PreferenceItem { /** * Returns the value of the '<em><b>Children</b></em>' containment reference list. @@ -48,7 +46,7 @@ public interface PreferenceNode extends EObject * @return the value of the '<em>Children</em>' containment reference list. * @see org.eclipse.emf.cdo.releng.preferences.PreferencesPackage#getPreferenceNode_Children() * @see org.eclipse.emf.cdo.releng.preferences.PreferenceNode#getParent - * @model opposite="parent" containment="true" keys="name" + * @model opposite="parent" containment="true" * @generated */ EList<PreferenceNode> getChildren(); @@ -100,45 +98,35 @@ public interface PreferenceNode extends EObject EList<Property> getProperties(); /** - * Returns the value of the '<em><b>Name</b></em>' attribute. + * Returns the value of the '<em><b>Location</b></em>' attribute. * <!-- begin-user-doc --> * <p> - * If the meaning of the '<em>Name</em>' attribute isn't clear, + * If the meaning of the '<em>Location</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> - * @return the value of the '<em>Name</em>' attribute. - * @see #setName(String) - * @see org.eclipse.emf.cdo.releng.preferences.PreferencesPackage#getPreferenceNode_Name() - * @model required="true" + * @return the value of the '<em>Location</em>' attribute. + * @see org.eclipse.emf.cdo.releng.preferences.PreferencesPackage#getPreferenceNode_Location() + * @model transient="true" changeable="false" volatile="true" derived="true" * @generated */ - String getName(); + String getLocation(); /** - * Sets the value of the '{@link org.eclipse.emf.cdo.releng.preferences.PreferenceNode#getName <em>Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @param value the new value of the '<em>Name</em>' attribute. - * @see #getName() + * @model * @generated */ - void setName(String value); + PreferenceNode getNode(String name); /** - * Returns the value of the '<em><b>Location</b></em>' attribute. * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Location</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> * <!-- end-user-doc --> - * @return the value of the '<em>Location</em>' attribute. - * @see org.eclipse.emf.cdo.releng.preferences.PreferencesPackage#getPreferenceNode_Location() - * @model transient="true" changeable="false" volatile="true" derived="true" + * @model * @generated */ - String getLocation(); + Property getProperty(String name); /** * <!-- begin-user-doc --> @@ -146,14 +134,14 @@ public interface PreferenceNode extends EObject * @model * @generated */ - PreferenceNode getNode(String name); + PreferenceNode getInScope(String scopeName); /** * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @model + * @model kind="operation" * @generated */ - Property getProperty(String name); + PreferenceNode getInScope(); } // PreferenceNode diff --git a/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/PreferencesPackage.java b/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/PreferencesPackage.java index 60a5a5d17a..442af3445d 100644 --- a/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/PreferencesPackage.java +++ b/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/PreferencesPackage.java @@ -68,6 +68,115 @@ public interface PreferencesPackage extends EPackage PreferencesPackage eINSTANCE = org.eclipse.emf.cdo.releng.preferences.impl.PreferencesPackageImpl.init(); /** + * The meta object id for the '{@link org.eclipse.emf.cdo.releng.preferences.impl.PreferenceItemImpl <em>Preference Item</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.releng.preferences.impl.PreferenceItemImpl + * @see org.eclipse.emf.cdo.releng.preferences.impl.PreferencesPackageImpl#getPreferenceItem() + * @generated + */ + int PREFERENCE_ITEM = 0; + + /** + * The feature id for the '<em><b>Root</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PREFERENCE_ITEM__ROOT = 0; + + /** + * The feature id for the '<em><b>Scope</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PREFERENCE_ITEM__SCOPE = 1; + + /** + * The feature id for the '<em><b>Absolute Path</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PREFERENCE_ITEM__ABSOLUTE_PATH = 2; + + /** + * The feature id for the '<em><b>Scope Relative Path</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PREFERENCE_ITEM__SCOPE_RELATIVE_PATH = 3; + + /** + * The feature id for the '<em><b>Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PREFERENCE_ITEM__NAME = 4; + + /** + * The number of structural features of the '<em>Preference Item</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PREFERENCE_ITEM_FEATURE_COUNT = 5; + + /** + * The operation id for the '<em>Get Parent</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PREFERENCE_ITEM___GET_PARENT = 0; + + /** + * The operation id for the '<em>Get Item</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PREFERENCE_ITEM___GET_ITEM__STRING = 1; + + /** + * The operation id for the '<em>Get In Scope</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PREFERENCE_ITEM___GET_IN_SCOPE__STRING = 2; + + /** + * The operation id for the '<em>Get In Scope</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PREFERENCE_ITEM___GET_IN_SCOPE = 3; + + /** + * The number of operations of the '<em>Preference Item</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PREFERENCE_ITEM_OPERATION_COUNT = 4; + + /** * The meta object id for the '{@link org.eclipse.emf.cdo.releng.preferences.impl.PreferenceNodeImpl <em>Preference Node</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -75,34 +184,43 @@ public interface PreferencesPackage extends EPackage * @see org.eclipse.emf.cdo.releng.preferences.impl.PreferencesPackageImpl#getPreferenceNode() * @generated */ - int PREFERENCE_NODE = 0; + int PREFERENCE_NODE = 1; /** - * The feature id for the '<em><b>Children</b></em>' containment reference list. + * The feature id for the '<em><b>Root</b></em>' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - int PREFERENCE_NODE__CHILDREN = 0; + int PREFERENCE_NODE__ROOT = PREFERENCE_ITEM__ROOT; /** - * The feature id for the '<em><b>Parent</b></em>' container reference. + * The feature id for the '<em><b>Scope</b></em>' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - int PREFERENCE_NODE__PARENT = 1; + int PREFERENCE_NODE__SCOPE = PREFERENCE_ITEM__SCOPE; /** - * The feature id for the '<em><b>Properties</b></em>' containment reference list. + * The feature id for the '<em><b>Absolute Path</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - int PREFERENCE_NODE__PROPERTIES = 2; + int PREFERENCE_NODE__ABSOLUTE_PATH = PREFERENCE_ITEM__ABSOLUTE_PATH; + + /** + * The feature id for the '<em><b>Scope Relative Path</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PREFERENCE_NODE__SCOPE_RELATIVE_PATH = PREFERENCE_ITEM__SCOPE_RELATIVE_PATH; /** * The feature id for the '<em><b>Name</b></em>' attribute. @@ -111,7 +229,34 @@ public interface PreferencesPackage extends EPackage * @generated * @ordered */ - int PREFERENCE_NODE__NAME = 3; + int PREFERENCE_NODE__NAME = PREFERENCE_ITEM__NAME; + + /** + * The feature id for the '<em><b>Parent</b></em>' container reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PREFERENCE_NODE__PARENT = PREFERENCE_ITEM_FEATURE_COUNT + 0; + + /** + * The feature id for the '<em><b>Children</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PREFERENCE_NODE__CHILDREN = PREFERENCE_ITEM_FEATURE_COUNT + 1; + + /** + * The feature id for the '<em><b>Properties</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PREFERENCE_NODE__PROPERTIES = PREFERENCE_ITEM_FEATURE_COUNT + 2; /** * The feature id for the '<em><b>Location</b></em>' attribute. @@ -120,7 +265,7 @@ public interface PreferencesPackage extends EPackage * @generated * @ordered */ - int PREFERENCE_NODE__LOCATION = 4; + int PREFERENCE_NODE__LOCATION = PREFERENCE_ITEM_FEATURE_COUNT + 3; /** * The number of structural features of the '<em>Preference Node</em>' class. @@ -129,7 +274,25 @@ public interface PreferencesPackage extends EPackage * @generated * @ordered */ - int PREFERENCE_NODE_FEATURE_COUNT = 5; + int PREFERENCE_NODE_FEATURE_COUNT = PREFERENCE_ITEM_FEATURE_COUNT + 4; + + /** + * The operation id for the '<em>Get Parent</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PREFERENCE_NODE___GET_PARENT = PREFERENCE_ITEM___GET_PARENT; + + /** + * The operation id for the '<em>Get Item</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PREFERENCE_NODE___GET_ITEM__STRING = PREFERENCE_ITEM___GET_ITEM__STRING; /** * The operation id for the '<em>Get Node</em>' operation. @@ -138,7 +301,7 @@ public interface PreferencesPackage extends EPackage * @generated * @ordered */ - int PREFERENCE_NODE___GET_NODE__STRING = 0; + int PREFERENCE_NODE___GET_NODE__STRING = PREFERENCE_ITEM_OPERATION_COUNT + 0; /** * The operation id for the '<em>Get Property</em>' operation. @@ -147,7 +310,25 @@ public interface PreferencesPackage extends EPackage * @generated * @ordered */ - int PREFERENCE_NODE___GET_PROPERTY__STRING = 1; + int PREFERENCE_NODE___GET_PROPERTY__STRING = PREFERENCE_ITEM_OPERATION_COUNT + 1; + + /** + * The operation id for the '<em>Get In Scope</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PREFERENCE_NODE___GET_IN_SCOPE__STRING = PREFERENCE_ITEM_OPERATION_COUNT + 2; + + /** + * The operation id for the '<em>Get In Scope</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PREFERENCE_NODE___GET_IN_SCOPE = PREFERENCE_ITEM_OPERATION_COUNT + 3; /** * The number of operations of the '<em>Preference Node</em>' class. @@ -156,7 +337,7 @@ public interface PreferencesPackage extends EPackage * @generated * @ordered */ - int PREFERENCE_NODE_OPERATION_COUNT = 2; + int PREFERENCE_NODE_OPERATION_COUNT = PREFERENCE_ITEM_OPERATION_COUNT + 4; /** * The meta object id for the '{@link org.eclipse.emf.cdo.releng.preferences.impl.PropertyImpl <em>Property</em>}' class. @@ -166,7 +347,43 @@ public interface PreferencesPackage extends EPackage * @see org.eclipse.emf.cdo.releng.preferences.impl.PreferencesPackageImpl#getProperty() * @generated */ - int PROPERTY = 1; + int PROPERTY = 2; + + /** + * The feature id for the '<em><b>Root</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PROPERTY__ROOT = PREFERENCE_ITEM__ROOT; + + /** + * The feature id for the '<em><b>Scope</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PROPERTY__SCOPE = PREFERENCE_ITEM__SCOPE; + + /** + * The feature id for the '<em><b>Absolute Path</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PROPERTY__ABSOLUTE_PATH = PREFERENCE_ITEM__ABSOLUTE_PATH; + + /** + * The feature id for the '<em><b>Scope Relative Path</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PROPERTY__SCOPE_RELATIVE_PATH = PREFERENCE_ITEM__SCOPE_RELATIVE_PATH; /** * The feature id for the '<em><b>Name</b></em>' attribute. @@ -175,7 +392,7 @@ public interface PreferencesPackage extends EPackage * @generated * @ordered */ - int PROPERTY__NAME = 0; + int PROPERTY__NAME = PREFERENCE_ITEM__NAME; /** * The feature id for the '<em><b>Parent</b></em>' container reference. @@ -184,7 +401,7 @@ public interface PreferencesPackage extends EPackage * @generated * @ordered */ - int PROPERTY__PARENT = 1; + int PROPERTY__PARENT = PREFERENCE_ITEM_FEATURE_COUNT + 0; /** * The feature id for the '<em><b>Value</b></em>' attribute. @@ -193,7 +410,7 @@ public interface PreferencesPackage extends EPackage * @generated * @ordered */ - int PROPERTY__VALUE = 2; + int PROPERTY__VALUE = PREFERENCE_ITEM_FEATURE_COUNT + 1; /** * The number of structural features of the '<em>Property</em>' class. @@ -202,7 +419,43 @@ public interface PreferencesPackage extends EPackage * @generated * @ordered */ - int PROPERTY_FEATURE_COUNT = 3; + int PROPERTY_FEATURE_COUNT = PREFERENCE_ITEM_FEATURE_COUNT + 2; + + /** + * The operation id for the '<em>Get Parent</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PROPERTY___GET_PARENT = PREFERENCE_ITEM___GET_PARENT; + + /** + * The operation id for the '<em>Get Item</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PROPERTY___GET_ITEM__STRING = PREFERENCE_ITEM___GET_ITEM__STRING; + + /** + * The operation id for the '<em>Get In Scope</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PROPERTY___GET_IN_SCOPE__STRING = PREFERENCE_ITEM_OPERATION_COUNT + 0; + + /** + * The operation id for the '<em>Get In Scope</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PROPERTY___GET_IN_SCOPE = PREFERENCE_ITEM_OPERATION_COUNT + 1; /** * The number of operations of the '<em>Property</em>' class. @@ -211,7 +464,7 @@ public interface PreferencesPackage extends EPackage * @generated * @ordered */ - int PROPERTY_OPERATION_COUNT = 0; + int PROPERTY_OPERATION_COUNT = PREFERENCE_ITEM_OPERATION_COUNT + 2; /** * The meta object id for the '<em>Escaped String</em>' data type. @@ -221,7 +474,112 @@ public interface PreferencesPackage extends EPackage * @see org.eclipse.emf.cdo.releng.preferences.impl.PreferencesPackageImpl#getEscapedString() * @generated */ - int ESCAPED_STRING = 2; + int ESCAPED_STRING = 3; + + /** + * Returns the meta object for class '{@link org.eclipse.emf.cdo.releng.preferences.PreferenceItem <em>Preference Item</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Preference Item</em>'. + * @see org.eclipse.emf.cdo.releng.preferences.PreferenceItem + * @generated + */ + EClass getPreferenceItem(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.emf.cdo.releng.preferences.PreferenceItem#getRoot <em>Root</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference '<em>Root</em>'. + * @see org.eclipse.emf.cdo.releng.preferences.PreferenceItem#getRoot() + * @see #getPreferenceItem() + * @generated + */ + EReference getPreferenceItem_Root(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.releng.preferences.PreferenceItem#getAbsolutePath <em>Absolute Path</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Absolute Path</em>'. + * @see org.eclipse.emf.cdo.releng.preferences.PreferenceItem#getAbsolutePath() + * @see #getPreferenceItem() + * @generated + */ + EAttribute getPreferenceItem_AbsolutePath(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.releng.preferences.PreferenceItem#getScopeRelativePath <em>Scope Relative Path</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Scope Relative Path</em>'. + * @see org.eclipse.emf.cdo.releng.preferences.PreferenceItem#getScopeRelativePath() + * @see #getPreferenceItem() + * @generated + */ + EAttribute getPreferenceItem_ScopeRelativePath(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.releng.preferences.PreferenceItem#getName <em>Name</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Name</em>'. + * @see org.eclipse.emf.cdo.releng.preferences.PreferenceItem#getName() + * @see #getPreferenceItem() + * @generated + */ + EAttribute getPreferenceItem_Name(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.emf.cdo.releng.preferences.PreferenceItem#getScope <em>Scope</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference '<em>Scope</em>'. + * @see org.eclipse.emf.cdo.releng.preferences.PreferenceItem#getScope() + * @see #getPreferenceItem() + * @generated + */ + EReference getPreferenceItem_Scope(); + + /** + * Returns the meta object for the '{@link org.eclipse.emf.cdo.releng.preferences.PreferenceItem#getParent() <em>Get Parent</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Get Parent</em>' operation. + * @see org.eclipse.emf.cdo.releng.preferences.PreferenceItem#getParent() + * @generated + */ + EOperation getPreferenceItem__GetParent(); + + /** + * Returns the meta object for the '{@link org.eclipse.emf.cdo.releng.preferences.PreferenceItem#getItem(java.lang.String) <em>Get Item</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Get Item</em>' operation. + * @see org.eclipse.emf.cdo.releng.preferences.PreferenceItem#getItem(java.lang.String) + * @generated + */ + EOperation getPreferenceItem__GetItem__String(); + + /** + * Returns the meta object for the '{@link org.eclipse.emf.cdo.releng.preferences.PreferenceItem#getInScope(java.lang.String) <em>Get In Scope</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Get In Scope</em>' operation. + * @see org.eclipse.emf.cdo.releng.preferences.PreferenceItem#getInScope(java.lang.String) + * @generated + */ + EOperation getPreferenceItem__GetInScope__String(); + + /** + * Returns the meta object for the '{@link org.eclipse.emf.cdo.releng.preferences.PreferenceItem#getInScope() <em>Get In Scope</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Get In Scope</em>' operation. + * @see org.eclipse.emf.cdo.releng.preferences.PreferenceItem#getInScope() + * @generated + */ + EOperation getPreferenceItem__GetInScope(); /** * Returns the meta object for class '{@link org.eclipse.emf.cdo.releng.preferences.PreferenceNode <em>Preference Node</em>}'. @@ -267,17 +625,6 @@ public interface PreferencesPackage extends EPackage EReference getPreferenceNode_Properties(); /** - * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.releng.preferences.PreferenceNode#getName <em>Name</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Name</em>'. - * @see org.eclipse.emf.cdo.releng.preferences.PreferenceNode#getName() - * @see #getPreferenceNode() - * @generated - */ - EAttribute getPreferenceNode_Name(); - - /** * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.releng.preferences.PreferenceNode#getLocation <em>Location</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -309,25 +656,34 @@ public interface PreferencesPackage extends EPackage EOperation getPreferenceNode__GetProperty__String(); /** - * Returns the meta object for class '{@link org.eclipse.emf.cdo.releng.preferences.Property <em>Property</em>}'. + * Returns the meta object for the '{@link org.eclipse.emf.cdo.releng.preferences.PreferenceNode#getInScope(java.lang.String) <em>Get In Scope</em>}' operation. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @return the meta object for class '<em>Property</em>'. - * @see org.eclipse.emf.cdo.releng.preferences.Property + * @return the meta object for the '<em>Get In Scope</em>' operation. + * @see org.eclipse.emf.cdo.releng.preferences.PreferenceNode#getInScope(java.lang.String) * @generated */ - EClass getProperty(); + EOperation getPreferenceNode__GetInScope__String(); /** - * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.releng.preferences.Property#getName <em>Name</em>}'. + * Returns the meta object for the '{@link org.eclipse.emf.cdo.releng.preferences.PreferenceNode#getInScope() <em>Get In Scope</em>}' operation. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Name</em>'. - * @see org.eclipse.emf.cdo.releng.preferences.Property#getName() - * @see #getProperty() + * @return the meta object for the '<em>Get In Scope</em>' operation. + * @see org.eclipse.emf.cdo.releng.preferences.PreferenceNode#getInScope() + * @generated + */ + EOperation getPreferenceNode__GetInScope(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.cdo.releng.preferences.Property <em>Property</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Property</em>'. + * @see org.eclipse.emf.cdo.releng.preferences.Property * @generated */ - EAttribute getProperty_Name(); + EClass getProperty(); /** * Returns the meta object for the container reference '{@link org.eclipse.emf.cdo.releng.preferences.Property#getParent <em>Parent</em>}'. @@ -352,6 +708,26 @@ public interface PreferencesPackage extends EPackage EAttribute getProperty_Value(); /** + * Returns the meta object for the '{@link org.eclipse.emf.cdo.releng.preferences.Property#getInScope(java.lang.String) <em>Get In Scope</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Get In Scope</em>' operation. + * @see org.eclipse.emf.cdo.releng.preferences.Property#getInScope(java.lang.String) + * @generated + */ + EOperation getProperty__GetInScope__String(); + + /** + * Returns the meta object for the '{@link org.eclipse.emf.cdo.releng.preferences.Property#getInScope() <em>Get In Scope</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Get In Scope</em>' operation. + * @see org.eclipse.emf.cdo.releng.preferences.Property#getInScope() + * @generated + */ + EOperation getProperty__GetInScope(); + + /** * Returns the meta object for data type '{@link java.lang.String <em>Escaped String</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -387,6 +763,88 @@ public interface PreferencesPackage extends EPackage interface Literals { /** + * The meta object literal for the '{@link org.eclipse.emf.cdo.releng.preferences.impl.PreferenceItemImpl <em>Preference Item</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.releng.preferences.impl.PreferenceItemImpl + * @see org.eclipse.emf.cdo.releng.preferences.impl.PreferencesPackageImpl#getPreferenceItem() + * @generated + */ + EClass PREFERENCE_ITEM = eINSTANCE.getPreferenceItem(); + + /** + * The meta object literal for the '<em><b>Root</b></em>' reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference PREFERENCE_ITEM__ROOT = eINSTANCE.getPreferenceItem_Root(); + + /** + * The meta object literal for the '<em><b>Absolute Path</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute PREFERENCE_ITEM__ABSOLUTE_PATH = eINSTANCE.getPreferenceItem_AbsolutePath(); + + /** + * The meta object literal for the '<em><b>Scope Relative Path</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute PREFERENCE_ITEM__SCOPE_RELATIVE_PATH = eINSTANCE.getPreferenceItem_ScopeRelativePath(); + + /** + * The meta object literal for the '<em><b>Name</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute PREFERENCE_ITEM__NAME = eINSTANCE.getPreferenceItem_Name(); + + /** + * The meta object literal for the '<em><b>Scope</b></em>' reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference PREFERENCE_ITEM__SCOPE = eINSTANCE.getPreferenceItem_Scope(); + + /** + * The meta object literal for the '<em><b>Get Parent</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation PREFERENCE_ITEM___GET_PARENT = eINSTANCE.getPreferenceItem__GetParent(); + + /** + * The meta object literal for the '<em><b>Get Item</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation PREFERENCE_ITEM___GET_ITEM__STRING = eINSTANCE.getPreferenceItem__GetItem__String(); + + /** + * The meta object literal for the '<em><b>Get In Scope</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation PREFERENCE_ITEM___GET_IN_SCOPE__STRING = eINSTANCE.getPreferenceItem__GetInScope__String(); + + /** + * The meta object literal for the '<em><b>Get In Scope</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation PREFERENCE_ITEM___GET_IN_SCOPE = eINSTANCE.getPreferenceItem__GetInScope(); + + /** * The meta object literal for the '{@link org.eclipse.emf.cdo.releng.preferences.impl.PreferenceNodeImpl <em>Preference Node</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -421,14 +879,6 @@ public interface PreferencesPackage extends EPackage EReference PREFERENCE_NODE__PROPERTIES = eINSTANCE.getPreferenceNode_Properties(); /** - * The meta object literal for the '<em><b>Name</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - EAttribute PREFERENCE_NODE__NAME = eINSTANCE.getPreferenceNode_Name(); - - /** * The meta object literal for the '<em><b>Location</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -453,22 +903,30 @@ public interface PreferencesPackage extends EPackage EOperation PREFERENCE_NODE___GET_PROPERTY__STRING = eINSTANCE.getPreferenceNode__GetProperty__String(); /** - * The meta object literal for the '{@link org.eclipse.emf.cdo.releng.preferences.impl.PropertyImpl <em>Property</em>}' class. + * The meta object literal for the '<em><b>Get In Scope</b></em>' operation. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see org.eclipse.emf.cdo.releng.preferences.impl.PropertyImpl - * @see org.eclipse.emf.cdo.releng.preferences.impl.PreferencesPackageImpl#getProperty() * @generated */ - EClass PROPERTY = eINSTANCE.getProperty(); + EOperation PREFERENCE_NODE___GET_IN_SCOPE__STRING = eINSTANCE.getPreferenceNode__GetInScope__String(); /** - * The meta object literal for the '<em><b>Name</b></em>' attribute feature. + * The meta object literal for the '<em><b>Get In Scope</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation PREFERENCE_NODE___GET_IN_SCOPE = eINSTANCE.getPreferenceNode__GetInScope(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.cdo.releng.preferences.impl.PropertyImpl <em>Property</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.releng.preferences.impl.PropertyImpl + * @see org.eclipse.emf.cdo.releng.preferences.impl.PreferencesPackageImpl#getProperty() * @generated */ - EAttribute PROPERTY__NAME = eINSTANCE.getProperty_Name(); + EClass PROPERTY = eINSTANCE.getProperty(); /** * The meta object literal for the '<em><b>Parent</b></em>' container reference feature. @@ -487,6 +945,22 @@ public interface PreferencesPackage extends EPackage EAttribute PROPERTY__VALUE = eINSTANCE.getProperty_Value(); /** + * The meta object literal for the '<em><b>Get In Scope</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation PROPERTY___GET_IN_SCOPE__STRING = eINSTANCE.getProperty__GetInScope__String(); + + /** + * The meta object literal for the '<em><b>Get In Scope</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation PROPERTY___GET_IN_SCOPE = eINSTANCE.getProperty__GetInScope(); + + /** * The meta object literal for the '<em>Escaped String</em>' data type. * <!-- begin-user-doc --> * <!-- end-user-doc --> diff --git a/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/Property.java b/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/Property.java index 841a63c39f..3d88adc02d 100644 --- a/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/Property.java +++ b/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/Property.java @@ -10,8 +10,6 @@ */ package org.eclipse.emf.cdo.releng.preferences; -import org.eclipse.emf.ecore.EObject; - /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>Property</b></em>'. @@ -20,7 +18,6 @@ import org.eclipse.emf.ecore.EObject; * <p> * The following features are supported: * <ul> - * <li>{@link org.eclipse.emf.cdo.releng.preferences.Property#getName <em>Name</em>}</li> * <li>{@link org.eclipse.emf.cdo.releng.preferences.Property#getParent <em>Parent</em>}</li> * <li>{@link org.eclipse.emf.cdo.releng.preferences.Property#getValue <em>Value</em>}</li> * </ul> @@ -30,35 +27,9 @@ import org.eclipse.emf.ecore.EObject; * @model * @generated */ -public interface Property extends EObject +public interface Property extends PreferenceItem { /** - * Returns the value of the '<em><b>Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Name</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Name</em>' attribute. - * @see #setName(String) - * @see org.eclipse.emf.cdo.releng.preferences.PreferencesPackage#getProperty_Name() - * @model required="true" - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.eclipse.emf.cdo.releng.preferences.Property#getName <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Name</em>' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - - /** * Returns the value of the '<em><b>Parent</b></em>' container reference. * It is bidirectional and its opposite is '{@link org.eclipse.emf.cdo.releng.preferences.PreferenceNode#getProperties <em>Properties</em>}'. * <!-- begin-user-doc --> @@ -112,4 +83,20 @@ public interface Property extends EObject */ void setValue(String value); + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model + * @generated + */ + Property getInScope(String scopeName); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model kind="operation" + * @generated + */ + Property getInScope(); + } // Property diff --git a/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/impl/PreferenceItemImpl.java b/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/impl/PreferenceItemImpl.java new file mode 100644 index 0000000000..266d11e39f --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/impl/PreferenceItemImpl.java @@ -0,0 +1,450 @@ +/** + */ +package org.eclipse.emf.cdo.releng.preferences.impl; + +import org.eclipse.emf.cdo.releng.preferences.PreferenceItem; +import org.eclipse.emf.cdo.releng.preferences.PreferenceNode; +import org.eclipse.emf.cdo.releng.preferences.PreferencesPackage; +import org.eclipse.emf.cdo.releng.preferences.Property; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; + +import java.lang.reflect.InvocationTargetException; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Preference Item</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link org.eclipse.emf.cdo.releng.preferences.impl.PreferenceItemImpl#getRoot <em>Root</em>}</li> + * <li>{@link org.eclipse.emf.cdo.releng.preferences.impl.PreferenceItemImpl#getScope <em>Scope</em>}</li> + * <li>{@link org.eclipse.emf.cdo.releng.preferences.impl.PreferenceItemImpl#getAbsolutePath <em>Absolute Path</em>}</li> + * <li>{@link org.eclipse.emf.cdo.releng.preferences.impl.PreferenceItemImpl#getScopeRelativePath <em>Scope Relative Path</em>}</li> + * <li>{@link org.eclipse.emf.cdo.releng.preferences.impl.PreferenceItemImpl#getName <em>Name</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public abstract class PreferenceItemImpl extends MinimalEObjectImpl.Container implements PreferenceItem +{ + /** + * The default value of the '{@link #getAbsolutePath() <em>Absolute Path</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getAbsolutePath() + * @generated + * @ordered + */ + protected static final String ABSOLUTE_PATH_EDEFAULT = null; + + /** + * The default value of the '{@link #getScopeRelativePath() <em>Scope Relative Path</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getScopeRelativePath() + * @generated + * @ordered + */ + protected static final String SCOPE_RELATIVE_PATH_EDEFAULT = null; + + /** + * 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; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected PreferenceItemImpl() + { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() + { + return PreferencesPackage.Literals.PREFERENCE_ITEM; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public PreferenceNode getRoot() + { + PreferenceNode parent = getParent(); + if (parent == null) + { + if (this instanceof PreferenceNode) + { + return (PreferenceNode)this; + } + + return null; + } + + return parent.getRoot(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public String getAbsolutePath() + { + PreferenceNode parent = getParent(); + if (parent == null) + { + return getName(); + } + + return parent.getAbsolutePath() + "/" + getName(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public String getScopeRelativePath() + { + IPath path = new Path(getAbsolutePath()).removeFirstSegments(1).makeRelative(); + return path.toString(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getName() + { + return name; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setName(String newName) + { + String oldName = name; + name = newName; + if (eNotificationRequired()) + { + eNotify(new ENotificationImpl(this, Notification.SET, PreferencesPackage.PREFERENCE_ITEM__NAME, oldName, name)); + } + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public PreferenceNode getScope() + { + PreferenceNode parent = getParent(); + if (parent != null) + { + PreferenceNode parent2 = parent.getParent(); + if (parent2 == null) + { + return parent; + } + + return parent.getScope(); + } + + return null; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public abstract PreferenceNode getParent(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public PreferenceItem getItem(String path) + { + String name; + int pos = path.indexOf('/'); + if (pos == -1) + { + name = path; + path = null; + } + else + { + name = path.substring(0, pos); + path = path.substring(pos + 1); + } + + if (this instanceof PreferenceNode) + { + PreferenceNode preferenceNode = (PreferenceNode)this; + + // TODO Check whether for the same name a node AND a property exists + for (PreferenceNode node : preferenceNode.getChildren()) + { + if (name.equals(node.getName())) + { + if (path == null) + { + return node; + } + + return node.getNode(path); + } + } + + for (Property property : preferenceNode.getProperties()) + { + if (name.equals(property.getName())) + { + if (path == null) + { + return property; + } + } + } + } + + return null; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public PreferenceItem getInScope(String scopeName) + { + PreferenceNode root = getRoot(); + if (root != null) + { + PreferenceNode scope = root.getNode(scopeName); + if (scope != null) + { + return scope.getItem(getScopeRelativePath()); + } + } + + return null; + } + + private static final String[] SCOPE_NAMES = { "project", "instance", "default", "configuration", "bundle_defaults" }; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public PreferenceItem getInScope() + { + PreferenceNode scope = getScope(); + if (scope != null) + { + PreferenceNode root = scope.getRoot(); + String ownScopeName = scope.getName(); + String scopeRelativePath = getScopeRelativePath(); + if (SCOPE_NAMES[0].equals(ownScopeName)) + { + scopeRelativePath = new Path(scopeRelativePath).removeFirstSegments(1).toString(); + } + + for (int i = 0; i < SCOPE_NAMES.length; i++) + { + String scopeName = SCOPE_NAMES[i]; + if (ownScopeName != null) + { + if (scopeName.equals(ownScopeName)) + { + ownScopeName = null; + } + } + else + { + PreferenceNode defaultScope = root.getNode(scopeName); + if (defaultScope != null) + { + PreferenceItem item = defaultScope.getItem(scopeRelativePath); + if (item != null) + { + return item; + } + } + } + } + } + + return null; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) + { + switch (featureID) + { + case PreferencesPackage.PREFERENCE_ITEM__ROOT: + return getRoot(); + case PreferencesPackage.PREFERENCE_ITEM__SCOPE: + return getScope(); + case PreferencesPackage.PREFERENCE_ITEM__ABSOLUTE_PATH: + return getAbsolutePath(); + case PreferencesPackage.PREFERENCE_ITEM__SCOPE_RELATIVE_PATH: + return getScopeRelativePath(); + case PreferencesPackage.PREFERENCE_ITEM__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) + { + switch (featureID) + { + case PreferencesPackage.PREFERENCE_ITEM__NAME: + setName((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) + { + switch (featureID) + { + case PreferencesPackage.PREFERENCE_ITEM__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) + { + switch (featureID) + { + case PreferencesPackage.PREFERENCE_ITEM__ROOT: + return getRoot() != null; + case PreferencesPackage.PREFERENCE_ITEM__SCOPE: + return getScope() != null; + case PreferencesPackage.PREFERENCE_ITEM__ABSOLUTE_PATH: + return ABSOLUTE_PATH_EDEFAULT == null ? getAbsolutePath() != null : !ABSOLUTE_PATH_EDEFAULT + .equals(getAbsolutePath()); + case PreferencesPackage.PREFERENCE_ITEM__SCOPE_RELATIVE_PATH: + return SCOPE_RELATIVE_PATH_EDEFAULT == null ? getScopeRelativePath() != null : !SCOPE_RELATIVE_PATH_EDEFAULT + .equals(getScopeRelativePath()); + case PreferencesPackage.PREFERENCE_ITEM__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException + { + switch (operationID) + { + case PreferencesPackage.PREFERENCE_ITEM___GET_PARENT: + return getParent(); + case PreferencesPackage.PREFERENCE_ITEM___GET_ITEM__STRING: + return getItem((String)arguments.get(0)); + case PreferencesPackage.PREFERENCE_ITEM___GET_IN_SCOPE__STRING: + return getInScope((String)arguments.get(0)); + case PreferencesPackage.PREFERENCE_ITEM___GET_IN_SCOPE: + return getInScope(); + } + return super.eInvoke(operationID, arguments); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String toString() + { + if (eIsProxy()) + { + return super.toString(); + } + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} // PreferenceItemImpl diff --git a/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/impl/PreferenceNodeImpl.java b/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/impl/PreferenceNodeImpl.java index 676f11b81f..07af99ae1c 100644 --- a/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/impl/PreferenceNodeImpl.java +++ b/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/impl/PreferenceNodeImpl.java @@ -24,7 +24,6 @@ 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.EObjectContainmentWithInverseEList; import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.emf.ecore.util.InternalEList; @@ -44,17 +43,16 @@ import java.util.Collection; * <p> * The following features are implemented: * <ul> - * <li>{@link org.eclipse.emf.cdo.releng.preferences.impl.PreferenceNodeImpl#getChildren <em>Children</em>}</li> * <li>{@link org.eclipse.emf.cdo.releng.preferences.impl.PreferenceNodeImpl#getParent <em>Parent</em>}</li> + * <li>{@link org.eclipse.emf.cdo.releng.preferences.impl.PreferenceNodeImpl#getChildren <em>Children</em>}</li> * <li>{@link org.eclipse.emf.cdo.releng.preferences.impl.PreferenceNodeImpl#getProperties <em>Properties</em>}</li> - * <li>{@link org.eclipse.emf.cdo.releng.preferences.impl.PreferenceNodeImpl#getName <em>Name</em>}</li> * <li>{@link org.eclipse.emf.cdo.releng.preferences.impl.PreferenceNodeImpl#getLocation <em>Location</em>}</li> * </ul> * </p> * * @generated */ -public class PreferenceNodeImpl extends MinimalEObjectImpl.Container implements PreferenceNode +public class PreferenceNodeImpl extends PreferenceItemImpl implements PreferenceNode { /** * The cached value of the '{@link #getChildren() <em>Children</em>}' containment reference list. @@ -77,26 +75,6 @@ public class PreferenceNodeImpl extends MinimalEObjectImpl.Container implements protected EList<Property> properties; /** - * 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 default value of the '{@link #getLocation() <em>Location</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -147,6 +125,7 @@ public class PreferenceNodeImpl extends MinimalEObjectImpl.Container implements * <!-- end-user-doc --> * @generated */ + @Override public PreferenceNode getParent() { if (eContainerFeatureID() != PreferencesPackage.PREFERENCE_NODE__PARENT) @@ -222,32 +201,7 @@ public class PreferenceNodeImpl extends MinimalEObjectImpl.Container implements /** * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @generated - */ - public String getName() - { - return name; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - { - eNotify(new ENotificationImpl(this, Notification.SET, PreferencesPackage.PREFERENCE_NODE__NAME, oldName, name)); - } - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated + * @generated NOT */ public String getLocation() { @@ -278,6 +232,7 @@ public class PreferenceNodeImpl extends MinimalEObjectImpl.Container implements return node; } } + return null; } @@ -295,12 +250,35 @@ public class PreferenceNodeImpl extends MinimalEObjectImpl.Container implements return property; } } + return null; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * @generated NOT + */ + @Override + public PreferenceNode getInScope(String scopeName) + { + return (PreferenceNode)super.getInScope(scopeName); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + @Override + public PreferenceNode getInScope() + { + return (PreferenceNode)super.getInScope(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> * @generated */ @SuppressWarnings("unchecked") @@ -309,14 +287,14 @@ public class PreferenceNodeImpl extends MinimalEObjectImpl.Container implements { switch (featureID) { - case PreferencesPackage.PREFERENCE_NODE__CHILDREN: - return ((InternalEList<InternalEObject>)(InternalEList<?>)getChildren()).basicAdd(otherEnd, msgs); case PreferencesPackage.PREFERENCE_NODE__PARENT: if (eInternalContainer() != null) { msgs = eBasicRemoveFromContainer(msgs); } return basicSetParent((PreferenceNode)otherEnd, msgs); + case PreferencesPackage.PREFERENCE_NODE__CHILDREN: + return ((InternalEList<InternalEObject>)(InternalEList<?>)getChildren()).basicAdd(otherEnd, msgs); case PreferencesPackage.PREFERENCE_NODE__PROPERTIES: return ((InternalEList<InternalEObject>)(InternalEList<?>)getProperties()).basicAdd(otherEnd, msgs); } @@ -333,10 +311,10 @@ public class PreferenceNodeImpl extends MinimalEObjectImpl.Container implements { switch (featureID) { - case PreferencesPackage.PREFERENCE_NODE__CHILDREN: - return ((InternalEList<?>)getChildren()).basicRemove(otherEnd, msgs); case PreferencesPackage.PREFERENCE_NODE__PARENT: return basicSetParent(null, msgs); + case PreferencesPackage.PREFERENCE_NODE__CHILDREN: + return ((InternalEList<?>)getChildren()).basicRemove(otherEnd, msgs); case PreferencesPackage.PREFERENCE_NODE__PROPERTIES: return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs); } @@ -370,14 +348,12 @@ public class PreferenceNodeImpl extends MinimalEObjectImpl.Container implements { switch (featureID) { - case PreferencesPackage.PREFERENCE_NODE__CHILDREN: - return getChildren(); case PreferencesPackage.PREFERENCE_NODE__PARENT: return getParent(); + case PreferencesPackage.PREFERENCE_NODE__CHILDREN: + return getChildren(); case PreferencesPackage.PREFERENCE_NODE__PROPERTIES: return getProperties(); - case PreferencesPackage.PREFERENCE_NODE__NAME: - return getName(); case PreferencesPackage.PREFERENCE_NODE__LOCATION: return getLocation(); } @@ -395,20 +371,17 @@ public class PreferenceNodeImpl extends MinimalEObjectImpl.Container implements { switch (featureID) { + case PreferencesPackage.PREFERENCE_NODE__PARENT: + setParent((PreferenceNode)newValue); + return; case PreferencesPackage.PREFERENCE_NODE__CHILDREN: getChildren().clear(); getChildren().addAll((Collection<? extends PreferenceNode>)newValue); return; - case PreferencesPackage.PREFERENCE_NODE__PARENT: - setParent((PreferenceNode)newValue); - return; case PreferencesPackage.PREFERENCE_NODE__PROPERTIES: getProperties().clear(); getProperties().addAll((Collection<? extends Property>)newValue); return; - case PreferencesPackage.PREFERENCE_NODE__NAME: - setName((String)newValue); - return; } super.eSet(featureID, newValue); } @@ -423,18 +396,15 @@ public class PreferenceNodeImpl extends MinimalEObjectImpl.Container implements { switch (featureID) { - case PreferencesPackage.PREFERENCE_NODE__CHILDREN: - getChildren().clear(); - return; case PreferencesPackage.PREFERENCE_NODE__PARENT: setParent((PreferenceNode)null); return; + case PreferencesPackage.PREFERENCE_NODE__CHILDREN: + getChildren().clear(); + return; case PreferencesPackage.PREFERENCE_NODE__PROPERTIES: getProperties().clear(); return; - case PreferencesPackage.PREFERENCE_NODE__NAME: - setName(NAME_EDEFAULT); - return; } super.eUnset(featureID); } @@ -449,14 +419,12 @@ public class PreferenceNodeImpl extends MinimalEObjectImpl.Container implements { switch (featureID) { - case PreferencesPackage.PREFERENCE_NODE__CHILDREN: - return children != null && !children.isEmpty(); case PreferencesPackage.PREFERENCE_NODE__PARENT: return getParent() != null; + case PreferencesPackage.PREFERENCE_NODE__CHILDREN: + return children != null && !children.isEmpty(); case PreferencesPackage.PREFERENCE_NODE__PROPERTIES: return properties != null && !properties.isEmpty(); - case PreferencesPackage.PREFERENCE_NODE__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); case PreferencesPackage.PREFERENCE_NODE__LOCATION: return LOCATION_EDEFAULT == null ? getLocation() != null : !LOCATION_EDEFAULT.equals(getLocation()); } @@ -477,6 +445,10 @@ public class PreferenceNodeImpl extends MinimalEObjectImpl.Container implements return getNode((String)arguments.get(0)); case PreferencesPackage.PREFERENCE_NODE___GET_PROPERTY__STRING: return getProperty((String)arguments.get(0)); + case PreferencesPackage.PREFERENCE_NODE___GET_IN_SCOPE__STRING: + return getInScope((String)arguments.get(0)); + case PreferencesPackage.PREFERENCE_NODE___GET_IN_SCOPE: + return getInScope(); } return super.eInvoke(operationID, arguments); } @@ -528,24 +500,4 @@ public class PreferenceNodeImpl extends MinimalEObjectImpl.Container implements return super.eObjectForURIFragmentSegment(uriFragmentSegment); } - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) - { - return super.toString(); - } - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (name: "); - result.append(name); - result.append(')'); - return result.toString(); - } - } // PreferenceNodeImpl diff --git a/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/impl/PreferencesPackageImpl.java b/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/impl/PreferencesPackageImpl.java index 1def78d942..b46d1119ec 100644 --- a/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/impl/PreferencesPackageImpl.java +++ b/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/impl/PreferencesPackageImpl.java @@ -10,6 +10,7 @@ */ package org.eclipse.emf.cdo.releng.preferences.impl; +import org.eclipse.emf.cdo.releng.preferences.PreferenceItem; import org.eclipse.emf.cdo.releng.preferences.PreferenceNode; import org.eclipse.emf.cdo.releng.preferences.PreferencesFactory; import org.eclipse.emf.cdo.releng.preferences.PreferencesPackage; @@ -36,6 +37,13 @@ public class PreferencesPackageImpl extends EPackageImpl implements PreferencesP * <!-- end-user-doc --> * @generated */ + private EClass preferenceItemEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ private EClass preferenceNodeEClass = null; /** @@ -94,7 +102,9 @@ public class PreferencesPackageImpl extends EPackageImpl implements PreferencesP public static PreferencesPackage init() { if (isInited) + { return (PreferencesPackage)EPackage.Registry.INSTANCE.getEPackage(PreferencesPackage.eNS_URI); + } // Obtain or create and register package PreferencesPackageImpl thePreferencesPackage = (PreferencesPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof PreferencesPackageImpl ? EPackage.Registry.INSTANCE @@ -121,6 +131,106 @@ public class PreferencesPackageImpl extends EPackageImpl implements PreferencesP * <!-- end-user-doc --> * @generated */ + public EClass getPreferenceItem() + { + return preferenceItemEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getPreferenceItem_Root() + { + return (EReference)preferenceItemEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getPreferenceItem_AbsolutePath() + { + return (EAttribute)preferenceItemEClass.getEStructuralFeatures().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getPreferenceItem_ScopeRelativePath() + { + return (EAttribute)preferenceItemEClass.getEStructuralFeatures().get(3); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getPreferenceItem_Name() + { + return (EAttribute)preferenceItemEClass.getEStructuralFeatures().get(4); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getPreferenceItem_Scope() + { + return (EReference)preferenceItemEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EOperation getPreferenceItem__GetParent() + { + return preferenceItemEClass.getEOperations().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EOperation getPreferenceItem__GetItem__String() + { + return preferenceItemEClass.getEOperations().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EOperation getPreferenceItem__GetInScope__String() + { + return preferenceItemEClass.getEOperations().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EOperation getPreferenceItem__GetInScope() + { + return preferenceItemEClass.getEOperations().get(3); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ public EClass getPreferenceNode() { return preferenceNodeEClass; @@ -133,7 +243,7 @@ public class PreferencesPackageImpl extends EPackageImpl implements PreferencesP */ public EReference getPreferenceNode_Children() { - return (EReference)preferenceNodeEClass.getEStructuralFeatures().get(0); + return (EReference)preferenceNodeEClass.getEStructuralFeatures().get(1); } /** @@ -143,7 +253,7 @@ public class PreferencesPackageImpl extends EPackageImpl implements PreferencesP */ public EReference getPreferenceNode_Parent() { - return (EReference)preferenceNodeEClass.getEStructuralFeatures().get(1); + return (EReference)preferenceNodeEClass.getEStructuralFeatures().get(0); } /** @@ -161,7 +271,7 @@ public class PreferencesPackageImpl extends EPackageImpl implements PreferencesP * <!-- end-user-doc --> * @generated */ - public EAttribute getPreferenceNode_Name() + public EAttribute getPreferenceNode_Location() { return (EAttribute)preferenceNodeEClass.getEStructuralFeatures().get(3); } @@ -171,9 +281,9 @@ public class PreferencesPackageImpl extends EPackageImpl implements PreferencesP * <!-- end-user-doc --> * @generated */ - public EAttribute getPreferenceNode_Location() + public EOperation getPreferenceNode__GetNode__String() { - return (EAttribute)preferenceNodeEClass.getEStructuralFeatures().get(4); + return preferenceNodeEClass.getEOperations().get(0); } /** @@ -181,9 +291,9 @@ public class PreferencesPackageImpl extends EPackageImpl implements PreferencesP * <!-- end-user-doc --> * @generated */ - public EOperation getPreferenceNode__GetNode__String() + public EOperation getPreferenceNode__GetProperty__String() { - return preferenceNodeEClass.getEOperations().get(0); + return preferenceNodeEClass.getEOperations().get(1); } /** @@ -191,9 +301,9 @@ public class PreferencesPackageImpl extends EPackageImpl implements PreferencesP * <!-- end-user-doc --> * @generated */ - public EOperation getPreferenceNode__GetProperty__String() + public EOperation getPreferenceNode__GetInScope__String() { - return preferenceNodeEClass.getEOperations().get(1); + return preferenceNodeEClass.getEOperations().get(2); } /** @@ -201,9 +311,9 @@ public class PreferencesPackageImpl extends EPackageImpl implements PreferencesP * <!-- end-user-doc --> * @generated */ - public EClass getProperty() + public EOperation getPreferenceNode__GetInScope() { - return propertyEClass; + return preferenceNodeEClass.getEOperations().get(3); } /** @@ -211,9 +321,9 @@ public class PreferencesPackageImpl extends EPackageImpl implements PreferencesP * <!-- end-user-doc --> * @generated */ - public EAttribute getProperty_Name() + public EClass getProperty() { - return (EAttribute)propertyEClass.getEStructuralFeatures().get(0); + return propertyEClass; } /** @@ -223,7 +333,7 @@ public class PreferencesPackageImpl extends EPackageImpl implements PreferencesP */ public EReference getProperty_Parent() { - return (EReference)propertyEClass.getEStructuralFeatures().get(1); + return (EReference)propertyEClass.getEStructuralFeatures().get(0); } /** @@ -233,7 +343,27 @@ public class PreferencesPackageImpl extends EPackageImpl implements PreferencesP */ public EAttribute getProperty_Value() { - return (EAttribute)propertyEClass.getEStructuralFeatures().get(2); + return (EAttribute)propertyEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EOperation getProperty__GetInScope__String() + { + return propertyEClass.getEOperations().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EOperation getProperty__GetInScope() + { + return propertyEClass.getEOperations().get(1); } /** @@ -273,23 +403,38 @@ public class PreferencesPackageImpl extends EPackageImpl implements PreferencesP public void createPackageContents() { if (isCreated) + { return; + } isCreated = true; // Create classes and their features + preferenceItemEClass = createEClass(PREFERENCE_ITEM); + createEReference(preferenceItemEClass, PREFERENCE_ITEM__ROOT); + createEReference(preferenceItemEClass, PREFERENCE_ITEM__SCOPE); + createEAttribute(preferenceItemEClass, PREFERENCE_ITEM__ABSOLUTE_PATH); + createEAttribute(preferenceItemEClass, PREFERENCE_ITEM__SCOPE_RELATIVE_PATH); + createEAttribute(preferenceItemEClass, PREFERENCE_ITEM__NAME); + createEOperation(preferenceItemEClass, PREFERENCE_ITEM___GET_PARENT); + createEOperation(preferenceItemEClass, PREFERENCE_ITEM___GET_ITEM__STRING); + createEOperation(preferenceItemEClass, PREFERENCE_ITEM___GET_IN_SCOPE__STRING); + createEOperation(preferenceItemEClass, PREFERENCE_ITEM___GET_IN_SCOPE); + preferenceNodeEClass = createEClass(PREFERENCE_NODE); - createEReference(preferenceNodeEClass, PREFERENCE_NODE__CHILDREN); createEReference(preferenceNodeEClass, PREFERENCE_NODE__PARENT); + createEReference(preferenceNodeEClass, PREFERENCE_NODE__CHILDREN); createEReference(preferenceNodeEClass, PREFERENCE_NODE__PROPERTIES); - createEAttribute(preferenceNodeEClass, PREFERENCE_NODE__NAME); createEAttribute(preferenceNodeEClass, PREFERENCE_NODE__LOCATION); createEOperation(preferenceNodeEClass, PREFERENCE_NODE___GET_NODE__STRING); createEOperation(preferenceNodeEClass, PREFERENCE_NODE___GET_PROPERTY__STRING); + createEOperation(preferenceNodeEClass, PREFERENCE_NODE___GET_IN_SCOPE__STRING); + createEOperation(preferenceNodeEClass, PREFERENCE_NODE___GET_IN_SCOPE); propertyEClass = createEClass(PROPERTY); - createEAttribute(propertyEClass, PROPERTY__NAME); createEReference(propertyEClass, PROPERTY__PARENT); createEAttribute(propertyEClass, PROPERTY__VALUE); + createEOperation(propertyEClass, PROPERTY___GET_IN_SCOPE__STRING); + createEOperation(propertyEClass, PROPERTY___GET_IN_SCOPE); // Create data types escapedStringEDataType = createEDataType(ESCAPED_STRING); @@ -312,7 +457,9 @@ public class PreferencesPackageImpl extends EPackageImpl implements PreferencesP public void initializePackageContents() { if (isInitialized) + { return; + } isInitialized = true; // Initialize package @@ -325,44 +472,81 @@ public class PreferencesPackageImpl extends EPackageImpl implements PreferencesP // Set bounds for type parameters // Add supertypes to classes + preferenceNodeEClass.getESuperTypes().add(getPreferenceItem()); + propertyEClass.getESuperTypes().add(getPreferenceItem()); // Initialize classes, features, and operations; add parameters + initEClass(preferenceItemEClass, PreferenceItem.class, "PreferenceItem", IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getPreferenceItem_Root(), getPreferenceNode(), null, "root", null, 0, 1, PreferenceItem.class, + IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEReference(getPreferenceItem_Scope(), getPreferenceNode(), null, "scope", null, 0, 1, PreferenceItem.class, + IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + IS_DERIVED, IS_ORDERED); + initEAttribute(getPreferenceItem_AbsolutePath(), ecorePackage.getEString(), "absolutePath", null, 1, 1, + PreferenceItem.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, + IS_ORDERED); + initEAttribute(getPreferenceItem_ScopeRelativePath(), ecorePackage.getEString(), "scopeRelativePath", null, 1, 1, + PreferenceItem.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, + IS_ORDERED); + initEAttribute(getPreferenceItem_Name(), ecorePackage.getEString(), "name", null, 1, 1, PreferenceItem.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEOperation(getPreferenceItem__GetParent(), getPreferenceNode(), "getParent", 0, 1, IS_UNIQUE, IS_ORDERED); + + EOperation op = initEOperation(getPreferenceItem__GetItem__String(), getPreferenceItem(), "getItem", 0, 1, + IS_UNIQUE, IS_ORDERED); + addEParameter(op, ecorePackage.getEString(), "path", 0, 1, IS_UNIQUE, IS_ORDERED); + + op = initEOperation(getPreferenceItem__GetInScope__String(), getPreferenceItem(), "getInScope", 0, 1, IS_UNIQUE, + IS_ORDERED); + addEParameter(op, ecorePackage.getEString(), "scopeName", 0, 1, IS_UNIQUE, IS_ORDERED); + + initEOperation(getPreferenceItem__GetInScope(), getPreferenceItem(), "getInScope", 0, 1, IS_UNIQUE, IS_ORDERED); + initEClass(preferenceNodeEClass, PreferenceNode.class, "PreferenceNode", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getPreferenceNode_Children(), this.getPreferenceNode(), this.getPreferenceNode_Parent(), "children", - null, 0, -1, PreferenceNode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, - !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - getPreferenceNode_Children().getEKeys().add(this.getPreferenceNode_Name()); - initEReference(getPreferenceNode_Parent(), this.getPreferenceNode(), this.getPreferenceNode_Children(), "parent", - null, 0, 1, PreferenceNode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, - !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getPreferenceNode_Properties(), this.getProperty(), this.getProperty_Parent(), "properties", null, - 0, -1, PreferenceNode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + initEReference(getPreferenceNode_Parent(), getPreferenceNode(), getPreferenceNode_Children(), "parent", null, 0, 1, + PreferenceNode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - getPreferenceNode_Properties().getEKeys().add(this.getProperty_Name()); - initEAttribute(getPreferenceNode_Name(), ecorePackage.getEString(), "name", null, 1, 1, PreferenceNode.class, - !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getPreferenceNode_Children(), getPreferenceNode(), getPreferenceNode_Parent(), "children", null, 0, + -1, PreferenceNode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getPreferenceNode_Properties(), getProperty(), getProperty_Parent(), "properties", null, 0, -1, + PreferenceNode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + getPreferenceNode_Properties().getEKeys().add(getPreferenceItem_Name()); initEAttribute(getPreferenceNode_Location(), ecorePackage.getEString(), "location", null, 0, 1, PreferenceNode.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - EOperation op = initEOperation(getPreferenceNode__GetNode__String(), this.getPreferenceNode(), "getNode", 0, 1, - IS_UNIQUE, IS_ORDERED); + op = initEOperation(getPreferenceNode__GetNode__String(), getPreferenceNode(), "getNode", 0, 1, IS_UNIQUE, + IS_ORDERED); addEParameter(op, ecorePackage.getEString(), "name", 0, 1, IS_UNIQUE, IS_ORDERED); - op = initEOperation(getPreferenceNode__GetProperty__String(), this.getProperty(), "getProperty", 0, 1, IS_UNIQUE, + op = initEOperation(getPreferenceNode__GetProperty__String(), getProperty(), "getProperty", 0, 1, IS_UNIQUE, IS_ORDERED); addEParameter(op, ecorePackage.getEString(), "name", 0, 1, IS_UNIQUE, IS_ORDERED); + op = initEOperation(getPreferenceNode__GetInScope__String(), getPreferenceNode(), "getInScope", 0, 1, IS_UNIQUE, + IS_ORDERED); + addEParameter(op, ecorePackage.getEString(), "scopeName", 0, 1, IS_UNIQUE, IS_ORDERED); + + initEOperation(getPreferenceNode__GetInScope(), getPreferenceNode(), "getInScope", 0, 1, IS_UNIQUE, IS_ORDERED); + initEClass(propertyEClass, Property.class, "Property", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getProperty_Name(), ecorePackage.getEString(), "name", null, 1, 1, Property.class, !IS_TRANSIENT, - !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getProperty_Parent(), this.getPreferenceNode(), this.getPreferenceNode_Properties(), "parent", null, - 0, 1, Property.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, - !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getProperty_Value(), this.getEscapedString(), "value", null, 0, 1, Property.class, !IS_TRANSIENT, + initEReference(getProperty_Parent(), getPreferenceNode(), getPreferenceNode_Properties(), "parent", null, 0, 1, + Property.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getProperty_Value(), getEscapedString(), "value", null, 0, 1, Property.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + op = initEOperation(getProperty__GetInScope__String(), getProperty(), "getInScope", 0, 1, IS_UNIQUE, IS_ORDERED); + addEParameter(op, ecorePackage.getEString(), "scopeName", 0, 1, IS_UNIQUE, IS_ORDERED); + + initEOperation(getProperty__GetInScope(), getProperty(), "getInScope", 0, 1, IS_UNIQUE, IS_ORDERED); + // Initialize data types initEDataType(escapedStringEDataType, String.class, "EscapedString", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); diff --git a/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/impl/PropertyImpl.java b/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/impl/PropertyImpl.java index 896a5977a3..d956614549 100644 --- a/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/impl/PropertyImpl.java +++ b/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/impl/PropertyImpl.java @@ -16,12 +16,14 @@ import org.eclipse.emf.cdo.releng.preferences.Property; 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.impl.MinimalEObjectImpl; import org.eclipse.emf.ecore.util.EcoreUtil; +import java.lang.reflect.InvocationTargetException; + /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Property</b></em>'. @@ -29,7 +31,6 @@ import org.eclipse.emf.ecore.util.EcoreUtil; * <p> * The following features are implemented: * <ul> - * <li>{@link org.eclipse.emf.cdo.releng.preferences.impl.PropertyImpl#getName <em>Name</em>}</li> * <li>{@link org.eclipse.emf.cdo.releng.preferences.impl.PropertyImpl#getParent <em>Parent</em>}</li> * <li>{@link org.eclipse.emf.cdo.releng.preferences.impl.PropertyImpl#getValue <em>Value</em>}</li> * </ul> @@ -37,29 +38,9 @@ import org.eclipse.emf.ecore.util.EcoreUtil; * * @generated */ -public class PropertyImpl extends MinimalEObjectImpl.Container implements Property +public class PropertyImpl extends PreferenceItemImpl implements Property { /** - * 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 default value of the '{@link #getValue() <em>Value</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -105,33 +86,13 @@ public class PropertyImpl extends MinimalEObjectImpl.Container implements Proper * <!-- end-user-doc --> * @generated */ - public String getName() - { - return name; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, PreferencesPackage.PROPERTY__NAME, oldName, name)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ + @Override public PreferenceNode getParent() { if (eContainerFeatureID() != PreferencesPackage.PROPERTY__PARENT) + { return null; + } return (PreferenceNode)eInternalContainer(); } @@ -153,23 +114,33 @@ public class PropertyImpl extends MinimalEObjectImpl.Container implements Proper */ public void setParent(PreferenceNode newParent) { - if (newParent != eInternalContainer() - || (eContainerFeatureID() != PreferencesPackage.PROPERTY__PARENT && newParent != null)) + if (newParent != eInternalContainer() || eContainerFeatureID() != PreferencesPackage.PROPERTY__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, PreferencesPackage.PREFERENCE_NODE__PROPERTIES, PreferenceNode.class, msgs); + } msgs = basicSetParent(newParent, msgs); if (msgs != null) + { msgs.dispatch(); + } } else if (eNotificationRequired()) + { eNotify(new ENotificationImpl(this, Notification.SET, PreferencesPackage.PROPERTY__PARENT, newParent, newParent)); + } } /** @@ -192,7 +163,31 @@ public class PropertyImpl extends MinimalEObjectImpl.Container implements Proper String oldValue = value; value = newValue; if (eNotificationRequired()) + { eNotify(new ENotificationImpl(this, Notification.SET, PreferencesPackage.PROPERTY__VALUE, oldValue, value)); + } + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + @Override + public Property getInScope(String scopeName) + { + return (Property)super.getInScope(scopeName); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + @Override + public Property getInScope() + { + return (Property)super.getInScope(); } /** @@ -207,7 +202,9 @@ public class PropertyImpl extends MinimalEObjectImpl.Container implements Proper { case PreferencesPackage.PROPERTY__PARENT: if (eInternalContainer() != null) + { msgs = eBasicRemoveFromContainer(msgs); + } return basicSetParent((PreferenceNode)otherEnd, msgs); } return super.eInverseAdd(otherEnd, featureID, msgs); @@ -256,8 +253,6 @@ public class PropertyImpl extends MinimalEObjectImpl.Container implements Proper { switch (featureID) { - case PreferencesPackage.PROPERTY__NAME: - return getName(); case PreferencesPackage.PROPERTY__PARENT: return getParent(); case PreferencesPackage.PROPERTY__VALUE: @@ -276,9 +271,6 @@ public class PropertyImpl extends MinimalEObjectImpl.Container implements Proper { switch (featureID) { - case PreferencesPackage.PROPERTY__NAME: - setName((String)newValue); - return; case PreferencesPackage.PROPERTY__PARENT: setParent((PreferenceNode)newValue); return; @@ -299,9 +291,6 @@ public class PropertyImpl extends MinimalEObjectImpl.Container implements Proper { switch (featureID) { - case PreferencesPackage.PROPERTY__NAME: - setName(NAME_EDEFAULT); - return; case PreferencesPackage.PROPERTY__PARENT: setParent((PreferenceNode)null); return; @@ -322,8 +311,6 @@ public class PropertyImpl extends MinimalEObjectImpl.Container implements Proper { switch (featureID) { - case PreferencesPackage.PROPERTY__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); case PreferencesPackage.PROPERTY__PARENT: return getParent() != null; case PreferencesPackage.PROPERTY__VALUE: @@ -338,15 +325,33 @@ public class PropertyImpl extends MinimalEObjectImpl.Container implements Proper * @generated */ @Override + public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException + { + switch (operationID) + { + case PreferencesPackage.PROPERTY___GET_IN_SCOPE__STRING: + return getInScope((String)arguments.get(0)); + case PreferencesPackage.PROPERTY___GET_IN_SCOPE: + return getInScope(); + } + return super.eInvoke(operationID, arguments); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override public String toString() { if (eIsProxy()) + { return super.toString(); + } StringBuffer result = new StringBuffer(super.toString()); - result.append(" (name: "); - result.append(name); - result.append(", value: "); + result.append(" (value: "); result.append(value); result.append(')'); return result.toString(); diff --git a/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/util/PreferencesAdapterFactory.java b/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/util/PreferencesAdapterFactory.java index c8280c760a..2d2e13d46f 100644 --- a/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/util/PreferencesAdapterFactory.java +++ b/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/util/PreferencesAdapterFactory.java @@ -10,6 +10,7 @@ */ package org.eclipse.emf.cdo.releng.preferences.util; +import org.eclipse.emf.cdo.releng.preferences.PreferenceItem; import org.eclipse.emf.cdo.releng.preferences.PreferenceNode; import org.eclipse.emf.cdo.releng.preferences.PreferencesPackage; import org.eclipse.emf.cdo.releng.preferences.Property; @@ -82,6 +83,12 @@ public class PreferencesAdapterFactory extends AdapterFactoryImpl protected PreferencesSwitch<Adapter> modelSwitch = new PreferencesSwitch<Adapter>() { @Override + public Adapter casePreferenceItem(PreferenceItem object) + { + return createPreferenceItemAdapter(); + } + + @Override public Adapter casePreferenceNode(PreferenceNode object) { return createPreferenceNodeAdapter(); @@ -115,6 +122,21 @@ public class PreferencesAdapterFactory extends AdapterFactoryImpl } /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.releng.preferences.PreferenceItem <em>Preference Item</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.emf.cdo.releng.preferences.PreferenceItem + * @generated + */ + public Adapter createPreferenceItemAdapter() + { + return null; + } + + /** * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.releng.preferences.PreferenceNode <em>Preference Node</em>}'. * <!-- begin-user-doc --> * This default implementation returns null so that we can easily ignore cases; diff --git a/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/util/PreferencesSwitch.java b/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/util/PreferencesSwitch.java index 14f3e66c56..1588526834 100644 --- a/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/util/PreferencesSwitch.java +++ b/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/util/PreferencesSwitch.java @@ -10,6 +10,7 @@ */ package org.eclipse.emf.cdo.releng.preferences.util; +import org.eclipse.emf.cdo.releng.preferences.PreferenceItem; import org.eclipse.emf.cdo.releng.preferences.PreferenceNode; import org.eclipse.emf.cdo.releng.preferences.PreferencesPackage; import org.eclipse.emf.cdo.releng.preferences.Property; @@ -81,12 +82,28 @@ public class PreferencesSwitch<T> extends Switch<T> { switch (classifierID) { + case PreferencesPackage.PREFERENCE_ITEM: + { + PreferenceItem preferenceItem = (PreferenceItem)theEObject; + T result = casePreferenceItem(preferenceItem); + if (result == null) + { + result = defaultCase(theEObject); + } + return result; + } case PreferencesPackage.PREFERENCE_NODE: { PreferenceNode preferenceNode = (PreferenceNode)theEObject; T result = casePreferenceNode(preferenceNode); if (result == null) + { + result = casePreferenceItem(preferenceNode); + } + if (result == null) + { result = defaultCase(theEObject); + } return result; } case PreferencesPackage.PROPERTY: @@ -94,7 +111,13 @@ public class PreferencesSwitch<T> extends Switch<T> Property property = (Property)theEObject; T result = caseProperty(property); if (result == null) + { + result = casePreferenceItem(property); + } + if (result == null) + { result = defaultCase(theEObject); + } return result; } default: @@ -103,6 +126,22 @@ public class PreferencesSwitch<T> extends Switch<T> } /** + * Returns the result of interpreting the object as an instance of '<em>Preference Item</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Preference Item</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T casePreferenceItem(PreferenceItem object) + { + return null; + } + + /** * Returns the result of interpreting the object as an instance of '<em>Preference Node</em>'. * <!-- begin-user-doc --> * This implementation returns null; diff --git a/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/util/PreferencesUtil.java b/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/util/PreferencesUtil.java index 03f8b32b32..f0b0510d4f 100644 --- a/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/util/PreferencesUtil.java +++ b/plugins/org.eclipse.emf.cdo.releng.preferences/src/org/eclipse/emf/cdo/releng/preferences/util/PreferencesUtil.java @@ -233,22 +233,6 @@ public final class PreferencesUtil return null; } - public static String getAbsolutePath(Property property) - { - return getAbsolutePath(property.getParent()) + "/" + property.getName(); - } - - public static String getAbsolutePath(PreferenceNode node) - { - PreferenceNode parent = node.getParent(); - if (parent == null) - { - return node.getName(); - } - - return getAbsolutePath(parent) + "/" + node.getName(); - } - public static IPath getLocation(Preferences preferences) { if (preferences == null) |