Bug 391523 - Revise getSelectionInfo...() in IToolBehaviorProvider
* use color from ISelectionInfo also for shapes
Change-Id: I0a2896d8808143df2259bde481828476d511d77a
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/util/draw2d/GFSurroundingHandle.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/util/draw2d/GFSurroundingHandle.java
index b14bcb0..f332509 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/util/draw2d/GFSurroundingHandle.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/util/draw2d/GFSurroundingHandle.java
@@ -31,6 +31,7 @@
import org.eclipse.graphiti.ui.internal.config.IConfigurationProviderInternal;
import org.eclipse.graphiti.ui.internal.figures.GFFigureUtil;
import org.eclipse.graphiti.ui.internal.util.DataTypeTransformation;
+import org.eclipse.graphiti.util.IColorConstant;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
@@ -66,6 +67,13 @@
* @return the fG_COLOR_RESIZABLE
*/
public Color getFG_COLOR() {
+ if (shapeSelectionInfo != null) {
+ IColorConstant color = shapeSelectionInfo.getColor();
+ if (color != null) {
+ Color swtColor = DataTypeTransformation.toSwtColor(configurationProvider.getResourceRegistry(), color);
+ return swtColor;
+ }
+ }
if (FG_COLOR == null || FG_COLOR.isDisposed())
FG_COLOR = configurationProvider.getResourceRegistry().getSwtColor("ff850f"); //$NON-NLS-1$
return FG_COLOR;