Dependency on Util removed. Implementation hidden.
diff --git a/bundles/runtime/org.eclipse.fx.emf.edit.ui/META-INF/MANIFEST.MF b/bundles/runtime/org.eclipse.fx.emf.edit.ui/META-INF/MANIFEST.MF
index 1b6f9e1..d834651 100755
--- a/bundles/runtime/org.eclipse.fx.emf.edit.ui/META-INF/MANIFEST.MF
+++ b/bundles/runtime/org.eclipse.fx.emf.edit.ui/META-INF/MANIFEST.MF
@@ -35,7 +35,6 @@
javafx.stage;version="2.2.0",
javafx.util;version="2.2.0",
javafx.util.converter;version="2.2.0"
-Require-Bundle: org.eclipse.emf.edit;bundle-version="2.7.0",
- org.eclipse.fx.core;bundle-version="0.8.1"
+Require-Bundle: org.eclipse.emf.edit;bundle-version="2.7.0"
Export-Package: org.eclipse.fx.emf.edit.ui,
org.eclipse.fx.emf.edit.ui.dnd
diff --git a/bundles/runtime/org.eclipse.fx.emf.edit.ui/src/org/eclipse/fx/emf/edit/ui/CellUtil.java b/bundles/runtime/org.eclipse.fx.emf.edit.ui/src/org/eclipse/fx/emf/edit/ui/CellUtil.java
index ca79a70..f532085 100644
--- a/bundles/runtime/org.eclipse.fx.emf.edit.ui/src/org/eclipse/fx/emf/edit/ui/CellUtil.java
+++ b/bundles/runtime/org.eclipse.fx.emf.edit.ui/src/org/eclipse/fx/emf/edit/ui/CellUtil.java
@@ -15,10 +15,13 @@
import javafx.scene.control.TreeTableView;
import javafx.scene.control.TreeView;
-import org.eclipse.fx.core.Util;
-
public class CellUtil {
-
+
+ /**
+ * Whether the JavaFX is version 2.x
+ */
+ private static final boolean FX2 = System.getProperty("javafx.version") != null && System.getProperty("javafx.version").startsWith("2");
+
/**
* Finds the row for a {@link Cell} so the feedback can be applied to the
* whole row
@@ -28,7 +31,7 @@
* {@link Cell} itself otherwise
*/
public static Cell<?> getRowNode(final Cell<?> cell) {
- return Util.isFX2() ? CellUtil2.getRowNode(cell) : CellUtil8.getRowNode(cell);
+ return FX2 ? CellUtil2.getRowNode(cell) : CellUtil8.getRowNode(cell);
}
/**
@@ -42,11 +45,11 @@
* @return the {@link MultipleSelectionModel} for this {@link Cell}
*/
public static MultipleSelectionModel<?> getSelectionModel(Cell<?> cell) {
- return Util.isFX2() ? CellUtil2.getSelectionModel(cell) : CellUtil8.getSelectionModel(cell);
+ return FX2 ? CellUtil2.getSelectionModel(cell) : CellUtil8.getSelectionModel(cell);
}
public static MultipleSelectionModel<?> getSelectionModel(Control view) {
- return Util.isFX2() ? CellUtil2.getSelectionModel(view) : CellUtil8.getSelectionModel(view);
+ return FX2 ? CellUtil2.getSelectionModel(view) : CellUtil8.getSelectionModel(view);
}
/**
@@ -61,7 +64,7 @@
* @return a {@link List} with the selected items
*/
public static List<?> getSelectedItems(Cell<?> cell) {
- return Util.isFX2() ? CellUtil2.getSelectedItems(cell) : CellUtil8.getSelectedItems(cell);
+ return FX2 ? CellUtil2.getSelectedItems(cell) : CellUtil8.getSelectedItems(cell);
}
}
diff --git a/bundles/runtime/org.eclipse.fx.emf.edit.ui/src/org/eclipse/fx/emf/edit/ui/CellUtil2.java b/bundles/runtime/org.eclipse.fx.emf.edit.ui/src/org/eclipse/fx/emf/edit/ui/CellUtil2.java
index fc1409a..9e2fd97 100644
--- a/bundles/runtime/org.eclipse.fx.emf.edit.ui/src/org/eclipse/fx/emf/edit/ui/CellUtil2.java
+++ b/bundles/runtime/org.eclipse.fx.emf.edit.ui/src/org/eclipse/fx/emf/edit/ui/CellUtil2.java
@@ -13,16 +13,16 @@
import javafx.scene.control.TreeItem;
import javafx.scene.control.TreeView;
-public class CellUtil2 {
+class CellUtil2 {
- public static Cell<?> getRowNode(final Cell<?> cell) {
+ static Cell<?> getRowNode(final Cell<?> cell) {
if (cell instanceof TableCell)
return ((TableCell<?, ?>) cell).getTableRow();
else
return cell;
}
- public static MultipleSelectionModel<?> getSelectionModel(Cell<?> cell) {
+ static MultipleSelectionModel<?> getSelectionModel(Cell<?> cell) {
if (cell instanceof ListCell)
return ((ListCell<?>) cell).getListView().getSelectionModel();
else if (cell instanceof TreeCell)
@@ -35,14 +35,14 @@
throw new IllegalArgumentException("Unsupported Cell type");
}
- public static MultipleSelectionModel<?> getSelectionModel(Control view) {
+ static MultipleSelectionModel<?> getSelectionModel(Control view) {
if (view instanceof TreeView<?>)
return ((TreeView<?>) view).getSelectionModel();
else
throw new IllegalArgumentException("Unsupported View type");
}
- public static List<?> getSelectedItems(Cell<?> cell) {
+ static List<?> getSelectedItems(Cell<?> cell) {
MultipleSelectionModel<?> selectionModel = getSelectionModel(cell);
List<?> items = selectionModel.getSelectedItems();
diff --git a/bundles/runtime/org.eclipse.fx.emf.edit.ui/src/org/eclipse/fx/emf/edit/ui/CellUtil8.java b/bundles/runtime/org.eclipse.fx.emf.edit.ui/src/org/eclipse/fx/emf/edit/ui/CellUtil8.java
index 0d1a5c0..f46366e 100644
--- a/bundles/runtime/org.eclipse.fx.emf.edit.ui/src/org/eclipse/fx/emf/edit/ui/CellUtil8.java
+++ b/bundles/runtime/org.eclipse.fx.emf.edit.ui/src/org/eclipse/fx/emf/edit/ui/CellUtil8.java
@@ -16,11 +16,9 @@
import javafx.scene.control.TreeTableView;
import javafx.scene.control.TreeView;
-import org.eclipse.fx.core.Util;
+class CellUtil8 {
-public class CellUtil8 {
-
- public static Cell<?> getRowNode(final Cell<?> cell) {
+ static Cell<?> getRowNode(final Cell<?> cell) {
if (cell instanceof TableCell)
return ((TableCell<?, ?>) cell).getTableRow();
else if (cell instanceof TreeTableCell)
@@ -29,7 +27,7 @@
return cell;
}
- public static MultipleSelectionModel<?> getSelectionModel(Cell<?> cell) {
+ static MultipleSelectionModel<?> getSelectionModel(Cell<?> cell) {
if (cell instanceof ListCell)
return ((ListCell<?>) cell).getListView().getSelectionModel();
else if (cell instanceof TreeCell)
@@ -48,10 +46,10 @@
throw new IllegalArgumentException("Unsupported Cell type");
}
- public static MultipleSelectionModel<?> getSelectionModel(Control view) {
+ static MultipleSelectionModel<?> getSelectionModel(Control view) {
if (view instanceof TreeView<?>)
return ((TreeView<?>) view).getSelectionModel();
- else if (Util.isFX2() && view instanceof TreeTableView<?>)
+ else if (view instanceof TreeTableView<?>)
return ((TreeTableView<?>) view).getSelectionModel();
else
throw new IllegalArgumentException("Unsupported View type");