Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrmah2006-08-25 17:32:37 +0000
committerrmah2006-08-25 17:32:37 +0000
commit430c64fd39de5e3063b295f202fb98d20b315eea (patch)
treec5f9d475aae38a0aef6490a8ec52886a641e368b /bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal
parent063ad089c518ef7eeddab21b3aa46a2e8f0644a6 (diff)
downloadwebtools.webservices-430c64fd39de5e3063b295f202fb98d20b315eea.tar.gz
webtools.webservices-430c64fd39de5e3063b295f202fb98d20b315eea.tar.xz
webtools.webservices-430c64fd39de5e3063b295f202fb98d20b315eea.zip
[155248] [wsdl editor] renaming a part sometimes causes a class cast exception
Diffstat (limited to 'bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal')
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/AbstractBoxtEditPart.java2
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/BaseEditPart.java4
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/EndPointEditPart.java4
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/OperationEditPart.java4
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/ParameterEditPart.java4
5 files changed, 11 insertions, 7 deletions
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/AbstractBoxtEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/AbstractBoxtEditPart.java
index f16dccbb3..964f38a04 100644
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/AbstractBoxtEditPart.java
+++ b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/AbstractBoxtEditPart.java
@@ -62,7 +62,7 @@ public abstract class AbstractBoxtEditPart extends BaseEditPart implements IName
private DirectEditManager manager;
public void performDirectEdit(Point cursorLocation){
- if (cursorLocation == null || hitTest(figure.getLabel(), cursorLocation) && !isReadOnly()) {
+ if (cursorLocation == null || hitTestFigure(figure.getHeadingFigure(), cursorLocation) && !isReadOnly()) {
manager = new LabelEditManager(this, new LabelCellEditorLocator(this, cursorLocation));
manager.show();
}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/BaseEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/BaseEditPart.java
index a39903fc2..2eaf4bbf1 100644
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/BaseEditPart.java
+++ b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/BaseEditPart.java
@@ -96,6 +96,10 @@ public abstract class BaseEditPart extends AbstractGraphicalEditPart implements
}
+ protected boolean hitTest(Rectangle rectangle, Point location) {
+ return rectangle.contains(location);
+ }
+
protected boolean hitTest(Label target, Point location) {
Rectangle origB = target.getTextBounds().getCopy();
Rectangle transB = target.getTextBounds().getCopy();
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/EndPointEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/EndPointEditPart.java
index cd49590c1..f86addbfe 100644
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/EndPointEditPart.java
+++ b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/EndPointEditPart.java
@@ -123,11 +123,11 @@ public class EndPointEditPart extends BaseEditPart implements IFeedbackHandler,
public void performDirectEdit(Point cursorLocation)
{
this.cursorLocation = cursorLocation;
- if (cursorLocation == null || hitTest(getLabelFigure(), cursorLocation) && !isReadOnly()) {
+ if (!isReadOnly() && (cursorLocation == null || hitTest(getLabelFigure(), cursorLocation))) {
manager = new LabelEditManager(this, new LabelCellEditorLocator(this, cursorLocation));
manager.show();
}
- else if (hitTest(getLabelFigure(), cursorLocation) && isReadOnly()) {
+ else if (hitTest(getFigure().getBounds(), cursorLocation) && isReadOnly()) {
doOpenNewEditor();
}
}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/OperationEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/OperationEditPart.java
index a6fb31132..22ae7f56c 100644
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/OperationEditPart.java
+++ b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/OperationEditPart.java
@@ -99,11 +99,11 @@ public class OperationEditPart extends BaseEditPart implements INamedEditPart
private DirectEditManager manager;
public void performDirectEdit(Point cursorLocation){
- if (cursorLocation == null || hitTest(label, cursorLocation) && !isReadOnly()) {
+ if (cursorLocation == null || hitTest(getFigure().getBounds(), cursorLocation) && !isReadOnly()) {
manager = new LabelEditManager(this, new LabelCellEditorLocator(this, cursorLocation));
manager.show();
}
- else if (hitTest(label, cursorLocation) && isReadOnly()) {
+ else if (hitTest(getFigure().getBounds(), cursorLocation) && isReadOnly()) {
doOpenNewEditor();
}
}
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/ParameterEditPart.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/ParameterEditPart.java
index 90fa15772..73edaef86 100644
--- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/ParameterEditPart.java
+++ b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/ParameterEditPart.java
@@ -133,11 +133,11 @@ public class ParameterEditPart extends BaseEditPart implements IFeedbackHandler,
private DirectEditManager manager;
public void performDirectEdit(Point cursorLocation){
- if (cursorLocation == null || hitTest(parameterName, cursorLocation) && !isReadOnly()) {
+ if (!isReadOnly() && (cursorLocation == null || hitTest(getFigure().getBounds(), cursorLocation))) {
manager = new LabelEditManager(this, new LabelCellEditorLocator(this, cursorLocation));
manager.show();
}
- else if (hitTest(parameterName, cursorLocation) && isReadOnly()) {
+ else if (hitTest(getFigure().getBounds(), cursorLocation) && isReadOnly()) {
doOpenNewEditor();
}
}

Back to the top