Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2015-11-25 23:14:53 +0000
committerTom Schindl2015-11-25 23:14:53 +0000
commitc6eb653d23b0e2a2849344210ae279ea0d8a82c7 (patch)
treeb9fc7a46151a762c87930b196ebed641c74b3452
parentc2772d97316799612745981005f867fd1b5e3b9b (diff)
parentce64c49e1fdf5240e219440cfabcb08678beefd2 (diff)
downloadorg.eclipse.efxclipse-c6eb653d23b0e2a2849344210ae279ea0d8a82c7.tar.gz
org.eclipse.efxclipse-c6eb653d23b0e2a2849344210ae279ea0d8a82c7.tar.xz
org.eclipse.efxclipse-c6eb653d23b0e2a2849344210ae279ea0d8a82c7.zip
Merge branch 'master' of ssh://tschindl@git.eclipse.org:29418/efxclipse/org.eclipse.efxclipse
-rwxr-xr-xbundles/runtime/org.eclipse.fx.emf.edit.ui/META-INF/MANIFEST.MF3
-rw-r--r--bundles/runtime/org.eclipse.fx.emf.edit.ui/src/org/eclipse/fx/emf/edit/ui/AdapterFactoryCellFactory.java34
-rw-r--r--bundles/runtime/org.eclipse.fx.emf.edit.ui/src/org/eclipse/fx/emf/edit/ui/AdapterFactoryCheckBoxListCellFactory.java150
-rw-r--r--bundles/runtime/org.eclipse.fx.emf.edit.ui/src/org/eclipse/fx/emf/edit/ui/AdapterFactoryCheckBoxTreeCellFactory.java146
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/tree/CheckedTreeItemCollector.java126
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/tree/FilterableTreeItem.java7
-rwxr-xr-xdemos/org.eclipse.fx.demo.contacts.app/contacts.product15
-rw-r--r--demos/org.eclipse.fx.demo.contacts.app/contacts.product.launch4
-rw-r--r--demos/org.eclipse.fx.demo.contacts.app/contacts_workspace.product.launch6
-rwxr-xr-xdemos/org.eclipse.fx.demo.contacts.app/plugin.xml8
10 files changed, 476 insertions, 23 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 85319f886..61ea33b10 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
@@ -9,4 +9,5 @@ Require-Bundle: org.eclipse.emf.edit;bundle-version="2.7.0",
Export-Package: org.eclipse.fx.emf.edit.ui;version="2.2.0",
org.eclipse.fx.emf.edit.ui.dnd;version="2.2.0"
Bundle-Vendor: Eclipse.org
-Import-Package: org.eclipse.fx.ui.controls.tree;version="2.2.0"
+Import-Package: org.eclipse.fx.core;version="2.2.0",
+ org.eclipse.fx.ui.controls.tree;version="2.2.0"
diff --git a/bundles/runtime/org.eclipse.fx.emf.edit.ui/src/org/eclipse/fx/emf/edit/ui/AdapterFactoryCellFactory.java b/bundles/runtime/org.eclipse.fx.emf.edit.ui/src/org/eclipse/fx/emf/edit/ui/AdapterFactoryCellFactory.java
index 214554c4b..f0379d914 100644
--- a/bundles/runtime/org.eclipse.fx.emf.edit.ui/src/org/eclipse/fx/emf/edit/ui/AdapterFactoryCellFactory.java
+++ b/bundles/runtime/org.eclipse.fx.emf.edit.ui/src/org/eclipse/fx/emf/edit/ui/AdapterFactoryCellFactory.java
@@ -14,17 +14,6 @@ import java.net.URL;
import java.util.ArrayList;
import java.util.List;
-import javafx.beans.property.ObjectProperty;
-import javafx.css.StyleableProperty;
-import javafx.scene.Node;
-import javafx.scene.control.Cell;
-import javafx.scene.image.ImageView;
-import javafx.scene.layout.Pane;
-import javafx.scene.paint.Color;
-import javafx.scene.text.Font;
-import javafx.scene.text.FontPosture;
-import javafx.scene.text.FontWeight;
-
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.edit.provider.ComposedImage;
@@ -34,9 +23,26 @@ import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.ITableItemColorProvider;
import org.eclipse.emf.edit.provider.ITableItemFontProvider;
import org.eclipse.emf.edit.provider.ITableItemLabelProvider;
+import org.eclipse.fx.core.ReflectionUtil;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
+import javafx.beans.property.ObjectProperty;
+import javafx.css.StyleableProperty;
+import javafx.scene.Node;
+import javafx.scene.control.Cell;
+import javafx.scene.control.CheckBox;
+import javafx.scene.control.cell.CheckBoxListCell;
+import javafx.scene.control.cell.CheckBoxTableCell;
+import javafx.scene.control.cell.CheckBoxTreeCell;
+import javafx.scene.control.cell.CheckBoxTreeTableCell;
+import javafx.scene.image.ImageView;
+import javafx.scene.layout.Pane;
+import javafx.scene.paint.Color;
+import javafx.scene.text.Font;
+import javafx.scene.text.FontPosture;
+import javafx.scene.text.FontWeight;
+
/**
* Base class for the AdapterFactoryCellFactories
*/
@@ -296,6 +302,12 @@ public abstract class AdapterFactoryCellFactory {
Node graphic = graphicFromObject(labelProvider.getImage(item));
if (graphic == null) {
resetPropertyState(cell, cell.graphicProperty(), null);
+ } else if (cell instanceof CheckBoxTreeCell<?>
+ || cell instanceof CheckBoxTreeTableCell<?, ?>
+ || cell instanceof CheckBoxListCell<?>
+ || cell instanceof CheckBoxTableCell<?, ?>) {
+ Object value = ReflectionUtil.getFieldValue(cell, "checkBox"); //$NON-NLS-1$
+ ((CheckBox)value).setGraphic(graphic);
} else {
cell.setGraphic(graphic);
}
diff --git a/bundles/runtime/org.eclipse.fx.emf.edit.ui/src/org/eclipse/fx/emf/edit/ui/AdapterFactoryCheckBoxListCellFactory.java b/bundles/runtime/org.eclipse.fx.emf.edit.ui/src/org/eclipse/fx/emf/edit/ui/AdapterFactoryCheckBoxListCellFactory.java
new file mode 100644
index 000000000..d0f3575fb
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.emf.edit.ui/src/org/eclipse/fx/emf/edit/ui/AdapterFactoryCheckBoxListCellFactory.java
@@ -0,0 +1,150 @@
+/*******************************************************************************
+ * Copyright (c) 2015 EM-SOFTWARE and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christoph Keimel <c.keimel@emsw.de> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.fx.emf.edit.ui;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.common.notify.impl.AdapterImpl;
+import org.eclipse.emf.edit.provider.IItemColorProvider;
+import org.eclipse.emf.edit.provider.IItemFontProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.jdt.annotation.NonNull;
+
+import javafx.application.Platform;
+import javafx.beans.value.ObservableValue;
+import javafx.scene.Node;
+import javafx.scene.control.Cell;
+import javafx.scene.control.ListCell;
+import javafx.scene.control.ListView;
+import javafx.scene.control.cell.CheckBoxListCell;
+import javafx.util.Callback;
+
+/**
+ * This list cell factory wraps an {@link AdapterFactory} and delegates calls to its {@link CheckBoxListCell}s to the
+ * corresponding adapter-implemented item provider interfaces.
+ *
+ * <ul>
+ * <li>{@link Cell#setText(String)} and {@link Cell#setGraphic(Node)} are delegated to
+ * {@link IItemLabelProvider}</li>
+ * <li>{@link Cell#setTextFill(javafx.scene.paint.Paint)} and the CSS property
+ * <code>-fx-background-color</code> are delegated to {@link IItemColorProvider}</li>
+ * <li>
+ * {@link Cell#setFont(javafx.scene.text.Font)} is delegated to {@link IItemFontProvider}</li>
+ * </ul>
+ *
+ * @param <T> The type of the item contained within the {@link ListView} value
+ */
+public class AdapterFactoryCheckBoxListCellFactory<T> extends AdapterFactoryCellFactory implements Callback<@NonNull ListView<T>, @NonNull ListCell<T>> {
+
+ private Callback<T, ObservableValue<Boolean>> getSelectedProperty;
+
+ /**
+ * Create a new adapter factory for list cells
+ *
+ * @param adapterFactory
+ * the adapter factory
+ * @param getSelectedProperty
+ * A {@link Callback} that will return an
+ * {@code ObservableValue<Boolean>} given an item from the
+ * ListView
+ *
+ */
+ public AdapterFactoryCheckBoxListCellFactory(@NonNull AdapterFactory adapterFactory, Callback<T, ObservableValue<Boolean>> getSelectedProperty) {
+ super(adapterFactory);
+ this.getSelectedProperty = getSelectedProperty;
+ }
+
+ @Override
+ public ListCell<T> call(@NonNull ListView<T> param) {
+
+ final CheckBoxListCell<T> listCell = new CheckBoxListCell<T>(this.getSelectedProperty) {
+
+ Object currentItem = null;
+ ICellEditHandler cellEditHandler;
+
+ AdapterImpl adapter = new AdapterImpl() {
+ @Override
+ public void notifyChanged(Notification msg) {
+ update(msg.getNotifier());
+ }
+ };
+
+ @Override
+ public void updateItem(T item, boolean empty) {
+ super.updateItem(item, empty);
+
+ // check if the item changed
+ if (item != this.currentItem) {
+
+ // remove the adapter if attached
+ if (this.currentItem instanceof Notifier)
+ ((Notifier) this.currentItem).eAdapters().remove(this.adapter);
+
+ // update the current item
+ this.currentItem = item;
+
+ // attach the adapter to the new item
+ if (this.currentItem instanceof Notifier)
+ ((Notifier) this.currentItem).eAdapters().add(this.adapter);
+ }
+
+ // notify the listeners
+ for (ICellUpdateListener cellUpdateListener : AdapterFactoryCheckBoxListCellFactory.this.cellUpdateListeners)
+ cellUpdateListener.updateItem(this, item, empty);
+
+ update(item);
+ }
+
+ @Override
+ public void startEdit() {
+ super.startEdit();
+ this.cellEditHandler = getCellEditHandler(this);
+ if (this.cellEditHandler != null)
+ this.cellEditHandler.startEdit(this);
+ }
+
+ @Override
+ public void commitEdit(T newValue) {
+ super.commitEdit(newValue);
+ if (this.cellEditHandler != null)
+ this.cellEditHandler.commitEdit(this, newValue);
+ }
+
+ @Override
+ public void cancelEdit() {
+ super.cancelEdit();
+ if (this.cellEditHandler != null)
+ this.cellEditHandler.cancelEdit(this);
+ update(getItem());
+ }
+
+ void update(Object item) {
+ if (Platform.isFxApplicationThread()) {
+ updateOnFxThread(item);
+ } else {
+ Platform.runLater(() -> updateOnFxThread(item));
+ }
+ }
+
+ private void updateOnFxThread(Object item) {
+ applyItemProviderStyle(item, this, AdapterFactoryCheckBoxListCellFactory.this.adapterFactory);
+ }
+
+ };
+
+ for (ICellCreationListener cellCreationListener : this.cellCreationListeners)
+ cellCreationListener.cellCreated(listCell);
+
+ return listCell;
+ }
+
+}
diff --git a/bundles/runtime/org.eclipse.fx.emf.edit.ui/src/org/eclipse/fx/emf/edit/ui/AdapterFactoryCheckBoxTreeCellFactory.java b/bundles/runtime/org.eclipse.fx.emf.edit.ui/src/org/eclipse/fx/emf/edit/ui/AdapterFactoryCheckBoxTreeCellFactory.java
new file mode 100644
index 000000000..1de86ca89
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.emf.edit.ui/src/org/eclipse/fx/emf/edit/ui/AdapterFactoryCheckBoxTreeCellFactory.java
@@ -0,0 +1,146 @@
+/*******************************************************************************
+ * Copyright (c) 2015 EM-SOFTWARE and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christoph Keimel <c.keimel@emsw.de> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.fx.emf.edit.ui;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.common.notify.impl.AdapterImpl;
+import org.eclipse.emf.edit.provider.IItemColorProvider;
+import org.eclipse.emf.edit.provider.IItemFontProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.jdt.annotation.NonNull;
+
+import javafx.application.Platform;
+import javafx.scene.Node;
+import javafx.scene.control.Cell;
+import javafx.scene.control.TreeCell;
+import javafx.scene.control.TreeItem;
+import javafx.scene.control.TreeView;
+import javafx.scene.control.cell.CheckBoxTreeCell;
+import javafx.util.Callback;
+
+/**
+ * This {@link CheckBoxTreeCell} factory wraps an {@link AdapterFactory} and delegates calls to its {@link TreeCell}s
+ * to the corresponding adapter-implemented item provider interfaces.
+ *
+ * <ul>
+ * <li>{@link Cell#setText(String)} and {@link Cell#setGraphic(Node)} are delegated to
+ * {@link IItemLabelProvider}</li>
+ * <li>{@link Cell#setTextFill(javafx.scene.paint.Paint)} and the CSS property
+ * <code>-fx-background-color</code> are delegated to {@link IItemColorProvider}</li>
+ * <li>{@link Cell#setFont(javafx.scene.text.Font)} is delegated to {@link IItemFontProvider}</li>
+ * </ul>
+ *
+ * @param <T> The type of the item contained within the {@link TreeItem} value
+ */
+public class AdapterFactoryCheckBoxTreeCellFactory<T> extends AdapterFactoryCellFactory implements Callback<TreeView<T>, TreeCell<T>> {
+
+ /**
+ * Create a new tree factory
+ *
+ * @param adapterFactory
+ * the adapter factory
+ */
+ public AdapterFactoryCheckBoxTreeCellFactory(@NonNull AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ @Override
+ public TreeCell<T> call(TreeView<T> param) {
+
+ final CheckBoxTreeCell<T> treeCell = new CheckBoxTreeCell<T>() {
+
+ Object currentItem = null;
+ ICellEditHandler cellEditHandler;
+
+ AdapterImpl adapter = new AdapterImpl() {
+ @Override
+ public void notifyChanged(Notification msg) {
+ update(msg.getNotifier());
+ }
+ };
+
+ @Override
+ public void startEdit() {
+ super.startEdit();
+ this.cellEditHandler = getCellEditHandler(this);
+ if (this.cellEditHandler != null)
+ this.cellEditHandler.startEdit(this);
+ }
+
+ @Override
+ public void commitEdit(T newValue) {
+ super.commitEdit(newValue);
+ if (this.cellEditHandler != null)
+ this.cellEditHandler.commitEdit(this, newValue);
+ }
+
+ @Override
+ public void cancelEdit() {
+ super.cancelEdit();
+ if (this.cellEditHandler != null)
+ this.cellEditHandler.cancelEdit(this);
+ update(getItem());
+ }
+
+ @Override
+ public void updateItem(T item, boolean empty) {
+ super.updateItem(item, empty);
+
+ // check if the item changed
+ if (item != this.currentItem) {
+
+ // remove the adapter if attached
+ if (this.currentItem instanceof Notifier)
+ ((Notifier) this.currentItem).eAdapters().remove(this.adapter);
+
+ // update the current item
+ this.currentItem = item;
+
+ // attach the adapter to the new item
+ if (this.currentItem instanceof Notifier)
+ ((Notifier) this.currentItem).eAdapters().add(this.adapter);
+ }
+
+ // notify the listeners
+ for (ICellUpdateListener cellUpdateListener : AdapterFactoryCheckBoxTreeCellFactory.this.cellUpdateListeners)
+ cellUpdateListener.updateItem(this, item, empty);
+
+ update(item);
+ }
+
+ void update(Object item) {
+ if (Platform.isFxApplicationThread()) {
+ updateOnFxThread(item);
+ } else {
+ Platform.runLater(() -> updateOnFxThread(item));
+ }
+ }
+
+ private void updateOnFxThread(Object item) {
+ if (item != null)
+ applyItemProviderStyle(item, this, AdapterFactoryCheckBoxTreeCellFactory.this.adapterFactory);
+ else {
+ setText(null);
+ setGraphic(null);
+ }
+ }
+
+ };
+
+ for (ICellCreationListener cellCreationListener : this.cellCreationListeners)
+ cellCreationListener.cellCreated(treeCell);
+
+ return treeCell;
+ }
+
+}
diff --git a/bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/tree/CheckedTreeItemCollector.java b/bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/tree/CheckedTreeItemCollector.java
new file mode 100644
index 000000000..fd14242b7
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/tree/CheckedTreeItemCollector.java
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2015 EM-SOFTWARE and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christoph Keimel <c.keimel@emsw.de> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.fx.ui.controls.tree;
+
+import java.util.HashSet;
+
+import javafx.application.Platform;
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableSet;
+import javafx.collections.SetChangeListener;
+import javafx.scene.control.CheckBoxTreeItem;
+import javafx.scene.control.CheckBoxTreeItem.TreeModificationEvent;
+import javafx.scene.control.TreeItem;
+
+/**
+ * This class provides the possibility to collect all the values of "checked"
+ * tree items of any root {@link CheckBoxTreeItem}. This collection is presented
+ * as a flat {@link ObservableSet}.
+ *
+ * The "checked" state of a tree item can be modified, by adding or removing its
+ * value from {@link #getCheckedItems()}.
+ *
+ * @param <T>
+ * The type of the {@link TreeItem#getValue() value} property within
+ * {@link TreeItem}.
+ */
+public class CheckedTreeItemCollector<T> {
+
+ private ObservableSet<T> checkedItems = FXCollections.observableSet(new HashSet<>());
+ private CheckBoxTreeItem<T> root;
+
+ /**
+ * @param root
+ * The "checked" state of all the descendants, including the root
+ * itself, will be monitored
+ */
+ public CheckedTreeItemCollector(CheckBoxTreeItem<T> root) {
+ this.root = root;
+ root.addEventHandler(TreeModificationEvent.ANY, event -> {
+ @SuppressWarnings("unchecked")
+ TreeModificationEvent<T> mod = (TreeModificationEvent<T>) event;
+
+ T value = mod.getTreeItem().getValue();
+ boolean checked = mod.getTreeItem().isSelected();
+
+ synchronized (this.checkedItems) {
+ if (checked && !this.checkedItems.contains(value)) {
+ this.checkedItems.add(value);
+ } else if (!checked && this.checkedItems.contains(value)) {
+ this.checkedItems.remove(value);
+ }
+ }
+ });
+
+ this.checkedItems.addListener((SetChangeListener<T>) change -> {
+ if (change.getElementAdded() != null) {
+ setCheckedStateForValue(root, change.getElementAdded(), true);
+ }
+ if (change.getElementRemoved() != null) {
+ setCheckedStateForValue(root, change.getElementRemoved(), false);
+ }
+ });
+ }
+
+ private boolean setCheckedStateForValue(TreeItem<T> treeItem, T value, boolean state) {
+ if (value.equals(treeItem.getValue())) {
+ if (treeItem instanceof CheckBoxTreeItem) {
+ setCheckedState((CheckBoxTreeItem<T>) treeItem, state);
+ }
+ return true;
+ } else {
+ for (TreeItem<T> child : treeItem.getChildren()) {
+ if (setCheckedStateForValue(child, value, state)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ private void setCheckedStateRekursiv(TreeItem<T> treeItem, boolean state) {
+ if (treeItem instanceof CheckBoxTreeItem) {
+ setCheckedState((CheckBoxTreeItem<T>) treeItem, state);
+ }
+ treeItem.getChildren().forEach(child -> setCheckedStateRekursiv(child, state));
+ }
+
+ private void setCheckedState(CheckBoxTreeItem<T> root, boolean state) {
+ if (Platform.isFxApplicationThread()) {
+ root.setSelected(state);
+ } else {
+ Platform.runLater(() -> root.setSelected(state));
+ }
+ }
+
+ /**
+ * Check all the items in the tree
+ */
+ public void checkAll() {
+ setCheckedStateRekursiv(this.root, true);
+ }
+
+ /**
+ * Uncheck all the items in the tree
+ */
+ public void uncheckAll() {
+ setCheckedStateRekursiv(this.root, false);
+ }
+
+ /**
+ * @return An {@link ObservableSet} of all the values who's tree items have
+ * been "checked"
+ */
+ public ObservableSet<T> getCheckedItems() {
+ return this.checkedItems;
+ }
+
+}
diff --git a/bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/tree/FilterableTreeItem.java b/bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/tree/FilterableTreeItem.java
index e28ecc675..63f9b73fe 100644
--- a/bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/tree/FilterableTreeItem.java
+++ b/bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/tree/FilterableTreeItem.java
@@ -21,7 +21,9 @@ import javafx.collections.FXCollections;
import javafx.collections.ListChangeListener;
import javafx.collections.ObservableList;
import javafx.collections.transformation.FilteredList;
+import javafx.scene.control.CheckBoxTreeItem;
import javafx.scene.control.TreeItem;
+import javafx.scene.control.cell.CheckBoxTreeCell;
/**
* An extension of {@link TreeItem} with the possibility to filter its children. To enable filtering
@@ -31,10 +33,13 @@ import javafx.scene.control.TreeItem;
* A tree item that has children will not be filtered. The predicate will only be evaluated, if the
* tree item is a leaf. Since the predicate is also set for the child tree items, the tree item in question
* can turn into a leaf if all its children are filtered.
+ *
+ * This class extends {@link CheckBoxTreeItem} so it can, but does not need to be, used in conjunction
+ * with {@link CheckBoxTreeCell} cells.
*
* @param <T> The type of the {@link #getValue() value} property within {@link TreeItem}.
*/
-public class FilterableTreeItem<T> extends TreeItem<T> {
+public class FilterableTreeItem<T> extends CheckBoxTreeItem<T> {
final private ObservableList<TreeItem<T>> sourceList;
final private FilteredList<TreeItem<T>> filteredList;
diff --git a/demos/org.eclipse.fx.demo.contacts.app/contacts.product b/demos/org.eclipse.fx.demo.contacts.app/contacts.product
index 62f43baf5..346f90faa 100755
--- a/demos/org.eclipse.fx.demo.contacts.app/contacts.product
+++ b/demos/org.eclipse.fx.demo.contacts.app/contacts.product
@@ -32,10 +32,12 @@
</vm>
<plugins>
+ <plugin id="com.google.guava"/>
<plugin id="com.ibm.icu"/>
- <plugin id="javax.annotation"/>
+ <plugin id="javax.annotation.jre"/>
<plugin id="javax.inject"/>
<plugin id="javax.xml"/>
+ <plugin id="org.apache.commons.jxpath"/>
<plugin id="org.apache.commons.lang"/>
<plugin id="org.eclipse.core.commands"/>
<plugin id="org.eclipse.core.contenttype"/>
@@ -45,15 +47,21 @@
<plugin id="org.eclipse.core.databinding.property"/>
<plugin id="org.eclipse.core.expressions"/>
<plugin id="org.eclipse.core.filesystem"/>
+ <plugin id="org.eclipse.core.filesystem.win32.x86" fragment="true"/>
+ <plugin id="org.eclipse.core.filesystem.win32.x86_64" fragment="true"/>
<plugin id="org.eclipse.core.jobs"/>
<plugin id="org.eclipse.core.resources"/>
+ <plugin id="org.eclipse.core.resources.win32.x86" fragment="true"/>
+ <plugin id="org.eclipse.core.resources.win32.x86_64" fragment="true"/>
<plugin id="org.eclipse.core.runtime"/>
<plugin id="org.eclipse.core.variables"/>
<plugin id="org.eclipse.e4.core.commands"/>
<plugin id="org.eclipse.e4.core.contexts"/>
<plugin id="org.eclipse.e4.core.di"/>
+ <plugin id="org.eclipse.e4.core.di.annotations"/>
<plugin id="org.eclipse.e4.core.di.extensions"/>
<plugin id="org.eclipse.e4.core.services"/>
+ <plugin id="org.eclipse.e4.emf.xpath"/>
<plugin id="org.eclipse.e4.ui.di"/>
<plugin id="org.eclipse.e4.ui.model.workbench"/>
<plugin id="org.eclipse.e4.ui.services"/>
@@ -61,6 +69,7 @@
<plugin id="org.eclipse.emf.common"/>
<plugin id="org.eclipse.emf.ecore"/>
<plugin id="org.eclipse.emf.ecore.change"/>
+ <plugin id="org.eclipse.emf.ecore.de" fragment="true"/>
<plugin id="org.eclipse.emf.ecore.xmi"/>
<plugin id="org.eclipse.emf.edit"/>
<plugin id="org.eclipse.equinox.app"/>
@@ -79,6 +88,8 @@
<plugin id="org.eclipse.fx.demo.contacts"/>
<plugin id="org.eclipse.fx.demo.contacts.app"/>
<plugin id="org.eclipse.fx.demo.contacts.edit"/>
+ <plugin id="org.eclipse.fx.demo.contacts.edit.tests" fragment="true"/>
+ <plugin id="org.eclipse.fx.demo.contacts.tests" fragment="true"/>
<plugin id="org.eclipse.fx.emf.databinding"/>
<plugin id="org.eclipse.fx.emf.edit.ui"/>
<plugin id="org.eclipse.fx.osgi.util"/>
@@ -101,6 +112,8 @@
<plugin id="org.eclipse.osgi"/>
<plugin id="org.eclipse.osgi.compatibility.state" fragment="true"/>
<plugin id="org.eclipse.osgi.services"/>
+ <plugin id="org.hamcrest.core"/>
+ <plugin id="org.junit"/>
</plugins>
diff --git a/demos/org.eclipse.fx.demo.contacts.app/contacts.product.launch b/demos/org.eclipse.fx.demo.contacts.app/contacts.product.launch
index 0feac4026..178e7bd4e 100644
--- a/demos/org.eclipse.fx.demo.contacts.app/contacts.product.launch
+++ b/demos/org.eclipse.fx.demo.contacts.app/contacts.product.launch
@@ -22,8 +22,8 @@
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.fx.demo.contacts.app.product"/>
<stringAttribute key="productFile" value="/org.eclipse.fx.demo.contacts.app/contacts.product"/>
-<stringAttribute key="selected_target_plugins" value="org.eclipse.core.expressions@default:default,org.eclipse.osgi@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.databinding.beans@default:default,javax.annotation@default:default,org.eclipse.equinox.event@default:default,org.eclipse.osgi.compatibility.state@default:default,com.ibm.icu@default:default,org.eclipse.e4.core.di.extensions@default:default,org.apache.commons.lang@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.e4.ui.di@default:default,org.eclipse.emf.edit@default:default,org.eclipse.core.variables@default:default,org.eclipse.e4.ui.model.workbench@default:default,org.eclipse.e4.core.services@default:default,org.eclipse.equinox.ds@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.resources@default:default,org.eclipse.equinox.util@default:default,javax.inject@default:default,javax.xml@default:default,org.eclipse.equinox.app@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.e4.ui.workbench@default:default,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.e4.core.contexts@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.osgi.services@default:default,org.eclipse.equinox.common@default:default,org.eclipse.e4.core.commands@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.databinding@default:default,org.eclipse.e4.core.di@default:default,org.eclipse.e4.ui.services@default:default,org.eclipse.core.runtime@default:default,org.eclipse.core.contenttype@default:default,"/>
-<stringAttribute key="selected_workspace_plugins" value="org.eclipse.fx.ui.databinding@default:default,org.eclipse.fx.core.di.context@default:default,org.eclipse.fx.demo.contacts.app@default:default,org.eclipse.fx.core.di@default:default,org.eclipse.fx.ui.panes@default:default,org.eclipse.fx.core@default:default,org.eclipse.fx.ui.theme@default:default,org.eclipse.fx.core.fxml@default:default,org.eclipse.fx.ui.dialogs@default:default,org.eclipse.fx.emf.edit.ui@default:default,org.eclipse.fx.ui.workbench.services@default:default,org.eclipse.fx.ui.workbench.base@default:default,org.eclipse.fx.core.databinding@default:default,org.eclipse.fx.demo.contacts.edit@default:default,org.eclipse.fx.ui.controls@default:default,org.eclipse.fx.ui.keybindings.e4@default:default,org.eclipse.fx.ui.workbench.fx@default:default,org.eclipse.fx.ui.workbench.renderers.base@default:default,org.eclipse.fx.osgi.util@default:default,org.eclipse.fx.ui.di@default:default,org.eclipse.fx.ui.services@default:default,org.eclipse.fx.ui.keybindings@default:default,org.eclipse.fx.demo.contacts@default:default,org.eclipse.fx.ui.keybindings.generic@default:default,org.eclipse.fx.emf.databinding@default:default,org.eclipse.fx.ui.animation@default:default,org.eclipse.fx.ui.workbench.renderers.fx@default:default,"/>
+<stringAttribute key="selected_target_plugins" value="org.eclipse.e4.core.di.annotations@default:default,org.eclipse.osgi.services@default:default,org.eclipse.e4.core.di.extensions@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.equinox.common@default:default,org.eclipse.core.filesystem.win32.x86@default:default,org.hamcrest.core@default:default,org.eclipse.osgi@default:default,org.apache.commons.lang@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.emf.edit@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.e4.core.commands@default:default,org.eclipse.core.databinding.beans@default:default,org.eclipse.e4.ui.services@default:default,org.eclipse.core.runtime@default:default,javax.xml@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.variables@default:default,org.eclipse.core.databinding@default:default,org.eclipse.e4.emf.xpath@default:default,org.apache.commons.jxpath@default:default,org.eclipse.core.resources@default:default,org.eclipse.e4.ui.model.workbench@default:default,javax.inject@default:default,org.eclipse.e4.core.contexts@default:default,javax.annotation.jre@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.e4.core.di@default:default,org.eclipse.equinox.util@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.equinox.ds@default:default,org.eclipse.equinox.event@default:default,org.eclipse.osgi.compatibility.state@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.equinox.preferences@default:default,com.ibm.icu@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.common@default:default,org.eclipse.core.resources.win32.x86@default:default,org.eclipse.e4.core.services@default:default,org.junit@default:default,org.eclipse.e4.ui.di@default:default,com.google.guava@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.e4.ui.workbench@default:default,org.eclipse.equinox.app@default:default,"/>
+<stringAttribute key="selected_workspace_plugins" value="org.eclipse.fx.demo.contacts.app@default:default,org.eclipse.fx.ui.workbench.renderers.fx@default:default,org.eclipse.fx.emf.databinding@default:default,org.eclipse.fx.demo.contacts@default:default,org.eclipse.fx.ui.databinding@default:default,org.eclipse.fx.ui.theme@default:default,org.eclipse.fx.ui.services@default:default,org.eclipse.fx.demo.contacts.edit.tests@default:default,org.eclipse.fx.demo.contacts.edit@default:default,org.eclipse.fx.ui.panes@default:default,org.eclipse.fx.core.databinding@default:default,org.eclipse.fx.core.di@default:default,org.eclipse.fx.core.di.context@default:default,org.eclipse.fx.core@default:default,org.eclipse.fx.ui.controls@default:default,org.eclipse.fx.ui.di@default:default,org.eclipse.fx.ui.keybindings.generic@default:default,org.eclipse.fx.core.fxml@default:default,org.eclipse.fx.emf.edit.ui@default:default,org.eclipse.fx.ui.workbench.fx@default:default,org.eclipse.fx.demo.contacts.tests@default:default,org.eclipse.emf.ecore.de@default:default,org.eclipse.fx.ui.keybindings.e4@default:default,org.eclipse.fx.osgi.util@default:default,org.eclipse.fx.ui.workbench.base@default:default,org.eclipse.fx.ui.keybindings@default:default,org.eclipse.fx.ui.workbench.renderers.base@default:default,org.eclipse.fx.ui.workbench.services@default:default,org.eclipse.fx.ui.animation@default:default,org.eclipse.fx.ui.dialogs@default:default,"/>
<booleanAttribute key="show_selected_only" value="false"/>
<booleanAttribute key="tracing" value="false"/>
<booleanAttribute key="useCustomFeatures" value="false"/>
diff --git a/demos/org.eclipse.fx.demo.contacts.app/contacts_workspace.product.launch b/demos/org.eclipse.fx.demo.contacts.app/contacts_workspace.product.launch
index 9262c21f4..c1e1bf5c2 100644
--- a/demos/org.eclipse.fx.demo.contacts.app/contacts_workspace.product.launch
+++ b/demos/org.eclipse.fx.demo.contacts.app/contacts_workspace.product.launch
@@ -18,12 +18,12 @@
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value=" -Dorg.osgi.framework.bundle.parent=ext"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dorg.osgi.framework.bundle.parent=ext"/>
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.fx.demo.contacts.app.product"/>
<stringAttribute key="productFile" value="/org.eclipse.fx.demo.contacts.app/contacts.product"/>
-<stringAttribute key="selected_target_plugins" value="org.eclipse.core.expressions@default:default,org.eclipse.osgi@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.databinding.beans@default:default,javax.annotation@default:default,org.eclipse.equinox.event@default:default,org.eclipse.osgi.compatibility.state@default:default,com.ibm.icu@default:default,org.eclipse.e4.core.di.extensions@default:default,org.apache.commons.lang@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.e4.ui.di@default:default,org.eclipse.emf.edit@default:default,org.eclipse.core.variables@default:default,org.eclipse.e4.ui.model.workbench@default:default,org.eclipse.e4.core.services@default:default,org.eclipse.equinox.ds@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.resources@default:default,org.eclipse.equinox.util@default:default,javax.inject@default:default,javax.xml@default:default,org.eclipse.equinox.app@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.e4.ui.workbench@default:default,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.e4.core.contexts@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.osgi.services@default:default,org.eclipse.equinox.common@default:default,org.eclipse.e4.core.commands@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.databinding@default:default,org.eclipse.e4.core.di@default:default,org.eclipse.e4.ui.services@default:default,org.eclipse.core.runtime@default:default,org.eclipse.core.contenttype@default:default,"/>
-<stringAttribute key="selected_workspace_plugins" value="org.eclipse.fx.ui.databinding@default:default,org.eclipse.fx.core.di.context@default:default,org.eclipse.fx.demo.contacts.app@default:default,org.eclipse.fx.core.di@default:default,org.eclipse.fx.ui.panes@default:default,org.eclipse.fx.core@default:default,org.eclipse.fx.ui.theme@default:default,org.eclipse.fx.core.fxml@default:default,org.eclipse.fx.ui.dialogs@default:default,org.eclipse.fx.emf.edit.ui@default:default,org.eclipse.fx.ui.workbench.services@default:default,org.eclipse.fx.ui.workbench.base@default:default,org.eclipse.fx.core.databinding@default:default,org.eclipse.fx.demo.contacts.edit@default:default,org.eclipse.fx.ui.controls@default:default,org.eclipse.fx.ui.keybindings.e4@default:default,org.eclipse.fx.ui.workbench.fx@default:default,org.eclipse.fx.ui.workbench.renderers.base@default:default,org.eclipse.fx.osgi.util@default:default,org.eclipse.fx.ui.di@default:default,org.eclipse.fx.ui.services@default:default,org.eclipse.fx.ui.keybindings@default:default,org.eclipse.fx.demo.contacts@default:default,org.eclipse.fx.ui.keybindings.generic@default:default,org.eclipse.fx.emf.databinding@default:default,org.eclipse.fx.ui.animation@default:default,org.eclipse.fx.ui.workbench.renderers.fx@default:default,"/>
+<stringAttribute key="selected_target_plugins" value="com.google.guava@default:default,com.ibm.icu@default:default,javax.annotation.jre@default:default,javax.inject@default:default,javax.xml@default:default,org.apache.commons.jxpath@default:default,org.apache.commons.lang@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.beans@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.filesystem.win32.x86@default:false,org.eclipse.core.filesystem@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.resources.win32.x86@default:false,org.eclipse.core.resources@default:default,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.e4.core.commands@default:default,org.eclipse.e4.core.contexts@default:default,org.eclipse.e4.core.di.annotations@default:default,org.eclipse.e4.core.di.extensions@default:default,org.eclipse.e4.core.di@default:default,org.eclipse.e4.core.services@default:default,org.eclipse.e4.emf.xpath@default:default,org.eclipse.e4.ui.di@default:default,org.eclipse.e4.ui.model.workbench@default:default,org.eclipse.e4.ui.services@default:default,org.eclipse.e4.ui.workbench@default:default,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.emf.edit@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.concurrent@default:default,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.event@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.util@default:default,org.eclipse.jdt.annotation@default:default,org.eclipse.osgi.compatibility.state@default:false,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.hamcrest.core@default:default,org.junit@default:default"/>
+<stringAttribute key="selected_workspace_plugins" value="org.eclipse.emf.ecore.de@default:false,org.eclipse.fx.core.databinding@default:default,org.eclipse.fx.core.di.context@default:default,org.eclipse.fx.core.di@default:default,org.eclipse.fx.core.fxml@default:default,org.eclipse.fx.core@default:default,org.eclipse.fx.demo.contacts.app@default:default,org.eclipse.fx.demo.contacts.edit.tests@default:false,org.eclipse.fx.demo.contacts.edit@default:default,org.eclipse.fx.demo.contacts.tests@default:false,org.eclipse.fx.demo.contacts@default:default,org.eclipse.fx.emf.databinding@default:default,org.eclipse.fx.emf.edit.ui@default:default,org.eclipse.fx.osgi.util@default:default,org.eclipse.fx.ui.animation@default:default,org.eclipse.fx.ui.controls@default:default,org.eclipse.fx.ui.databinding@default:default,org.eclipse.fx.ui.di@default:default,org.eclipse.fx.ui.dialogs@default:default,org.eclipse.fx.ui.keybindings.e4@default:default,org.eclipse.fx.ui.keybindings.generic@default:default,org.eclipse.fx.ui.keybindings@default:default,org.eclipse.fx.ui.panes@default:default,org.eclipse.fx.ui.services@default:default,org.eclipse.fx.ui.theme@default:default,org.eclipse.fx.ui.workbench.base@default:default,org.eclipse.fx.ui.workbench.fx@default:default,org.eclipse.fx.ui.workbench.renderers.base@default:default,org.eclipse.fx.ui.workbench.renderers.fx@default:default,org.eclipse.fx.ui.workbench.services@default:default"/>
<booleanAttribute key="show_selected_only" value="false"/>
<booleanAttribute key="tracing" value="false"/>
<booleanAttribute key="useCustomFeatures" value="false"/>
diff --git a/demos/org.eclipse.fx.demo.contacts.app/plugin.xml b/demos/org.eclipse.fx.demo.contacts.app/plugin.xml
index 1059d9513..b6e691834 100755
--- a/demos/org.eclipse.fx.demo.contacts.app/plugin.xml
+++ b/demos/org.eclipse.fx.demo.contacts.app/plugin.xml
@@ -16,10 +16,6 @@
value="org.eclipse.fx.demo.contacts.app/Application.e4xmi">
</property>
<property
- name="preferenceCustomization"
- value="plugin_customization.ini">
- </property>
- <property
name="cssTheme"
value="dark">
</property>
@@ -35,6 +31,10 @@
name="startupProgressRect"
value="5,275,445,15">
</property>
+ <property
+ name="preferenceCustomization"
+ value="plugin_customization.ini">
+ </property>
</product>
</extension>
<extension

Back to the top