|
@@ -18,12 +18,14 @@ import org.eclipse.emf.common.notify.AdapterFactory;
|
|
|
import org.eclipse.emf.common.notify.Notification;
|
|
|
import org.eclipse.emf.common.util.ResourceLocator;
|
|
|
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.IItemLabelProvider;
|
|
|
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
|
|
|
import org.eclipse.emf.edit.provider.IItemPropertySource;
|
|
|
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.ItemProviderAdapter;
|
|
|
import org.eclipse.emf.edit.provider.ViewerNotification;
|
|
|
import org.yakindu.sct.model.sgraph.SGraphFactory;
|
|
@@ -72,10 +74,33 @@ public class ScopedElementItemProvider
|
|
|
if (itemPropertyDescriptors == null) {
|
|
|
super.getPropertyDescriptors(object);
|
|
|
|
|
|
+ addNamespacePropertyDescriptor(object);
|
|
|
}
|
|
|
return itemPropertyDescriptors;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * This adds a property descriptor for the Namespace feature.
|
|
|
+ * <!-- begin-user-doc -->
|
|
|
+ * <!-- end-user-doc -->
|
|
|
+ * @generated
|
|
|
+ */
|
|
|
+ protected void addNamespacePropertyDescriptor(Object object) {
|
|
|
+ itemPropertyDescriptors.add
|
|
|
+ (createItemPropertyDescriptor
|
|
|
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
|
|
|
+ getResourceLocator(),
|
|
|
+ getString("_UI_ScopedElement_namespace_feature"),
|
|
|
+ getString("_UI_PropertyDescriptor_description", "_UI_ScopedElement_namespace_feature", "_UI_ScopedElement_type"),
|
|
|
+ SGraphPackage.Literals.SCOPED_ELEMENT__NAMESPACE,
|
|
|
+ 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
|
|
@@ -114,7 +139,10 @@ public class ScopedElementItemProvider
|
|
|
*/
|
|
|
@Override
|
|
|
public String getText(Object object) {
|
|
|
- return getString("_UI_ScopedElement_type");
|
|
|
+ String label = ((ScopedElement)object).getNamespace();
|
|
|
+ return label == null || label.length() == 0 ?
|
|
|
+ getString("_UI_ScopedElement_type") :
|
|
|
+ getString("_UI_ScopedElement_type") + " " + label;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -129,6 +157,9 @@ public class ScopedElementItemProvider
|
|
|
updateChildren(notification);
|
|
|
|
|
|
switch (notification.getFeatureID(ScopedElement.class)) {
|
|
|
+ case SGraphPackage.SCOPED_ELEMENT__NAMESPACE:
|
|
|
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
|
|
|
+ return;
|
|
|
case SGraphPackage.SCOPED_ELEMENT__SCOPES:
|
|
|
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
|
|
|
return;
|