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/TextItemProvider.java')
-rw-r--r--extraplugins/diagram-definition/org.eclipse.papyrus.dd.edit/src/org/eclipse/papyrus/dd/dg/provider/TextItemProvider.java27
1 files changed, 15 insertions, 12 deletions
diff --git a/extraplugins/diagram-definition/org.eclipse.papyrus.dd.edit/src/org/eclipse/papyrus/dd/dg/provider/TextItemProvider.java b/extraplugins/diagram-definition/org.eclipse.papyrus.dd.edit/src/org/eclipse/papyrus/dd/dg/provider/TextItemProvider.java
index 24ba53368d3..035d7c93325 100644
--- a/extraplugins/diagram-definition/org.eclipse.papyrus.dd.edit/src/org/eclipse/papyrus/dd/dg/provider/TextItemProvider.java
+++ b/extraplugins/diagram-definition/org.eclipse.papyrus.dd.edit/src/org/eclipse/papyrus/dd/dg/provider/TextItemProvider.java
@@ -16,7 +16,9 @@ import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
+
import org.eclipse.emf.ecore.EStructuralFeature;
+
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemColorProvider;
@@ -28,7 +30,9 @@ import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ViewerNotification;
+
import org.eclipse.papyrus.dd.dc.DCFactory;
+
import org.eclipse.papyrus.dd.dg.DGPackage;
import org.eclipse.papyrus.dd.dg.Text;
@@ -59,7 +63,7 @@ public class TextItemProvider extends GraphicalElementItemProvider implements IE
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
- if (itemPropertyDescriptors == null) {
+ if(itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
addDataPropertyDescriptor(object);
addAnchorPropertyDescriptor(object);
@@ -75,8 +79,7 @@ public class TextItemProvider extends GraphicalElementItemProvider implements IE
* @generated
*/
protected void addDataPropertyDescriptor(Object object) {
- itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Text_data_feature"),
- getString("_UI_PropertyDescriptor_description", "_UI_Text_data_feature", "_UI_Text_type"), DGPackage.Literals.TEXT__DATA, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Text_data_feature"), getString("_UI_PropertyDescriptor_description", "_UI_Text_data_feature", "_UI_Text_type"), DGPackage.Literals.TEXT__DATA, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}
/**
@@ -87,12 +90,12 @@ public class TextItemProvider extends GraphicalElementItemProvider implements IE
* @generated
*/
protected void addAnchorPropertyDescriptor(Object object) {
- itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Text_anchor_feature"),
- getString("_UI_PropertyDescriptor_description", "_UI_Text_anchor_feature", "_UI_Text_type"), DGPackage.Literals.TEXT__ANCHOR, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Text_anchor_feature"), getString("_UI_PropertyDescriptor_description", "_UI_Text_anchor_feature", "_UI_Text_type"), DGPackage.Literals.TEXT__ANCHOR, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}
/**
- * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
+ * {@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 -->
*
@@ -100,9 +103,9 @@ public class TextItemProvider extends GraphicalElementItemProvider implements IE
*/
@Override
public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
- if (childrenFeatures == null) {
+ if(childrenFeatures == null) {
super.getChildrenFeatures(object);
- childrenFeatures.add(DGPackage.Literals.TEXT__POSITION);
+ childrenFeatures.add(DGPackage.Literals.TEXT__BOUNDS);
}
return childrenFeatures;
}
@@ -139,7 +142,7 @@ public class TextItemProvider extends GraphicalElementItemProvider implements IE
*/
@Override
public String getText(Object object) {
- String label = ((Text) object).getId();
+ String label = ((Text)object).getId();
return label == null || label.length() == 0 ? getString("_UI_Text_type") : getString("_UI_Text_type") + " " + label;
}
@@ -154,12 +157,12 @@ public class TextItemProvider extends GraphicalElementItemProvider implements IE
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
- switch (notification.getFeatureID(Text.class)) {
+ switch(notification.getFeatureID(Text.class)) {
case DGPackage.TEXT__DATA:
case DGPackage.TEXT__ANCHOR:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
- case DGPackage.TEXT__POSITION:
+ case DGPackage.TEXT__BOUNDS:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
return;
}
@@ -176,6 +179,6 @@ public class TextItemProvider extends GraphicalElementItemProvider implements IE
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
- newChildDescriptors.add(createChildParameter(DGPackage.Literals.TEXT__POSITION, DCFactory.eINSTANCE.createPoint()));
+ newChildDescriptors.add(createChildParameter(DGPackage.Literals.TEXT__BOUNDS, DCFactory.eINSTANCE.createBounds()));
}
}

Back to the top