Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrmah2006-08-09 22:10:30 +0000
committerrmah2006-08-09 22:10:30 +0000
commit92c6d98e79b602bb07041d59812c84cdcf88482c (patch)
tree0786b62223f96bd4ac36f200ecb2c7529e9fbd26
parent48fd277c0367529f3fe8dea444fb9acce2433709 (diff)
downloadwebtools.webservices-92c6d98e79b602bb07041d59812c84cdcf88482c.tar.gz
webtools.webservices-92c6d98e79b602bb07041d59812c84cdcf88482c.tar.xz
webtools.webservices-92c6d98e79b602bb07041d59812c84cdcf88482c.zip
[151428] [WSDL Editor] Hover information needed for cutoff text
-rw-r--r--bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/editparts/EndPointEditPart.java18
1 files changed, 18 insertions, 0 deletions
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 444dea40a..cd49590c1 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
@@ -50,6 +50,7 @@ public class EndPointEditPart extends BaseEditPart implements IFeedbackHandler,
{
protected Label nameLabel;
protected Label addressLabel;
+ private Label hoverHelpLabel = new Label("");
protected Figure addressBoxFigure;
protected ComponentReferenceConnection connectionFigure;
protected final static int MAX_ADDRESS_WIDTH = 150;
@@ -170,6 +171,23 @@ public class EndPointEditPart extends BaseEditPart implements IFeedbackHandler,
IEndPoint endPoint = (IEndPoint) getModel();
nameLabel.setText(endPoint.getName());
addressLabel.setText(endPoint.getAddress());
+
+ Rectangle textBounds = addressLabel.getTextBounds();
+ Rectangle bounds = addressLabel.getBounds();
+ int textPlacement = addressLabel.getTextPlacement();
+ int xDelta = textBounds.x - bounds.x;
+ int xTextIncrease = textPlacement - xDelta;
+ int textSize = textBounds.width + xTextIncrease;
+ int boundSize = bounds.width;
+
+ if (textSize > boundSize) {
+ hoverHelpLabel.setText(" " + endPoint.getAddress() + " ");
+ addressLabel.setToolTip(hoverHelpLabel);
+ }
+ else {
+ addressLabel.setToolTip(null);
+ }
+
refreshConnections();
super.refreshVisuals();
}

Back to the top