Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 133333 Details for
Bug 224585
Reordering elements contained in a Compartment using a List layout
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch applied to support Reordering elements in a Compartment using a FlowLayout
Bug224585.txt (text/plain), 41.34 KB, created by
Jacques LESCOT
on 2009-04-27 06:04:48 EDT
(
hide
)
Description:
Patch applied to support Reordering elements in a Compartment using a FlowLayout
Filename:
MIME Type:
Creator:
Jacques LESCOT
Created:
2009-04-27 06:04:48 EDT
Size:
41.34 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.emf.ecoretools.diagram >Index: src/org/eclipse/emf/ecoretools/diagram/edit/parts/EClassOperationsEditPart.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/edit/parts/EClassOperationsEditPart.java,v >retrieving revision 1.5 >diff -u -r1.5 EClassOperationsEditPart.java >--- src/org/eclipse/emf/ecoretools/diagram/edit/parts/EClassOperationsEditPart.java 20 Apr 2009 14:35:13 -0000 1.5 >+++ src/org/eclipse/emf/ecoretools/diagram/edit/parts/EClassOperationsEditPart.java 27 Apr 2009 10:03:00 -0000 >@@ -14,11 +14,14 @@ > > package org.eclipse.emf.ecoretools.diagram.edit.parts; > >+import org.eclipse.draw2d.FlowLayout; > import org.eclipse.draw2d.IFigure; > import org.eclipse.emf.common.notify.Notification; >+import org.eclipse.emf.ecore.EcorePackage; >+import org.eclipse.emf.ecoretools.diagram.edit.policies.CompartmentChildCreationEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EClassOperationsCanonicalEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EClassOperationsItemSemanticEditPolicy; >-import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoreCreationEditPolicy; >+import org.eclipse.emf.ecoretools.diagram.edit.policies.ReorderingCompartmentEditPolicy; > import org.eclipse.emf.ecoretools.diagram.part.Messages; > import org.eclipse.gef.EditPolicy; > import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart; >@@ -60,24 +63,36 @@ > } > > /** >- * @generated >+ * @generated NOT > */ > public IFigure createFigure() { > ResizableCompartmentFigure result = (ResizableCompartmentFigure) super.createFigure(); >+ FlowLayout layout = new FlowLayout(); >+ layout.setMajorSpacing(getMapMode().DPtoLP(0)); >+ layout.setMinorSpacing(getMapMode().DPtoLP(0)); >+ layout.setHorizontal(false); >+ result.getContentPane().setLayoutManager(layout); > result.setTitleVisibility(false); > return result; > } > > /** >- * @generated >+ * @generated NOT > */ > protected void createDefaultEditPolicies() { > super.createDefaultEditPolicies(); > installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ResizableCompartmentEditPolicy()); > installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new EClassOperationsItemSemanticEditPolicy()); >- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new EcoreCreationEditPolicy()); >+ >+ // Use a custom Policy to create child elements and initialize their >+ // initial position >+ installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CompartmentChildCreationEditPolicy()); >+ > installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy()); > installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new EClassOperationsCanonicalEditPolicy()); >+ >+ // Add a policy used to reorder children >+ installEditPolicy(EditPolicy.LAYOUT_ROLE, new ReorderingCompartmentEditPolicy(EcorePackage.Literals.ECLASS__EOPERATIONS)); > } > > /** >Index: src/org/eclipse/emf/ecoretools/diagram/edit/parts/EClassAttributesEditPart.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/edit/parts/EClassAttributesEditPart.java,v >retrieving revision 1.5 >diff -u -r1.5 EClassAttributesEditPart.java >--- src/org/eclipse/emf/ecoretools/diagram/edit/parts/EClassAttributesEditPart.java 20 Apr 2009 14:35:13 -0000 1.5 >+++ src/org/eclipse/emf/ecoretools/diagram/edit/parts/EClassAttributesEditPart.java 27 Apr 2009 10:03:00 -0000 >@@ -14,11 +14,14 @@ > > package org.eclipse.emf.ecoretools.diagram.edit.parts; > >+import org.eclipse.draw2d.FlowLayout; > import org.eclipse.draw2d.IFigure; > import org.eclipse.emf.common.notify.Notification; >+import org.eclipse.emf.ecore.EcorePackage; >+import org.eclipse.emf.ecoretools.diagram.edit.policies.CompartmentChildCreationEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EClassAttributesCanonicalEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EClassAttributesItemSemanticEditPolicy; >-import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoreCreationEditPolicy; >+import org.eclipse.emf.ecoretools.diagram.edit.policies.ReorderingCompartmentEditPolicy; > import org.eclipse.emf.ecoretools.diagram.part.Messages; > import org.eclipse.gef.EditPolicy; > import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart; >@@ -60,24 +63,36 @@ > } > > /** >- * @generated >+ * @generated NOT > */ > public IFigure createFigure() { > ResizableCompartmentFigure result = (ResizableCompartmentFigure) super.createFigure(); >+ FlowLayout layout = new FlowLayout(); >+ layout.setMajorSpacing(getMapMode().DPtoLP(0)); >+ layout.setMinorSpacing(getMapMode().DPtoLP(0)); >+ layout.setHorizontal(false); >+ result.getContentPane().setLayoutManager(layout); > result.setTitleVisibility(false); > return result; > } > > /** >- * @generated >+ * @generated NOT > */ > protected void createDefaultEditPolicies() { > super.createDefaultEditPolicies(); > installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ResizableCompartmentEditPolicy()); > installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new EClassAttributesItemSemanticEditPolicy()); >- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new EcoreCreationEditPolicy()); >+ >+ // Use a custom Policy to create child elements and initialize their >+ // initial position >+ installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CompartmentChildCreationEditPolicy()); >+ > installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy()); > installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new EClassAttributesCanonicalEditPolicy()); >+ >+ // Add a policy used to reorder children >+ installEditPolicy(EditPolicy.LAYOUT_ROLE, new ReorderingCompartmentEditPolicy(EcorePackage.Literals.ECLASS__ESTRUCTURAL_FEATURES)); > } > > /** >Index: src/org/eclipse/emf/ecoretools/diagram/edit/parts/EAnnotationDetailsEditPart.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/edit/parts/EAnnotationDetailsEditPart.java,v >retrieving revision 1.4 >diff -u -r1.4 EAnnotationDetailsEditPart.java >--- src/org/eclipse/emf/ecoretools/diagram/edit/parts/EAnnotationDetailsEditPart.java 25 Mar 2009 11:40:19 -0000 1.4 >+++ src/org/eclipse/emf/ecoretools/diagram/edit/parts/EAnnotationDetailsEditPart.java 27 Apr 2009 10:03:00 -0000 >@@ -14,14 +14,17 @@ > > package org.eclipse.emf.ecoretools.diagram.edit.parts; > >+import org.eclipse.draw2d.FlowLayout; > import org.eclipse.draw2d.IFigure; > import org.eclipse.emf.common.notify.Notification; >+import org.eclipse.emf.ecore.EcorePackage; >+import org.eclipse.emf.ecoretools.diagram.edit.policies.CompartmentChildCreationEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EAnnotationDetailsCanonicalEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EAnnotationDetailsItemSemanticEditPolicy; >+import org.eclipse.emf.ecoretools.diagram.edit.policies.ReorderingCompartmentEditPolicy; > import org.eclipse.emf.ecoretools.diagram.part.Messages; > import org.eclipse.gef.EditPolicy; > import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart; >-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy; > import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy; > import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; > import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableCompartmentEditPolicy; >@@ -60,24 +63,36 @@ > } > > /** >- * @generated >+ * @generated NOT > */ > public IFigure createFigure() { > ResizableCompartmentFigure result = (ResizableCompartmentFigure) super.createFigure(); >+ FlowLayout layout = new FlowLayout(); >+ layout.setMajorSpacing(getMapMode().DPtoLP(0)); >+ layout.setMinorSpacing(getMapMode().DPtoLP(0)); >+ layout.setHorizontal(false); >+ result.getContentPane().setLayoutManager(layout); > result.setTitleVisibility(false); > return result; > } > > /** >- * @generated >+ * @generated NOT > */ > protected void createDefaultEditPolicies() { > super.createDefaultEditPolicies(); > installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ResizableCompartmentEditPolicy()); > installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new EAnnotationDetailsItemSemanticEditPolicy()); >- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy()); >+ >+ // Use a custom Policy to create child elements and initialize their >+ // initial position >+ installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CompartmentChildCreationEditPolicy()); >+ > installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy()); > installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new EAnnotationDetailsCanonicalEditPolicy()); >+ >+ // Add a policy used to reorder children >+ installEditPolicy(EditPolicy.LAYOUT_ROLE, new ReorderingCompartmentEditPolicy(EcorePackage.Literals.EANNOTATION__DETAILS)); > } > > /** >Index: src/org/eclipse/emf/ecoretools/diagram/edit/parts/EEnumLiterals2EditPart.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/edit/parts/EEnumLiterals2EditPart.java,v >retrieving revision 1.4 >diff -u -r1.4 EEnumLiterals2EditPart.java >--- src/org/eclipse/emf/ecoretools/diagram/edit/parts/EEnumLiterals2EditPart.java 25 Mar 2009 11:40:19 -0000 1.4 >+++ src/org/eclipse/emf/ecoretools/diagram/edit/parts/EEnumLiterals2EditPart.java 27 Apr 2009 10:03:00 -0000 >@@ -14,14 +14,17 @@ > > package org.eclipse.emf.ecoretools.diagram.edit.parts; > >+import org.eclipse.draw2d.FlowLayout; > import org.eclipse.draw2d.IFigure; > import org.eclipse.emf.common.notify.Notification; >+import org.eclipse.emf.ecore.EcorePackage; >+import org.eclipse.emf.ecoretools.diagram.edit.policies.CompartmentChildCreationEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EEnumLiterals2CanonicalEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EEnumLiterals2ItemSemanticEditPolicy; >+import org.eclipse.emf.ecoretools.diagram.edit.policies.ReorderingCompartmentEditPolicy; > import org.eclipse.emf.ecoretools.diagram.part.Messages; > import org.eclipse.gef.EditPolicy; > import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart; >-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy; > import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy; > import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; > import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableCompartmentEditPolicy; >@@ -60,24 +63,36 @@ > } > > /** >- * @generated >+ * @generated NOT > */ > public IFigure createFigure() { > ResizableCompartmentFigure result = (ResizableCompartmentFigure) super.createFigure(); >+ FlowLayout layout = new FlowLayout(); >+ layout.setMajorSpacing(getMapMode().DPtoLP(0)); >+ layout.setMinorSpacing(getMapMode().DPtoLP(0)); >+ layout.setHorizontal(false); >+ result.getContentPane().setLayoutManager(layout); > result.setTitleVisibility(false); > return result; > } > > /** >- * @generated >+ * @generated NOT > */ > protected void createDefaultEditPolicies() { > super.createDefaultEditPolicies(); > installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ResizableCompartmentEditPolicy()); > installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new EEnumLiterals2ItemSemanticEditPolicy()); >- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy()); >+ >+ // Use a custom Policy to create child elements and initialize their >+ // initial position >+ installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CompartmentChildCreationEditPolicy()); >+ > installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy()); > installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new EEnumLiterals2CanonicalEditPolicy()); >+ >+ // Add a policy used to reorder children >+ installEditPolicy(EditPolicy.LAYOUT_ROLE, new ReorderingCompartmentEditPolicy(EcorePackage.Literals.EENUM__ELITERALS)); > } > > /** >Index: src/org/eclipse/emf/ecoretools/diagram/edit/parts/EClassOperations2EditPart.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/edit/parts/EClassOperations2EditPart.java,v >retrieving revision 1.5 >diff -u -r1.5 EClassOperations2EditPart.java >--- src/org/eclipse/emf/ecoretools/diagram/edit/parts/EClassOperations2EditPart.java 20 Apr 2009 14:35:13 -0000 1.5 >+++ src/org/eclipse/emf/ecoretools/diagram/edit/parts/EClassOperations2EditPart.java 27 Apr 2009 10:03:00 -0000 >@@ -14,11 +14,14 @@ > > package org.eclipse.emf.ecoretools.diagram.edit.parts; > >+import org.eclipse.draw2d.FlowLayout; > import org.eclipse.draw2d.IFigure; > import org.eclipse.emf.common.notify.Notification; >+import org.eclipse.emf.ecore.EcorePackage; >+import org.eclipse.emf.ecoretools.diagram.edit.policies.CompartmentChildCreationEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EClassOperations2CanonicalEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EClassOperations2ItemSemanticEditPolicy; >-import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoreCreationEditPolicy; >+import org.eclipse.emf.ecoretools.diagram.edit.policies.ReorderingCompartmentEditPolicy; > import org.eclipse.emf.ecoretools.diagram.part.Messages; > import org.eclipse.gef.EditPolicy; > import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart; >@@ -60,24 +63,36 @@ > } > > /** >- * @generated >+ * @generated NOT > */ > public IFigure createFigure() { > ResizableCompartmentFigure result = (ResizableCompartmentFigure) super.createFigure(); >+ FlowLayout layout = new FlowLayout(); >+ layout.setMajorSpacing(getMapMode().DPtoLP(0)); >+ layout.setMinorSpacing(getMapMode().DPtoLP(0)); >+ layout.setHorizontal(false); >+ result.getContentPane().setLayoutManager(layout); > result.setTitleVisibility(false); > return result; > } > > /** >- * @generated >+ * @generated NOT > */ > protected void createDefaultEditPolicies() { > super.createDefaultEditPolicies(); > installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ResizableCompartmentEditPolicy()); > installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new EClassOperations2ItemSemanticEditPolicy()); >- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new EcoreCreationEditPolicy()); >+ >+ // Use a custom Policy to create child elements and initialize their >+ // initial position >+ installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CompartmentChildCreationEditPolicy()); >+ > installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy()); > installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new EClassOperations2CanonicalEditPolicy()); >+ >+ // Add a policy used to reorder children >+ installEditPolicy(EditPolicy.LAYOUT_ROLE, new ReorderingCompartmentEditPolicy(EcorePackage.Literals.ECLASS__EOPERATIONS)); > } > > /** >Index: src/org/eclipse/emf/ecoretools/diagram/edit/parts/EEnumLiteralsEditPart.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/edit/parts/EEnumLiteralsEditPart.java,v >retrieving revision 1.4 >diff -u -r1.4 EEnumLiteralsEditPart.java >--- src/org/eclipse/emf/ecoretools/diagram/edit/parts/EEnumLiteralsEditPart.java 25 Mar 2009 11:40:19 -0000 1.4 >+++ src/org/eclipse/emf/ecoretools/diagram/edit/parts/EEnumLiteralsEditPart.java 27 Apr 2009 10:03:00 -0000 >@@ -14,14 +14,18 @@ > > package org.eclipse.emf.ecoretools.diagram.edit.parts; > >+import org.eclipse.draw2d.FlowLayout; > import org.eclipse.draw2d.IFigure; > import org.eclipse.emf.common.notify.Notification; >+import org.eclipse.emf.ecore.EcorePackage; >+import org.eclipse.emf.ecoretools.diagram.edit.policies.CompartmentChildCreationEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EEnumLiteralsCanonicalEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EEnumLiteralsItemSemanticEditPolicy; >+import org.eclipse.emf.ecoretools.diagram.edit.policies.ReorderingCompartmentEditPolicy; > import org.eclipse.emf.ecoretools.diagram.part.Messages; > import org.eclipse.gef.EditPolicy; >+import org.eclipse.gef.Request; > import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart; >-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy; > import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy; > import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; > import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableCompartmentEditPolicy; >@@ -60,24 +64,35 @@ > } > > /** >- * @generated >+ * @generated NOT > */ > public IFigure createFigure() { > ResizableCompartmentFigure result = (ResizableCompartmentFigure) super.createFigure(); >+ FlowLayout layout = new FlowLayout(); >+ layout.setMajorSpacing(getMapMode().DPtoLP(0)); >+ layout.setMinorSpacing(getMapMode().DPtoLP(0)); >+ layout.setHorizontal(false); >+ result.getContentPane().setLayoutManager(layout); > result.setTitleVisibility(false); > return result; > } > > /** >- * @generated >+ * @generated NOT > */ > protected void createDefaultEditPolicies() { > super.createDefaultEditPolicies(); > installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ResizableCompartmentEditPolicy()); > installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new EEnumLiteralsItemSemanticEditPolicy()); >- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy()); >+ >+ // Use a custom Policy to create child elements and initialize their initial position >+ installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CompartmentChildCreationEditPolicy()); >+ > installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy()); > installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new EEnumLiteralsCanonicalEditPolicy()); >+ >+ // Add a policy used to reorder children >+ installEditPolicy(EditPolicy.LAYOUT_ROLE, new ReorderingCompartmentEditPolicy(EcorePackage.Literals.EENUM__ELITERALS)); > } > > /** >Index: src/org/eclipse/emf/ecoretools/diagram/edit/parts/EClassAttributes2EditPart.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/edit/parts/EClassAttributes2EditPart.java,v >retrieving revision 1.5 >diff -u -r1.5 EClassAttributes2EditPart.java >--- src/org/eclipse/emf/ecoretools/diagram/edit/parts/EClassAttributes2EditPart.java 20 Apr 2009 14:35:13 -0000 1.5 >+++ src/org/eclipse/emf/ecoretools/diagram/edit/parts/EClassAttributes2EditPart.java 27 Apr 2009 10:03:00 -0000 >@@ -14,11 +14,14 @@ > > package org.eclipse.emf.ecoretools.diagram.edit.parts; > >+import org.eclipse.draw2d.FlowLayout; > import org.eclipse.draw2d.IFigure; > import org.eclipse.emf.common.notify.Notification; >+import org.eclipse.emf.ecore.EcorePackage; >+import org.eclipse.emf.ecoretools.diagram.edit.policies.CompartmentChildCreationEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EClassAttributes2CanonicalEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EClassAttributes2ItemSemanticEditPolicy; >-import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoreCreationEditPolicy; >+import org.eclipse.emf.ecoretools.diagram.edit.policies.ReorderingCompartmentEditPolicy; > import org.eclipse.emf.ecoretools.diagram.part.Messages; > import org.eclipse.gef.EditPolicy; > import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart; >@@ -60,24 +63,36 @@ > } > > /** >- * @generated >+ * @generated NOT > */ > public IFigure createFigure() { > ResizableCompartmentFigure result = (ResizableCompartmentFigure) super.createFigure(); >+ FlowLayout layout = new FlowLayout(); >+ layout.setMajorSpacing(getMapMode().DPtoLP(0)); >+ layout.setMinorSpacing(getMapMode().DPtoLP(0)); >+ layout.setHorizontal(false); >+ result.getContentPane().setLayoutManager(layout); > result.setTitleVisibility(false); > return result; > } > > /** >- * @generated >+ * @generated NOT > */ > protected void createDefaultEditPolicies() { > super.createDefaultEditPolicies(); > installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ResizableCompartmentEditPolicy()); > installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new EClassAttributes2ItemSemanticEditPolicy()); >- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new EcoreCreationEditPolicy()); >+ >+ // Use a custom Policy to create child elements and initialize their >+ // initial position >+ installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CompartmentChildCreationEditPolicy()); >+ > installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy()); > installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new EClassAttributes2CanonicalEditPolicy()); >+ >+ // Add a policy used to reorder children >+ installEditPolicy(EditPolicy.LAYOUT_ROLE, new ReorderingCompartmentEditPolicy(EcorePackage.Literals.ECLASS__ESTRUCTURAL_FEATURES)); > } > > /** >Index: custom-src/org/eclipse/emf/ecoretools/diagram/edit/policies/CompartmentChildCreationEditPolicy.java >=================================================================== >RCS file: custom-src/org/eclipse/emf/ecoretools/diagram/edit/policies/CompartmentChildCreationEditPolicy.java >diff -N custom-src/org/eclipse/emf/ecoretools/diagram/edit/policies/CompartmentChildCreationEditPolicy.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ custom-src/org/eclipse/emf/ecoretools/diagram/edit/policies/CompartmentChildCreationEditPolicy.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,134 @@ >+/** >+ * Copyright (c) 2008 Anyware Technologies and others >+ * >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Anyware Technologies - initial API and implementation >+ */ >+package org.eclipse.emf.ecoretools.diagram.edit.policies; >+ >+import java.util.List; >+ >+import org.eclipse.draw2d.FlowLayout; >+import org.eclipse.draw2d.IFigure; >+import org.eclipse.draw2d.geometry.Point; >+import org.eclipse.draw2d.geometry.Rectangle; >+import org.eclipse.draw2d.geometry.Transposer; >+import org.eclipse.emf.ecoretools.diagram.edit.commands.CompartmentChildCreateCommand; >+import org.eclipse.emf.transaction.TransactionalEditingDomain; >+import org.eclipse.gef.EditPart; >+import org.eclipse.gef.Request; >+import org.eclipse.gef.commands.Command; >+import org.eclipse.gef.requests.DropRequest; >+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; >+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; >+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; >+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages; >+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest; >+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand; >+import org.eclipse.gmf.runtime.notation.View; >+ >+/** >+ * A CreationEditPolicy that could be used in addition with a FlowLayout to >+ * support child ordering at creation >+ * >+ * Creation : 28 mar. 2008 >+ * >+ * @author <a href="mailto:jacques.lescot@anyware-tech.com">Jacques LESCOT</a> >+ */ >+public class CompartmentChildCreationEditPolicy extends EcoreCreationEditPolicy { >+ >+ /** >+ * @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy#getCreateCommand(org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest) >+ */ >+ protected Command getCreateCommand(CreateViewRequest request) { >+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain(); >+ CompositeTransactionalCommand cc = new CompositeTransactionalCommand(editingDomain, DiagramUIMessages.AddCommand_Label); >+ >+ for (CreateViewRequest.ViewDescriptor descriptor : (List<CreateViewRequest.ViewDescriptor>) request.getViewDescriptors()) { >+ cc.compose(new CompartmentChildCreateCommand(editingDomain, descriptor, (View) (getHost().getModel()), getFeedbackIndexFor(request))); >+ } >+ return new ICommandProxy(cc.reduce()); >+ } >+ >+ protected int getFeedbackIndexFor(Request request) { >+ List<EditPart> children = (List<EditPart>) getHost().getChildren(); >+ if (children.isEmpty()) >+ return -1; >+ >+ Transposer transposer = new Transposer(); >+ transposer.setEnabled(!isHorizontal()); >+ >+ Point p = transposer.t(getLocationFromRequest(request)); >+ // EcoreDiagramEditorPlugin.getInstance().getLog().log(new >+ // Status(IStatus.INFO, EcoreDiagramEditorPlugin.ID, p.toString())); >+ >+ // Current row bottom, initialize to below the bottom. >+ int rowBottom = Integer.MIN_VALUE; >+ int candidate = -1; >+ // When the request is created outside the Compartment, the element is >+ // added at the end of the list (this is the case when the element is >+ // created from the parent header accelerator >+ if (transposer.t(getAbsoluteBounds(((GraphicalEditPart) getHost()))).contains(p)) { >+ for (int i = 0; i < children.size(); i++) { >+ EditPart child = children.get(i); >+ Rectangle rect = transposer.t(getAbsoluteBounds(((GraphicalEditPart) child))); >+ if (rect.y > rowBottom) { >+ // We are in a new row, so if we don't have a candidate but >+ // yet are within the previous row, then the current entry >+ // becomes the candidate. This is because we know we must be >+ // to the right of center of the last Figure in the previous >+ // row, so this Figure (which is at the start of a new row) >+ // is the candidate. >+ if (p.y <= rowBottom) { >+ if (candidate == -1) { >+ candidate = i; >+ } >+ break; >+ } else { >+ // Mouse's Y is outside the row, so reset the candidate >+ candidate = -1; >+ } >+ } >+ rowBottom = Math.max(rowBottom, rect.bottom()); >+ if (candidate == -1) { >+ // See if we have a possible candidate. It is a candidate if >+ // the cursor is left of the center of this candidate. >+ if (p.x <= rect.x + (rect.width / 2)) { >+ candidate = i; >+ } >+ } >+ if (candidate != -1) { >+ // We have a candidate, see if the rowBottom has grown to >+ // include the mouse Y. >+ if (p.y <= rowBottom) { >+ // Now we have determined that the cursor.Y is above the >+ // bottom of the current row of figures. Stop now, to >+ // prevent the next row from being searched >+ break; >+ } >+ } >+ } >+ } >+ return candidate; >+ } >+ >+ protected boolean isHorizontal() { >+ IFigure figure = ((GraphicalEditPart) getHost()).getContentPane(); >+ return ((FlowLayout) figure.getLayoutManager()).isHorizontal(); >+ } >+ >+ private Point getLocationFromRequest(Request request) { >+ return ((DropRequest) request).getLocation(); >+ } >+ >+ private Rectangle getAbsoluteBounds(GraphicalEditPart ep) { >+ Rectangle bounds = ep.getFigure().getBounds().getCopy(); >+ ep.getFigure().translateToAbsolute(bounds); >+ return bounds; >+ } >+} >Index: custom-src/org/eclipse/emf/ecoretools/diagram/edit/commands/CompartmentChildCreateCommand.java >=================================================================== >RCS file: custom-src/org/eclipse/emf/ecoretools/diagram/edit/commands/CompartmentChildCreateCommand.java >diff -N custom-src/org/eclipse/emf/ecoretools/diagram/edit/commands/CompartmentChildCreateCommand.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ custom-src/org/eclipse/emf/ecoretools/diagram/edit/commands/CompartmentChildCreateCommand.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,55 @@ >+/** >+ * Copyright (c) 2008, 2009 Anyware Technologies and others >+ * >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Anyware Technologies - initial API and implementation >+ */ >+package org.eclipse.emf.ecoretools.diagram.edit.commands; >+ >+import org.eclipse.core.commands.ExecutionException; >+import org.eclipse.core.runtime.Assert; >+import org.eclipse.core.runtime.IAdaptable; >+import org.eclipse.core.runtime.IProgressMonitor; >+import org.eclipse.emf.transaction.TransactionalEditingDomain; >+import org.eclipse.gmf.runtime.common.core.command.CommandResult; >+import org.eclipse.gmf.runtime.diagram.core.services.ViewService; >+import org.eclipse.gmf.runtime.diagram.ui.commands.CreateCommand; >+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor; >+import org.eclipse.gmf.runtime.notation.View; >+ >+/** >+ * Command used to add a child element at a specified position >+ * (it should be installed in a Compartment using a List layout). >+ * >+ * Creation : 28 mar. 2008 >+ * >+ * @author <a href="mailto:jacques.lescot@anyware-tech.com">Jacques LESCOT</a> >+ */ >+public class CompartmentChildCreateCommand extends CreateCommand { >+ >+ private int index; >+ >+ public CompartmentChildCreateCommand(TransactionalEditingDomain editingDomain, ViewDescriptor viewDescriptor, View containerView, int index) { >+ super(editingDomain, viewDescriptor, containerView); >+ this.index = index; >+ } >+ >+ /** >+ * @see org.eclipse.gmf.runtime.diagram.ui.commands.CreateCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) >+ */ >+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { >+ >+ View view = ViewService.getInstance().createView(viewDescriptor.getViewKind(), viewDescriptor.getElementAdapter(), containerView, viewDescriptor.getSemanticHint(), index, >+ viewDescriptor.isPersisted(), viewDescriptor.getPreferencesHint()); >+ Assert.isNotNull(view, "failed to create a view"); //$NON-NLS-1$ >+ viewDescriptor.setView(view); >+ >+ return CommandResult.newOKCommandResult(viewDescriptor); >+ } >+ >+} >Index: custom-src/org/eclipse/emf/ecoretools/diagram/edit/commands/CompartmentReorderEObjectCommand.java >=================================================================== >RCS file: custom-src/org/eclipse/emf/ecoretools/diagram/edit/commands/CompartmentReorderEObjectCommand.java >diff -N custom-src/org/eclipse/emf/ecoretools/diagram/edit/commands/CompartmentReorderEObjectCommand.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ custom-src/org/eclipse/emf/ecoretools/diagram/edit/commands/CompartmentReorderEObjectCommand.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,100 @@ >+/** >+ * Copyright (c) 2008, 2009 Anyware Technologies and others >+ * >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Anyware Technologies - initial API and implementation >+ */ >+package org.eclipse.emf.ecoretools.diagram.edit.commands; >+ >+import org.eclipse.core.commands.ExecutionException; >+import org.eclipse.core.runtime.IAdaptable; >+import org.eclipse.core.runtime.IProgressMonitor; >+import org.eclipse.emf.common.util.EList; >+import org.eclipse.emf.ecore.EObject; >+import org.eclipse.emf.transaction.TransactionalEditingDomain; >+import org.eclipse.gef.EditPart; >+import org.eclipse.gmf.runtime.common.core.command.CommandResult; >+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; >+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand; >+import org.eclipse.gmf.runtime.notation.View; >+ >+/** >+ * Command used to reorder an element both in the domain model and graphically >+ * (it should be installed in a Compartment using a List layout). >+ * >+ * Creation : 11 mar. 2008 >+ * >+ * @author <a href="mailto:jacques.lescot@anyware-tech.com">Jacques LESCOT</a> >+ */ >+public class CompartmentReorderEObjectCommand extends AbstractTransactionalCommand { >+ >+ // The child EditPart to move >+ EditPart childEditPart = null; >+ >+ // The EditPart that should be after the moved one when the command is done >+ EditPart afterEditPart = null; >+ >+ // The list of elements in which reposition will take place (domain model >+ // side). >+ private EList<EObject> elements; >+ >+ /** >+ * Constructs a runtime instance of >+ * <code>CompartmentReorderEObjectCommand</code>. >+ * >+ * @param editingDomain >+ * the editing domain through which model changes are made >+ * @param label >+ * label for command >+ * @param elements >+ * the list of elements in which reposition will take place >+ * @param childEditPart >+ * the child being moved >+ * @param afterEditPart >+ * <code>null</code> or the EditPart that should be after (or to >+ * the right of) the child being moved >+ */ >+ public CompartmentReorderEObjectCommand(TransactionalEditingDomain editingDomain, String label, EList<EObject> elements, EditPart childEditPart, EditPart afterEditPart) { >+ >+ super(editingDomain, label, getWorkspaceFiles(((View) childEditPart.getModel()).getElement())); >+ >+ this.elements = elements; >+ this.childEditPart = childEditPart; >+ this.afterEditPart = afterEditPart; >+ } >+ >+ /** >+ * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, >+ * org.eclipse.core.runtime.IAdaptable) >+ */ >+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException { >+ CommandResult commandResult = null; >+ try { >+ View movedView = (View) childEditPart.getModel(); >+ EObject movedElement = movedView.getElement(); >+ >+ View afterView = afterEditPart == null ? null : (View) afterEditPart.getModel(); >+ EObject afterElement = afterView == null ? null : afterView.getElement(); >+ >+ // 1. Reorder the movedElement in the domain model >+ int newSemanticPosition = afterElement == null ? elements.size() - 1 : elements.indexOf(afterElement) > elements.indexOf(movedElement) ? elements.indexOf(afterElement) - 1 : elements >+ .indexOf(afterElement); >+ elements.move(newSemanticPosition, movedElement); >+ >+ // 2. And then reorder the movedElement graphically >+ EList<?> views = ((View) movedView.eContainer()).getChildren(); >+ int newViewPosition = afterView == null ? views.size() - 1 : views.indexOf(afterView) > views.indexOf(movedView) ? views.indexOf(afterView) - 1 : views.indexOf(afterView); >+ ViewUtil.repositionChildAt((View) childEditPart.getParent().getModel(), (View) childEditPart.getModel(), newViewPosition); >+ >+ } catch (RuntimeException exp) { >+ commandResult = CommandResult.newErrorCommandResult(exp); >+ } >+ return (commandResult == null) ? CommandResult.newOKCommandResult() : commandResult; >+ } >+ >+} >Index: custom-src/org/eclipse/emf/ecoretools/diagram/edit/policies/ReorderingCompartmentEditPolicy.java >=================================================================== >RCS file: custom-src/org/eclipse/emf/ecoretools/diagram/edit/policies/ReorderingCompartmentEditPolicy.java >diff -N custom-src/org/eclipse/emf/ecoretools/diagram/edit/policies/ReorderingCompartmentEditPolicy.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ custom-src/org/eclipse/emf/ecoretools/diagram/edit/policies/ReorderingCompartmentEditPolicy.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,146 @@ >+/** >+ * Copyright (c) 2008, 2009 Anyware Technologies and others >+ * >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Anyware Technologies - initial API and implementation >+ */ >+package org.eclipse.emf.ecoretools.diagram.edit.policies; >+ >+import org.eclipse.emf.common.util.EList; >+import org.eclipse.emf.ecore.EObject; >+import org.eclipse.emf.ecore.EStructuralFeature; >+import org.eclipse.emf.ecoretools.diagram.edit.commands.CompartmentReorderEObjectCommand; >+import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry; >+import org.eclipse.emf.transaction.TransactionalEditingDomain; >+import org.eclipse.gef.EditPart; >+import org.eclipse.gef.EditPolicy; >+import org.eclipse.gef.Request; >+import org.eclipse.gef.commands.Command; >+import org.eclipse.gef.commands.UnexecutableCommand; >+import org.eclipse.gef.requests.CreateRequest; >+import org.eclipse.gmf.runtime.diagram.core.commands.AddCommand; >+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; >+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; >+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableEditPolicyEx; >+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants; >+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; >+import org.eclipse.gmf.runtime.notation.View; >+ >+/** >+ * A LayoutEditPolicy that could be used in addition with a FlowLayout to >+ * support child reordering >+ * >+ * Creation : 11 mar. 2008 >+ * >+ * @author <a href="mailto:jacques.lescot@anyware-tech.com">Jacques LESCOT</a> >+ */ >+public class ReorderingCompartmentEditPolicy extends org.eclipse.gef.editpolicies.FlowLayoutEditPolicy { >+ >+ // The domain model list that contains the element to reorder >+ private EStructuralFeature feature = null; >+ >+ /** >+ * @param feature >+ * The EStructutalFeature containing elements to reorder >+ */ >+ public ReorderingCompartmentEditPolicy(EStructuralFeature feature) { >+ super(); >+ this.feature = feature; >+ } >+ >+ /** >+ * @see org.eclipse.gef.editpolicies.OrderedLayoutEditPolicy#createAddCommand(org.eclipse.gef.EditPart, >+ * org.eclipse.gef.EditPart) >+ */ >+ protected Command createAddCommand(EditPart child, EditPart after) { >+ View viewToMove = (View) child.getModel(); >+ if (viewToMove != null) { >+ View newParentView = (View) getHost().getModel(); >+ if (newParentView != null) { >+ // We check if the move/add is possible at notational level >+ if (EcoreVisualIDRegistry.canCreateNode(newParentView, EcoreVisualIDRegistry.getVisualID(viewToMove.getType()))) { >+ int index = getHost().getChildren().indexOf(after); >+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain(); >+ AddCommand command = new AddCommand(editingDomain, new EObjectAdapter(newParentView), new EObjectAdapter(viewToMove), index); >+ return new ICommandProxy(command); >+ } >+ } >+ } >+ return UnexecutableCommand.INSTANCE; >+ >+ } >+ >+ /** >+ * @see org.eclipse.gef.editpolicies.OrderedLayoutEditPolicy#createChildEditPolicy(org.eclipse.gef.EditPart) >+ */ >+ protected EditPolicy createChildEditPolicy(EditPart child) { >+ ResizableEditPolicyEx policy = new ResizableEditPolicyEx(); >+ policy.setResizeDirections(0); >+ return policy; >+ } >+ >+ /** >+ * @see org.eclipse.gef.editpolicies.OrderedLayoutEditPolicy#createMoveChildCommand(org.eclipse.gef.EditPart, >+ * org.eclipse.gef.EditPart) >+ */ >+ protected Command createMoveChildCommand(EditPart child, EditPart after) { >+ int newIndex; >+ int moveOffset; >+ >+ int childIndex = getHost().getChildren().indexOf(child); >+ int afterIndex = getHost().getChildren().indexOf(after); >+ >+ if (afterIndex == -1) { >+ // Move the child to the last position >+ newIndex = getHost().getChildren().size() - 1; >+ moveOffset = newIndex - childIndex; >+ } else { >+ newIndex = afterIndex; >+ moveOffset = afterIndex - childIndex; >+ if (childIndex <= afterIndex) { >+ newIndex--; >+ moveOffset--; >+ } >+ } >+ >+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain(); >+ CompartmentReorderEObjectCommand command = new CompartmentReorderEObjectCommand(editingDomain, "", (EList<EObject>) ((View) child.getParent().getModel()).getElement().eGet(feature), child, >+ after); >+ >+ return new ICommandProxy(command); >+ } >+ >+ /** >+ * @see org.eclipse.gef.editpolicies.LayoutEditPolicy#getCreateCommand(org.eclipse.gef.requests.CreateRequest) >+ */ >+ protected Command getCreateCommand(CreateRequest request) { >+ return null; >+ } >+ >+ /** >+ * @see org.eclipse.gef.editpolicies.LayoutEditPolicy#getDeleteDependantCommand(org.eclipse.gef.Request) >+ */ >+ protected Command getDeleteDependantCommand(Request request) { >+ return null; >+ } >+ >+ /** >+ * @see org.eclipse.gef.editpolicies.LayoutEditPolicy#getOrphanChildrenCommand(org.eclipse.gef.Request) >+ */ >+ protected Command getOrphanChildrenCommand(Request request) { >+ return null; >+ } >+ >+ @Override >+ public void eraseTargetFeedback(Request request) { >+ // Need to handle case of REQ_DROP request's type to erase feedback >+ if (RequestConstants.REQ_DROP.equals(request.getType())) >+ eraseLayoutTargetFeedback(request); >+ super.eraseTargetFeedback(request); >+ } >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 224585
: 133333