Author: Grid.Qian
Date: 2009-09-02 04:42:39 -0400 (Wed, 02 Sep 2009)
New Revision: 17411
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/editparts/BPELTrayCategoryEditPart.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/editparts/BPELTrayCategoryEntryEditPart.java
Log:
JBIDE-4633: forget to create a patch, so rollback and create a patch.
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/editparts/BPELTrayCategoryEditPart.java
===================================================================
---
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/editparts/BPELTrayCategoryEditPart.java 2009-09-02
06:05:51 UTC (rev 17410)
+++
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/editparts/BPELTrayCategoryEditPart.java 2009-09-02
08:42:39 UTC (rev 17411)
@@ -1,32 +1,18 @@
package org.eclipse.bpel.ui.editparts;
import org.eclipse.bpel.common.ui.tray.TrayCategoryEditPart;
+import org.eclipse.bpel.model.Scope;
import org.eclipse.bpel.ui.BPELEditor;
import org.eclipse.bpel.ui.editparts.policies.TrayContainerEditPolicy;
import org.eclipse.bpel.ui.util.ModelHelper;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gef.AccessibleEditPart;
import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.RootEditPart;
import org.eclipse.jface.viewers.StructuredSelection;
public abstract class BPELTrayCategoryEditPart extends TrayCategoryEditPart{
- // added by Grid.Qian
- // use the variable to hold the root of the editpart
- // because when we delete a correlationSets from scope
- // the editpart parent will be null
- private RootEditPart holdRoot;
-
- // added by Grid.Qian
- // use the variable to hold the parent's of the model
- // that will be a scope or a process
- // because when we delete a correlationSets from scope
- // the eContainer will be null
- private EObject eObj;
-
@Override
protected void createEditPolicies() {
super.createEditPolicies();
@@ -54,54 +40,13 @@
selectEditPart(getModelChildren().get(0));
} else {
// if we are executing this method we are dealing with scoped variables
-
- // delete the line by Grid.Qian because the econtainer maybe null
- // when the model is deleted from the scope
- // Scope scope = (Scope)((EObject)getModel()).eContainer();
- BPELEditor editor = ModelHelper.getBPELEditor(eObj);
- EditPart editPart =
(EditPart)editor.getGraphicalViewer().getEditPartRegistry().get(eObj);
+ Scope scope = (Scope)((EObject)getModel()).eContainer();
+ BPELEditor editor = ModelHelper.getBPELEditor(scope);
+ EditPart editPart =
(EditPart)editor.getGraphicalViewer().getEditPartRegistry().get(scope);
if (editPart != null) {
getViewer().setSelection(new StructuredSelection(editPart));
}
}
}
-
- /**
- * Overwrite the method by Grid.Qian to get the viewer
- * when the editpart's parent == null
- */
- public EditPartViewer getViewer() {
- try {
- return super.getViewer();
- } catch (Exception e) {
- return holdRoot.getViewer();
- }
- }
-
- /**
- * Overwrite the method by Grid.Qian
- * Hold the editpart's root editpart
- */
- public void setParent(EditPart parent) {
- if (this.getParent() == parent)
- return;
- if (parent != null) {
- holdRoot = parent.getRoot();
- }
- super.setParent(parent);
- }
-
-
- /**
- * Overwrite the method by Grid.Qian
- * Hold the scope or process that the model belong to
- */
- public void setModel(Object model) {
- if (getModel() == model)
- return;
- eObj = ((EObject) model).eContainer();
- super.setModel(model);
- }
-
}
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/editparts/BPELTrayCategoryEntryEditPart.java
===================================================================
---
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/editparts/BPELTrayCategoryEntryEditPart.java 2009-09-02
06:05:51 UTC (rev 17410)
+++
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/editparts/BPELTrayCategoryEntryEditPart.java 2009-09-02
08:42:39 UTC (rev 17411)
@@ -23,9 +23,7 @@
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gef.AccessibleEditPart;
import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.RootEditPart;
/**
* Tray category edit part.
@@ -40,12 +38,6 @@
protected MouseMotionListener mouseMotionListener;
- // added by Grid.Qian
- // use the variable to hold the root of the editpart
- // because when we delete a correlationSet from scope
- // the editpart parent will be null
- private RootEditPart holdRoot;
-
@Override
protected AccessibleEditPart createAccessible() {
return new BPELTrayAccessibleEditPart(this);
@@ -142,11 +134,7 @@
@Override
public void removeNotify() {
// we only do the following hack if we are dealing with scoped variables
-
- // when we delete a variable from scope, the variables parent will
- // be null, so we need to filter this
- EObject eObj = ((EObject) getParent().getModel()).eContainer();
- if (eObj != null && !(eObj instanceof Scope)) {
+ if (!(((EObject)getParent().getModel()).eContainer() instanceof Scope)) {
super.removeNotify();
return;
}
@@ -164,30 +152,4 @@
children.get(i).removeNotify();
unregister();
}
-
- /**
- * Overwrite the method by Grid.Qian to get the viewer
- * when the editpart's parent == null
- */
- public EditPartViewer getViewer() {
- try {
- return super.getViewer();
- } catch (Exception e) {
- return holdRoot.getViewer();
- }
-
- }
-
- /**
- * Overwrite the method by Grid.Qian
- * Hold the editpart's root editpart
- */
- public void setParent(EditPart parent) {
- if (this.getParent() == parent)
- return;
- if (parent != null) {
- holdRoot = parent.getRoot();
- }
- super.setParent(parent);
- }
}
Show replies by date