Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'extraplugins/diagram-definition/org.eclipse.papyrus.dd.edit/src/org/eclipse/papyrus/dd/dg/provider/RootCanvasItemProvider.java')
-rw-r--r--extraplugins/diagram-definition/org.eclipse.papyrus.dd.edit/src/org/eclipse/papyrus/dd/dg/provider/RootCanvasItemProvider.java95
1 files changed, 26 insertions, 69 deletions
diff --git a/extraplugins/diagram-definition/org.eclipse.papyrus.dd.edit/src/org/eclipse/papyrus/dd/dg/provider/RootCanvasItemProvider.java b/extraplugins/diagram-definition/org.eclipse.papyrus.dd.edit/src/org/eclipse/papyrus/dd/dg/provider/RootCanvasItemProvider.java
index 6315811b4b7..0b190bec8c8 100644
--- a/extraplugins/diagram-definition/org.eclipse.papyrus.dd.edit/src/org/eclipse/papyrus/dd/dg/provider/RootCanvasItemProvider.java
+++ b/extraplugins/diagram-definition/org.eclipse.papyrus.dd.edit/src/org/eclipse/papyrus/dd/dg/provider/RootCanvasItemProvider.java
@@ -39,12 +39,11 @@ import org.eclipse.papyrus.dd.dg.RootCanvas;
* This is the item provider adapter for a {@link org.eclipse.papyrus.dd.dg.RootCanvas} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
-public class RootCanvasItemProvider extends CanvasItemProvider implements
- IEditingDomainItemProvider, IStructuredItemContentProvider,
- ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource,
- IItemColorProvider, IItemFontProvider {
+public class RootCanvasItemProvider extends CanvasItemProvider implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource, IItemColorProvider, IItemFontProvider {
+
/**
* This constructs an instance from a factory and a notifier. <!--
* begin-user-doc --> <!-- end-user-doc -->
@@ -63,9 +62,8 @@ public class RootCanvasItemProvider extends CanvasItemProvider implements
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
- if (itemPropertyDescriptors == null) {
+ if(itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
-
addBackgroundColorPropertyDescriptor(object);
addExternalStyleSheetPropertyDescriptor(object);
addScriptPropertyDescriptor(object);
@@ -80,62 +78,28 @@ public class RootCanvasItemProvider extends CanvasItemProvider implements
* @generated
*/
protected void addBackgroundColorPropertyDescriptor(Object object) {
- itemPropertyDescriptors.add
- (createItemPropertyDescriptor
- (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
- getResourceLocator(),
- getString("_UI_RootCanvas_backgroundColor_feature"),
- getString("_UI_PropertyDescriptor_description", "_UI_RootCanvas_backgroundColor_feature", "_UI_RootCanvas_type"),
- DGPackage.Literals.ROOT_CANVAS__BACKGROUND_COLOR,
- true,
- false,
- false,
- ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
- null,
- null));
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_RootCanvas_backgroundColor_feature"), getString("_UI_PropertyDescriptor_description", "_UI_RootCanvas_backgroundColor_feature", "_UI_RootCanvas_type"), DGPackage.Literals.ROOT_CANVAS__BACKGROUND_COLOR, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}
/**
* This adds a property descriptor for the External Style Sheet feature.
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
protected void addExternalStyleSheetPropertyDescriptor(Object object) {
- itemPropertyDescriptors.add
- (createItemPropertyDescriptor
- (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
- getResourceLocator(),
- getString("_UI_RootCanvas_externalStyleSheet_feature"),
- getString("_UI_PropertyDescriptor_description", "_UI_RootCanvas_externalStyleSheet_feature", "_UI_RootCanvas_type"),
- DGPackage.Literals.ROOT_CANVAS__EXTERNAL_STYLE_SHEET,
- true,
- false,
- true,
- null,
- null,
- null));
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_RootCanvas_externalStyleSheet_feature"), getString("_UI_PropertyDescriptor_description", "_UI_RootCanvas_externalStyleSheet_feature", "_UI_RootCanvas_type"), DGPackage.Literals.ROOT_CANVAS__EXTERNAL_STYLE_SHEET, true, false, true, null, null, null));
}
/**
* This adds a property descriptor for the Script feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
protected void addScriptPropertyDescriptor(Object object) {
- itemPropertyDescriptors.add
- (createItemPropertyDescriptor
- (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
- getResourceLocator(),
- getString("_UI_RootCanvas_script_feature"),
- getString("_UI_PropertyDescriptor_description", "_UI_RootCanvas_script_feature", "_UI_RootCanvas_type"),
- DGPackage.Literals.ROOT_CANVAS__SCRIPT,
- true,
- false,
- false,
- ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
- null,
- null));
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_RootCanvas_script_feature"), getString("_UI_PropertyDescriptor_description", "_UI_RootCanvas_script_feature", "_UI_RootCanvas_type"), DGPackage.Literals.ROOT_CANVAS__SCRIPT, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}
/**
@@ -143,12 +107,12 @@ public class RootCanvasItemProvider extends CanvasItemProvider implements
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
* {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@Override
- public Collection<? extends EStructuralFeature> getChildrenFeatures(
- Object object) {
- if (childrenFeatures == null) {
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
+ if(childrenFeatures == null) {
super.getChildrenFeatures(object);
childrenFeatures.add(DGPackage.Literals.ROOT_CANVAS__DEFINITIONS);
}
@@ -157,13 +121,13 @@ public class RootCanvasItemProvider extends CanvasItemProvider implements
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@Override
protected EStructuralFeature getChildFeature(Object object, Object child) {
// Check the type of the specified child object and return the proper feature to use for
// adding (see {@link AddCommand}) it as a child.
-
return super.getChildFeature(object, child);
}
@@ -182,14 +146,13 @@ public class RootCanvasItemProvider extends CanvasItemProvider implements
* This returns the label text for the adapted class.
* <!-- begin-user-doc
* --> <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public String getText(Object object) {
String label = ((RootCanvas)object).getId();
- return label == null || label.length() == 0 ?
- getString("_UI_RootCanvas_type") :
- getString("_UI_RootCanvas_type") + " " + label;
+ return label == null || label.length() == 0 ? getString("_UI_RootCanvas_type") : getString("_UI_RootCanvas_type") + " " + label;
}
/**
@@ -197,20 +160,20 @@ public class RootCanvasItemProvider extends CanvasItemProvider implements
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc --> <!--
* end-user-doc -->
+ *
* @generated
*/
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
-
- switch (notification.getFeatureID(RootCanvas.class)) {
- case DGPackage.ROOT_CANVAS__BACKGROUND_COLOR:
- case DGPackage.ROOT_CANVAS__SCRIPT:
- fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
- return;
- case DGPackage.ROOT_CANVAS__DEFINITIONS:
- fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
- return;
+ switch(notification.getFeatureID(RootCanvas.class)) {
+ case DGPackage.ROOT_CANVAS__BACKGROUND_COLOR:
+ case DGPackage.ROOT_CANVAS__SCRIPT:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ case DGPackage.ROOT_CANVAS__DEFINITIONS:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
+ return;
}
super.notifyChanged(notification);
}
@@ -223,14 +186,8 @@ public class RootCanvasItemProvider extends CanvasItemProvider implements
* @generated
*/
@Override
- protected void collectNewChildDescriptors(
- Collection<Object> newChildDescriptors, Object object) {
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
-
- newChildDescriptors.add
- (createChildParameter
- (DGPackage.Literals.ROOT_CANVAS__DEFINITIONS,
- DGFactory.eINSTANCE.createDefinitions()));
+ newChildDescriptors.add(createChildParameter(DGPackage.Literals.ROOT_CANVAS__DEFINITIONS, DGFactory.eINSTANCE.createDefinitions()));
}
-
}

Back to the top