Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2014-01-20 05:16:28 -0500
committerTom Schindl2014-01-20 05:16:28 -0500
commitc00a3705f50785795e9ba44edca2a9afac9250cc (patch)
treebf8177e740e6915081b2f24197806b849fb7ff58
parentf3506b05c6e16c68c136a090dd891dec90e5df6a (diff)
downloadorg.eclipse.efxclipse-c00a3705f50785795e9ba44edca2a9afac9250cc.tar.gz
org.eclipse.efxclipse-c00a3705f50785795e9ba44edca2a9afac9250cc.tar.xz
org.eclipse.efxclipse-c00a3705f50785795e9ba44edca2a9afac9250cc.zip
fixed copyright
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.databinding/src/org/eclipse/fx/ui/databinding/ListUtil.java55
1 files changed, 38 insertions, 17 deletions
diff --git a/bundles/runtime/org.eclipse.fx.ui.databinding/src/org/eclipse/fx/ui/databinding/ListUtil.java b/bundles/runtime/org.eclipse.fx.ui.databinding/src/org/eclipse/fx/ui/databinding/ListUtil.java
index 966934680..c73c5b357 100644
--- a/bundles/runtime/org.eclipse.fx.ui.databinding/src/org/eclipse/fx/ui/databinding/ListUtil.java
+++ b/bundles/runtime/org.eclipse.fx.ui.databinding/src/org/eclipse/fx/ui/databinding/ListUtil.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2013 BestSolution.at 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:
+ * Tom Schindl<tom.schindl@bestsolution.at> - initial API and implementation
+ *******************************************************************************/
package org.eclipse.fx.ui.databinding;
import org.eclipse.core.databinding.observable.list.IObservableList;
@@ -7,34 +17,45 @@ import org.eclipse.fx.core.databinding.AdapterFactory;
import javafx.scene.control.ComboBox;
import javafx.scene.control.ListView;
+/**
+ * Utility to setup {@link ListView} and {@link ComboBox}
+ */
public class ListUtil {
+ /**
+ * Setup a list where cell text is bound to the given property
+ *
+ * @param listView
+ * the list view
+ * @param property
+ * the text property
+ */
public static <T> void setupList(ListView<T> listView, IValueProperty property) {
- listView.setCellFactory(PropertyListCellFaytory.<T>textFactory(property));
+ listView.setCellFactory(PropertyListCellFaytory.<T> textFactory(property));
}
-
+
public static <T> void setupList(ListView<T> listView, String template, IValueProperty... properties) {
- listView.setCellFactory(PropertyListCellFaytory.<T>textFactory(template, properties));
+ listView.setCellFactory(PropertyListCellFaytory.<T> textFactory(template, properties));
}
-
+
public static <T> void setupComboBox(ComboBox<T> comboBox, IValueProperty property) {
- comboBox.setCellFactory(PropertyListCellFaytory.<T>textFactory(property));
- comboBox.setButtonCell(PropertyListCellFaytory.<T>textCell(property));
+ comboBox.setCellFactory(PropertyListCellFaytory.<T> textFactory(property));
+ comboBox.setButtonCell(PropertyListCellFaytory.<T> textCell(property));
}
-
+
public static <T> void setupComboBox(ComboBox<T> comboBox, String template, IValueProperty... properties) {
- comboBox.setCellFactory(PropertyListCellFaytory.<T>textFactory(template,properties));
- comboBox.setButtonCell(PropertyListCellFaytory.<T>textCell(template,properties));
+ comboBox.setCellFactory(PropertyListCellFaytory.<T> textFactory(template, properties));
+ comboBox.setButtonCell(PropertyListCellFaytory.<T> textCell(template, properties));
}
-
+
public static <T> void setupComboBox(IObservableList list, ComboBox<T> comboBox, IValueProperty property) {
- comboBox.setCellFactory(PropertyListCellFaytory.<T>textFactory(property));
- comboBox.setButtonCell(PropertyListCellFaytory.<T>textCell(property));
- comboBox.setItems(AdapterFactory.<T>adapt(list));
+ comboBox.setCellFactory(PropertyListCellFaytory.<T> textFactory(property));
+ comboBox.setButtonCell(PropertyListCellFaytory.<T> textCell(property));
+ comboBox.setItems(AdapterFactory.<T> adapt(list));
}
-
+
public static <T> void setupComboBox(IObservableList list, ComboBox<T> comboBox, String template, IValueProperty... properties) {
- comboBox.setCellFactory(PropertyListCellFaytory.<T>textFactory(template,properties));
- comboBox.setButtonCell(PropertyListCellFaytory.<T>textCell(template,properties));
- comboBox.setItems(AdapterFactory.<T>adapt(list));
+ comboBox.setCellFactory(PropertyListCellFaytory.<T> textFactory(template, properties));
+ comboBox.setButtonCell(PropertyListCellFaytory.<T> textCell(template, properties));
+ comboBox.setItems(AdapterFactory.<T> adapt(list));
}
}

Back to the top