Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreperico2009-12-11 06:00:21 -0500
committereperico2009-12-11 06:00:21 -0500
commit3ae60bfc50cef1a47616ead0db8235d8b471ed3f (patch)
tree7d1743e8c0e766aa3c3335985eaba20fcde73942 /plugins/profile-tool/org.eclipse.papyrus.resource.edit
parentc5a2141f5fa69e7b8d804e9d7bd741f70fc24d55 (diff)
downloadorg.eclipse.papyrus-3ae60bfc50cef1a47616ead0db8235d8b471ed3f.tar.gz
org.eclipse.papyrus-3ae60bfc50cef1a47616ead0db8235d8b471ed3f.tar.xz
org.eclipse.papyrus-3ae60bfc50cef1a47616ead0db8235d8b471ed3f.zip
task 296901: add mechansim to get the papyrus resource from EMF resource
Diffstat (limited to 'plugins/profile-tool/org.eclipse.papyrus.resource.edit')
-rw-r--r--plugins/profile-tool/org.eclipse.papyrus.resource.edit/src/org/eclipse/papyrus/resource/provider/ResourceEObjectItemProvider.java8
-rw-r--r--plugins/profile-tool/org.eclipse.papyrus.resource.edit/src/org/eclipse/papyrus/resource/provider/ResourceEditPlugin.java2
-rw-r--r--plugins/profile-tool/org.eclipse.papyrus.resource.edit/src/org/eclipse/papyrus/resource/provider/ResourceItemProvider.java12
-rw-r--r--plugins/profile-tool/org.eclipse.papyrus.resource.edit/src/org/eclipse/papyrus/resource/provider/ResourceItemProviderAdapterFactory.java24
4 files changed, 26 insertions, 20 deletions
diff --git a/plugins/profile-tool/org.eclipse.papyrus.resource.edit/src/org/eclipse/papyrus/resource/provider/ResourceEObjectItemProvider.java b/plugins/profile-tool/org.eclipse.papyrus.resource.edit/src/org/eclipse/papyrus/resource/provider/ResourceEObjectItemProvider.java
index 03d8e89fc51..817dca7e2de 100644
--- a/plugins/profile-tool/org.eclipse.papyrus.resource.edit/src/org/eclipse/papyrus/resource/provider/ResourceEObjectItemProvider.java
+++ b/plugins/profile-tool/org.eclipse.papyrus.resource.edit/src/org/eclipse/papyrus/resource/provider/ResourceEObjectItemProvider.java
@@ -28,7 +28,8 @@ import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
/**
- * This is the item provider adapter for a {@link org.eclipse.papyrus.resource.ResourceEObject} object. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * This is the item provider adapter for a {@link org.eclipse.papyrus.resource.ResourceEObject}
+ * object. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@@ -53,7 +54,7 @@ public class ResourceEObjectItemProvider extends ItemProviderAdapter implements
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
- if(itemPropertyDescriptors == null) {
+ if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
}
@@ -83,7 +84,8 @@ public class ResourceEObjectItemProvider extends ItemProviderAdapter implements
/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
- * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged} . <!-- begin-user-doc --> <!-- end-user-doc -->
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}
+ * . <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
diff --git a/plugins/profile-tool/org.eclipse.papyrus.resource.edit/src/org/eclipse/papyrus/resource/provider/ResourceEditPlugin.java b/plugins/profile-tool/org.eclipse.papyrus.resource.edit/src/org/eclipse/papyrus/resource/provider/ResourceEditPlugin.java
index c55f052be48..b4aa6cccaef 100644
--- a/plugins/profile-tool/org.eclipse.papyrus.resource.edit/src/org/eclipse/papyrus/resource/provider/ResourceEditPlugin.java
+++ b/plugins/profile-tool/org.eclipse.papyrus.resource.edit/src/org/eclipse/papyrus/resource/provider/ResourceEditPlugin.java
@@ -44,7 +44,7 @@ public final class ResourceEditPlugin extends EMFPlugin {
* @generated
*/
public ResourceEditPlugin() {
- super(new ResourceLocator[]{});
+ super(new ResourceLocator[] {});
}
/**
diff --git a/plugins/profile-tool/org.eclipse.papyrus.resource.edit/src/org/eclipse/papyrus/resource/provider/ResourceItemProvider.java b/plugins/profile-tool/org.eclipse.papyrus.resource.edit/src/org/eclipse/papyrus/resource/provider/ResourceItemProvider.java
index 1538a28c520..2aa5ba09197 100644
--- a/plugins/profile-tool/org.eclipse.papyrus.resource.edit/src/org/eclipse/papyrus/resource/provider/ResourceItemProvider.java
+++ b/plugins/profile-tool/org.eclipse.papyrus.resource.edit/src/org/eclipse/papyrus/resource/provider/ResourceItemProvider.java
@@ -59,7 +59,7 @@ public class ResourceItemProvider extends ItemProviderAdapter implements IEditin
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
- if(itemPropertyDescriptors == null) {
+ if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
}
@@ -68,7 +68,8 @@ public class ResourceItemProvider extends ItemProviderAdapter implements IEditin
/**
* 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
+ * 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 -->
*
@@ -76,7 +77,7 @@ public class ResourceItemProvider extends ItemProviderAdapter implements IEditin
*/
@Override
public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
- if(childrenFeatures == null) {
+ if (childrenFeatures == null) {
super.getChildrenFeatures(object);
childrenFeatures.add(ResourcePackage.Literals.RESOURCE__EOBJECTS);
}
@@ -119,7 +120,8 @@ public class ResourceItemProvider extends ItemProviderAdapter implements IEditin
/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
- * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged} . <!-- begin-user-doc --> <!-- end-user-doc -->
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}
+ * . <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@@ -127,7 +129,7 @@ public class ResourceItemProvider extends ItemProviderAdapter implements IEditin
public void notifyChanged(Notification notification) {
updateChildren(notification);
- switch(notification.getFeatureID(Resource.class)) {
+ switch (notification.getFeatureID(Resource.class)) {
case ResourcePackage.RESOURCE__EOBJECTS:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
return;
diff --git a/plugins/profile-tool/org.eclipse.papyrus.resource.edit/src/org/eclipse/papyrus/resource/provider/ResourceItemProviderAdapterFactory.java b/plugins/profile-tool/org.eclipse.papyrus.resource.edit/src/org/eclipse/papyrus/resource/provider/ResourceItemProviderAdapterFactory.java
index 914240963be..6b27e36b9d7 100644
--- a/plugins/profile-tool/org.eclipse.papyrus.resource.edit/src/org/eclipse/papyrus/resource/provider/ResourceItemProviderAdapterFactory.java
+++ b/plugins/profile-tool/org.eclipse.papyrus.resource.edit/src/org/eclipse/papyrus/resource/provider/ResourceItemProviderAdapterFactory.java
@@ -34,8 +34,8 @@ import org.eclipse.papyrus.resource.util.ResourceAdapterFactory;
/**
* This is the factory that is used to provide the interfaces needed to support Viewers. The
- * adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}. The adapters also
- * support Eclipse property sheets.
+ * adapters generated by this factory convert EMF adapter notifications into calls to
+ * {@link #fireNotifyChanged fireNotifyChanged}. The adapters also support Eclipse property sheets.
* Note that most of the adapters are shared among multiple instances. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
@@ -82,7 +82,8 @@ public class ResourceItemProviderAdapterFactory extends ResourceAdapterFactory i
}
/**
- * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.resource.Resource} instances. <!-- begin-user-doc --> <!--
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.papyrus.resource.Resource} instances. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @generated
@@ -97,7 +98,7 @@ public class ResourceItemProviderAdapterFactory extends ResourceAdapterFactory i
*/
@Override
public Adapter createResourceAdapter() {
- if(resourceItemProvider == null) {
+ if (resourceItemProvider == null) {
resourceItemProvider = new ResourceItemProvider(this);
}
@@ -105,7 +106,8 @@ public class ResourceItemProviderAdapterFactory extends ResourceAdapterFactory i
}
/**
- * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.resource.ResourceEObject} instances. <!-- begin-user-doc --> <!--
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.papyrus.resource.ResourceEObject} instances. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @generated
@@ -120,7 +122,7 @@ public class ResourceItemProviderAdapterFactory extends ResourceAdapterFactory i
*/
@Override
public Adapter createResourceEObjectAdapter() {
- if(resourceEObjectItemProvider == null) {
+ if (resourceEObjectItemProvider == null) {
resourceEObjectItemProvider = new ResourceEObjectItemProvider(this);
}
@@ -175,9 +177,9 @@ public class ResourceItemProviderAdapterFactory extends ResourceAdapterFactory i
*/
@Override
public Object adapt(Object object, Object type) {
- if(isFactoryForType(type)) {
+ if (isFactoryForType(type)) {
Object adapter = super.adapt(object, type);
- if(!(type instanceof Class<?>) || (((Class<?>)type).isInstance(adapter))) {
+ if (!(type instanceof Class<?>) || (((Class<?>) type).isInstance(adapter))) {
return adapter;
}
}
@@ -212,7 +214,7 @@ public class ResourceItemProviderAdapterFactory extends ResourceAdapterFactory i
public void fireNotifyChanged(Notification notification) {
changeNotifier.fireNotifyChanged(notification);
- if(parentAdapterFactory != null) {
+ if (parentAdapterFactory != null) {
parentAdapterFactory.fireNotifyChanged(notification);
}
}
@@ -224,9 +226,9 @@ public class ResourceItemProviderAdapterFactory extends ResourceAdapterFactory i
* @generated
*/
public void dispose() {
- if(resourceItemProvider != null)
+ if (resourceItemProvider != null)
resourceItemProvider.dispose();
- if(resourceEObjectItemProvider != null)
+ if (resourceEObjectItemProvider != null)
resourceEObjectItemProvider.dispose();
}

Back to the top