Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2017-01-24 20:49:14 +0000
committerTom Schindl2017-01-24 20:49:14 +0000
commita9e1b6ad31ae6dc53f49634fb04d7f76f10a49e8 (patch)
tree3c5c0eab4e8ab72017b02b9ed234460b81f46dcb
parent1d0ce8cf45e11263e7d1ba4231e923480e24d84a (diff)
downloadorg.eclipse.efxclipse-a9e1b6ad31ae6dc53f49634fb04d7f76f10a49e8.tar.gz
org.eclipse.efxclipse-a9e1b6ad31ae6dc53f49634fb04d7f76f10a49e8.tar.xz
org.eclipse.efxclipse-a9e1b6ad31ae6dc53f49634fb04d7f76f10a49e8.zip
Bug 510656 - Make e(fx)clipse applications run on Java9
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/tabpane/DndTabPaneFactory.java64
1 files changed, 38 insertions, 26 deletions
diff --git a/bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/tabpane/DndTabPaneFactory.java b/bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/tabpane/DndTabPaneFactory.java
index 5a5977b16..a61ae302c 100644
--- a/bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/tabpane/DndTabPaneFactory.java
+++ b/bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/tabpane/DndTabPaneFactory.java
@@ -13,6 +13,7 @@ package org.eclipse.fx.ui.controls.tabpane;
import java.util.function.Consumer;
import java.util.function.Function;
+import org.eclipse.fx.core.SystemUtils;
import org.eclipse.fx.ui.controls.dnd.EFXDragEvent;
import org.eclipse.fx.ui.controls.markers.PositionMarker;
import org.eclipse.fx.ui.controls.markers.TabOutlineMarker;
@@ -92,20 +93,25 @@ public final class DndTabPaneFactory {
* @return the tab pane
*/
public static TabPane createDndTabPane(Consumer<DragSetup> setup, boolean allowDetach) {
- return new TabPane() {
- @Override
- protected javafx.scene.control.Skin<?> createDefaultSkin() {
- if( allowDetach ) {
- DnDTabPaneSkinFullDrag skin = new DnDTabPaneSkinFullDrag(this);
- setup.accept(skin);
- return skin;
- } else {
- DnDTabPaneSkin skin = new DnDTabPaneSkin(this);
- setup.accept(skin);
- return skin;
+ //FIXME Create a Java8/9 replacement
+ if( SystemUtils.isFX9() ) {
+ return new TabPane();
+ } else {
+ return new TabPane() {
+ @Override
+ protected javafx.scene.control.Skin<?> createDefaultSkin() {
+ if( allowDetach ) {
+ DnDTabPaneSkinFullDrag skin = new DnDTabPaneSkinFullDrag(this);
+ setup.accept(skin);
+ return skin;
+ } else {
+ DnDTabPaneSkin skin = new DnDTabPaneSkin(this);
+ setup.accept(skin);
+ return skin;
+ }
}
- }
- };
+ };
+ }
}
/**
@@ -121,20 +127,26 @@ public final class DndTabPaneFactory {
*/
public static Pane createDefaultDnDPane(FeedbackType feedbackType, boolean allowDetach, Consumer<TabPane> setup) {
StackPane pane = new StackPane();
- TabPane tabPane = new TabPane() {
- @Override
- protected javafx.scene.control.Skin<?> createDefaultSkin() {
- if (allowDetach) {
- DnDTabPaneSkinFullDrag skin = new DnDTabPaneSkinFullDrag(this);
- setup(feedbackType, pane, skin, null);
- return skin;
- } else {
- DnDTabPaneSkin skin = new DnDTabPaneSkin(this);
- setup(feedbackType, pane, skin, null);
- return skin;
+ TabPane tabPane;
+ if( SystemUtils.isFX9() ) {
+ tabPane = new TabPane();
+ } else {
+ tabPane = new TabPane() {
+ @Override
+ protected javafx.scene.control.Skin<?> createDefaultSkin() {
+ if (allowDetach) {
+ DnDTabPaneSkinFullDrag skin = new DnDTabPaneSkinFullDrag(this);
+ setup(feedbackType, pane, skin, null);
+ return skin;
+ } else {
+ DnDTabPaneSkin skin = new DnDTabPaneSkin(this);
+ setup(feedbackType, pane, skin, null);
+ return skin;
+ }
}
- }
- };
+ };
+ }
+
setup.accept(tabPane);
pane.getChildren().add(tabPane);
return pane;

Back to the top