Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Fluegge2010-08-05 19:30:24 +0000
committerMartin Fluegge2010-08-05 19:30:24 +0000
commit791b135c9a75251ac2a5ad1ad5f7ab96a757a5d6 (patch)
treed86342530a51881ee1e003dcec4dc3ed23a85ae6 /plugins/org.eclipse.emf.cdo.dawn.codegen/src
parent9b839f3f7756e44ae9369889e806a87288d022fe (diff)
downloadcdo-791b135c9a75251ac2a5ad1ad5f7ab96a757a5d6.tar.gz
cdo-791b135c9a75251ac2a5ad1ad5f7ab96a757a5d6.tar.xz
cdo-791b135c9a75251ac2a5ad1ad5f7ab96a757a5d6.zip
[308232] [Dawn] Develop collaborative support for GMF on CDO
https://bugs.eclipse.org/bugs/show_bug.cgi?id=308232
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.dawn.codegen/src')
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.codegen/src/template/GMFFragmentTemplate.xpt42
1 files changed, 42 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.dawn.codegen/src/template/GMFFragmentTemplate.xpt b/plugins/org.eclipse.emf.cdo.dawn.codegen/src/template/GMFFragmentTemplate.xpt
index 2e1f140444..773af4cc1c 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.codegen/src/template/GMFFragmentTemplate.xpt
+++ b/plugins/org.eclipse.emf.cdo.dawn.codegen/src/template/GMFFragmentTemplate.xpt
@@ -287,6 +287,16 @@ public class «this.dawnEditPartFactoryClassName» extends «this.GMFGenEditorGener
«FILE "src/"+getDiagramPackagePath()+"/edit/policies/"+this.dawnCanonicalEditingPolicyClassName+".java"»
package «this.GMFGenEditorGenerator.diagram.editPoliciesPackageName»;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
+import org.eclipse.gmf.runtime.notation.View;
+
+import java.util.ArrayList;
+import java.util.List;
+
«EXPAND generatedComment -»
public class «this.dawnCanonicalEditingPolicyClassName» extends «this.GMFGenEditorGenerator.diagram.canonicalEditPolicyClassName»
{
@@ -295,6 +305,38 @@ public class «this.dawnCanonicalEditingPolicyClassName» extends «this.GMFGenEdit
{
super();
}
+
+ @Override
+ protected CreateViewRequest getCreateViewRequest(List<ViewDescriptor> descriptors)
+ {
+ List<View> viewChildren = getViewChildren();
+
+ List<ViewDescriptor> tbr = new ArrayList<CreateViewRequest.ViewDescriptor>();
+
+ for (ViewDescriptor desc : descriptors)
+ {
+ EObject obj = (EObject)((CanonicalElementAdapter)desc.getElementAdapter()).getRealObject();
+
+ boolean found = false;
+
+ for (View view : viewChildren)
+ {
+ if (view.getElement().equals(obj))
+ {
+ found = true;
+ break;
+ }
+ }
+ if (!found)
+ {
+ tbr.add(desc);
+ }
+ }
+
+ descriptors.removeAll(tbr);
+
+ return new CreateViewRequest(descriptors);
+ }
}
«ENDFILE»
«ENDDEFINE»

Back to the top