diff options
author | tsommer | 2013-05-04 11:45:49 +0000 |
---|---|---|
committer | tsommer | 2013-05-04 11:45:49 +0000 |
commit | 752727d9d59b7a695cec7b77b166a1646df12ca4 (patch) | |
tree | edb1c44e9738ecc78444a239b639cbd67b2d5d0b | |
parent | 4482ece9d20927193a460340d7ab643ee6982311 (diff) | |
download | org.eclipse.efxclipse-752727d9d59b7a695cec7b77b166a1646df12ca4.tar.gz org.eclipse.efxclipse-752727d9d59b7a695cec7b77b166a1646df12ca4.tar.xz org.eclipse.efxclipse-752727d9d59b7a695cec7b77b166a1646df12ca4.zip |
Dependency on Util removed. Implementation hidden.emf-edit
4 files changed, 21 insertions, 21 deletions
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 1b6f9e1f1..d8346512b 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 @@ Import-Package: javafx.animation;version="2.2.0", 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 ca79a7030..f53208508 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.TreeTableRow; 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 @@ public class CellUtil { * {@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 @@ public class CellUtil { * @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 @@ public class CellUtil { * @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 fc1409a83..9e2fd970b 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.TreeCell; 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 @@ public class CellUtil2 { 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 0d1a5c022..f46366ede 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.TreeTableRow; 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 @@ public class CellUtil8 { 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 @@ public class CellUtil8 { 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"); |