Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2013-07-23 13:35:18 -0400
committerTom Schindl2013-07-23 13:35:18 -0400
commit87910110e44c3dd7a1fef74a02545054b10cb28f (patch)
tree77942554ffef8693bf54bd86b6bc3a91a6da1a11
parentef4c55e1a0473241b318ee50cd6b60664981ff4e (diff)
downloadorg.eclipse.efxclipse-87910110e44c3dd7a1fef74a02545054b10cb28f.tar.gz
org.eclipse.efxclipse-87910110e44c3dd7a1fef74a02545054b10cb28f.tar.xz
org.eclipse.efxclipse-87910110e44c3dd7a1fef74a02545054b10cb28f.zip
Bug 413558 - [e4] Allow a trimbar element to fill the space
-rwxr-xr-xbundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BaseTrimBarRenderer.java3
-rwxr-xr-xbundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/src/org/eclipse/fx/ui/workbench/renderers/fx/DefTrimBarRenderer.java7
-rwxr-xr-xtestcases/org.eclipse.fx.testcases.e4/Application.e4xmi1
3 files changed, 10 insertions, 1 deletions
diff --git a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BaseTrimBarRenderer.java b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BaseTrimBarRenderer.java
index 014376161..977923913 100755
--- a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BaseTrimBarRenderer.java
+++ b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BaseTrimBarRenderer.java
@@ -26,7 +26,8 @@ import org.eclipse.fx.ui.workbench.renderers.base.widget.WTrimBar;
public abstract class BaseTrimBarRenderer<N> extends BaseRenderer<MTrimBar, WTrimBar<N>> implements ChildrenHandler<MTrimBar, MTrimElement> {
-
+ public static final String TAG_FILLSPACE = "fillspace";
+
@PostConstruct
void init(IEventBroker eventBroker) {
EventProcessor.attachChildProcessor(eventBroker, this);
diff --git a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/src/org/eclipse/fx/ui/workbench/renderers/fx/DefTrimBarRenderer.java b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/src/org/eclipse/fx/ui/workbench/renderers/fx/DefTrimBarRenderer.java
index fb58c1129..5eca4aa7a 100755
--- a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/src/org/eclipse/fx/ui/workbench/renderers/fx/DefTrimBarRenderer.java
+++ b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/src/org/eclipse/fx/ui/workbench/renderers/fx/DefTrimBarRenderer.java
@@ -12,6 +12,7 @@ package org.eclipse.fx.ui.workbench.renderers.fx;
import javafx.scene.Node;
import javafx.scene.layout.HBox;
+import javafx.scene.layout.Priority;
import org.eclipse.e4.ui.model.application.ui.basic.MTrimBar;
import org.eclipse.e4.ui.model.application.ui.basic.MTrimElement;
@@ -44,12 +45,18 @@ public class DefTrimBarRenderer extends BaseTrimBarRenderer<HBox> {
@Override
public void addChild(WLayoutedWidget<MTrimElement> trimElementWidget) {
Node n = (Node) trimElementWidget.getStaticLayoutNode();
+ if( trimElementWidget.getDomElement().getTags().contains(TAG_FILLSPACE) ) {
+ HBox.setHgrow(n, Priority.ALWAYS);
+ }
getWidget().getChildren().add(n);
}
@Override
public void addChild(int idx, WLayoutedWidget<MTrimElement> trimElementWidget) {
Node n = (Node) trimElementWidget.getStaticLayoutNode();
+ if( trimElementWidget.getDomElement().getTags().contains(TAG_FILLSPACE) ) {
+ HBox.setHgrow(n, Priority.ALWAYS);
+ }
getWidget().getChildren().add(idx, n);
}
diff --git a/testcases/org.eclipse.fx.testcases.e4/Application.e4xmi b/testcases/org.eclipse.fx.testcases.e4/Application.e4xmi
index b2ad005d1..02d6b1a7a 100755
--- a/testcases/org.eclipse.fx.testcases.e4/Application.e4xmi
+++ b/testcases/org.eclipse.fx.testcases.e4/Application.e4xmi
@@ -159,6 +159,7 @@
<children xsi:type="menu:ToolControl" xmi:id="_MfBjgNZYEeKlJ9ZUcG3l2Q" elementId="org.eclipse.fx.testcases.e4.toolcontrol.1" contributionURI="bundleclass://org.eclipse.fx.testcases.e4/org.eclipse.fx.testcases.e4.tool.ToolControlSample"/>
</children>
<children xsi:type="menu:ToolBar" xmi:id="_kDT7AOZXEeGrz8mV_3Gr5A" elementId="org.eclipse.fx.testcases.e4.toolbar.1">
+ <tags>fillspace</tags>
<children xsi:type="menu:DirectToolItem" xmi:id="_lavA8OZXEeGrz8mV_3Gr5A" elementId="org.eclipse.fx.testcases.e4.directtoolitem.0" label="Push - DI 0" contributionURI="bundleclass://org.eclipse.fx.testcases.e4/org.eclipse.fx.testcases.e4.handlers.DiHandler"/>
<children xsi:type="menu:DirectToolItem" xmi:id="_okY5gOZXEeGrz8mV_3Gr5A" elementId="org.eclipse.fx.testcases.e4.directtoolitem.1" label="Check - DI 1" type="Check" contributionURI="bundleclass://org.eclipse.fx.testcases.e4/org.eclipse.fx.testcases.e4.handlers.DiHandler"/>
<children xsi:type="menu:DirectToolItem" xmi:id="_s6sycOZXEeGrz8mV_3Gr5A" elementId="org.eclipse.fx.testcases.e4.directtoolitem.2" label="Radio - DI 2" type="Radio" contributionURI="bundleclass://org.eclipse.fx.testcases.e4/org.eclipse.fx.testcases.e4.handlers.DiHandler"/>

Back to the top