Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2011-03-23 22:33:45 +0000
committerHenrik Rentz-Reichert2011-03-23 22:33:45 +0000
commit24b577992be7f8ee7cf65696c7ea2e2531ed564e (patch)
tree84d81639ef4c440d0b4bb14c39faa28123142948 /plugins/org.eclipse.etrice.ui.structure
parent18a166fb95a52f86df1d8b80fd7b9d593b827f9b (diff)
parentf0ea97c2f7f29a00a1e5f0848e8cb64060938d5e (diff)
downloadorg.eclipse.etrice-24b577992be7f8ee7cf65696c7ea2e2531ed564e.tar.gz
org.eclipse.etrice-24b577992be7f8ee7cf65696c7ea2e2531ed564e.tar.xz
org.eclipse.etrice-24b577992be7f8ee7cf65696c7ea2e2531ed564e.zip
Merge branch 'refs/heads/before_indigo' of https://git.eclipse.org/gitroot/etrice/org.eclipse.etrice.git into HEAD
Diffstat (limited to 'plugins/org.eclipse.etrice.ui.structure')
-rw-r--r--plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/ProviderDispatcher.java9
-rw-r--r--plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/ActorContainerRefSupport.java30
-rw-r--r--plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/InterfaceItemSupport.java18
3 files changed, 39 insertions, 18 deletions
diff --git a/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/ProviderDispatcher.java b/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/ProviderDispatcher.java
index 869ff0e24..83d4a72a3 100644
--- a/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/ProviderDispatcher.java
+++ b/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/ProviderDispatcher.java
@@ -353,6 +353,15 @@ public class ProviderDispatcher {
else
return bp.getContextButtonPad(context);
}
+
+ @Override
+ public String getToolTip(GraphicsAlgorithm context) {
+ IToolBehaviorProvider bp = getToolBehaviorProvider(context.getPictogramElement());
+ if (bp==null)
+ return super.getToolTip(context);
+ else
+ return bp.getToolTip(context);
+ }
public ISelectionInfo getSelectionInfoForShape(Shape shape) {
ISelectionInfo si = new SelectionInfoImpl(IColorConstant.SHAPE_SELECTION_FG, IColorConstant.HANDLE_FG, IColorConstant.HANDLE_BG,
diff --git a/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/ActorContainerRefSupport.java b/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/ActorContainerRefSupport.java
index d7c9d67d3..960144169 100644
--- a/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/ActorContainerRefSupport.java
+++ b/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/ActorContainerRefSupport.java
@@ -387,24 +387,7 @@ public class ActorContainerRefSupport {
if (dlg.open()!=Window.OK)
throw new RuntimeException();
- updateFigure(acr, context);
- }
-
- private void updateFigure(ActorContainerRef acr, ICustomContext context) {
- PictogramElement pe = context.getPictogramElements()[0];
- ContainerShape container = (ContainerShape)pe;
-
- // we clear the figure and rebuild it
-// GraphicsAlgorithm invisibleRect = pe.getGraphicsAlgorithm();
-// invisibleRect.getGraphicsAlgorithmChildren().clear();
-
-// createPortFigure(acr, false, container, invisibleRect, manageColor(DARK_COLOR), manageColor(BRIGHT_COLOR));
-
- GraphicsAlgorithm ga = container.getChildren().get(1).getGraphicsAlgorithm();
- if (ga instanceof Text) {
- ((Text)ga).setValue(acr.getName());
- }
-
+ updateLabel(acr, context.getPictogramElements()[0]);
}
}
@@ -620,6 +603,8 @@ public class ActorContainerRefSupport {
}
}
+ updateLabel(acr, context.getPictogramElement());
+
InterfaceItemSupport.createRefItems(acr, containerShape, fp);
return true;
@@ -839,6 +824,15 @@ public class ActorContainerRefSupport {
hint = borderRect.getGraphicsAlgorithmChildren().get(1);
hint.setLineVisible(hasSubStructure);
}
+
+ private static void updateLabel(ActorContainerRef acr, PictogramElement pe) {
+ ContainerShape container = (ContainerShape)pe;
+
+ GraphicsAlgorithm ga = container.getChildren().get(0).getGraphicsAlgorithm();
+ if (ga instanceof Text) {
+ ((Text)ga).setValue(RoomNameProvider.getRefLabelName(acr));
+ }
+ }
}
private class BehaviorProvider extends DefaultToolBehaviorProvider {
diff --git a/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/InterfaceItemSupport.java b/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/InterfaceItemSupport.java
index c99335a97..7b7b1417d 100644
--- a/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/InterfaceItemSupport.java
+++ b/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/support/InterfaceItemSupport.java
@@ -675,6 +675,24 @@ public class InterfaceItemSupport {
invisible.getGraphicsAlgorithmChildren().get(0);
return rectangle;
}
+
+ @Override
+ public String getToolTip(GraphicsAlgorithm ga) {
+ // if this is called we know there is a business object!=null
+ PictogramElement pe = ga.getPictogramElement();
+
+ EObject bo = Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pe);
+ if (bo instanceof InterfaceItem) {
+ String name = ((InterfaceItem) bo).getName();
+ String protocol = ((InterfaceItem) bo).getProtocol().getName();
+ if (bo instanceof Port)
+ if (((Port) bo).isConjugated())
+ protocol = "conj "+protocol;
+
+ return name+"\n("+protocol+")";
+ }
+ return super.getToolTip(ga);
+ }
}
public static void createRefItems(ActorContainerRef acr, ContainerShape refShape, IFeatureProvider featureProvider) {

Back to the top