javafx.scene.control.TreeTableColumn.CellDataFeatures Java Examples

The following examples show how to use javafx.scene.control.TreeTableColumn.CellDataFeatures. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EditableTreeTable.java    From Open-Lowcode with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * generates the root column showing label of line elements
 */
private void generateRootColumn() {

	TreeTableColumn<
			EditableTreeTableLineItem<Wrapper<E>>,
			String> rootcolumn = new TreeTableColumn<EditableTreeTableLineItem<Wrapper<E>>, String>("Item");
	rootcolumn.setCellValueFactory(new Callback<
			CellDataFeatures<EditableTreeTableLineItem<Wrapper<E>>, String>, ObservableValue<String>>() {

		@Override
		public ObservableValue<String> call(CellDataFeatures<EditableTreeTableLineItem<Wrapper<E>>, String> param) {
			return new SimpleStringProperty(param.getValue().getValue().getLabel());
		}
	});

	treetableview.getColumns().add(rootcolumn);
}
 
Example #2
Source File: DataTypeCellValueFactory.java    From mzmine3 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public ObservableValue<Object> call(CellDataFeatures<ModularFeatureListRow, Object> param) {
  final ModularDataModel map = dataMapSupplier.apply(param);
  if (map == null) {
    logger.log(Level.WARNING, "There was no DataTypeMap for the column of DataType "
        + type.getClass().toString() + " and raw file " + (raw == null ? "NONE" : raw.getName()));
    return null;
  }

  return (ObservableValue<Object>) map.get(type);
}
 
Example #3
Source File: DataTypeCellValueFactory.java    From mzmine3 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * The default way to get the DataMap. FeatureListRow (for raw==null), Feature for raw!=null.
 */
@Override
public ModularDataModel apply(CellDataFeatures<ModularFeatureListRow, Object> param) {
  if (raw != null) {
    // find data type map for feature for this raw file
    Map<RawDataFile, ModularFeature> features = param.getValue().getValue().getFeatures();
    // no features
    if (features.get(raw) == null)
      return null;
    return features.get(raw);
  } else {
    // use feature list row DataTypeMap
    return param.getValue().getValue();
  }
}
 
Example #4
Source File: DataTypeCellValueFactory.java    From mzmine3 with GNU General Public License v2.0 4 votes vote down vote up
public DataTypeCellValueFactory(RawDataFile raw, DataType<?> type,
    Function<CellDataFeatures<ModularFeatureListRow, Object>, ModularDataModel> dataMapSupplier) {
  this.type = type;
  this.raw = raw;
  this.dataMapSupplier = dataMapSupplier == null ? this : dataMapSupplier;
}
 
Example #5
Source File: BookMarks.java    From JFX-Browser with MIT License 4 votes vote down vote up
public BookMarks(){
	for(int i=0 ; i< folders.size();i++){
		System.out.println(i);
		parentFolder.getChildren().add(new TreeItem<>(folders.get(i),new ImageView(folderImage)));
	}
	bookMarkCol.setCellValueFactory(new Callback<CellDataFeatures<String,String>, ObservableValue<String>>() {
		@Override
		public ObservableValue<String> call(CellDataFeatures<String, String> param) {
			return new SimpleStringProperty(param.getValue().getValue());
		}
	});		
	
	nameCol.setCellValueFactory(new PropertyValueFactory<URLdetails,String>("name"));
	locationCol.setCellValueFactory(new PropertyValueFactory<URLdetails,String>("location"));
	dateCol.setCellValueFactory(new PropertyValueFactory<URLdetails,String>("date"));
	timeCol.setCellValueFactory(new PropertyValueFactory<URLdetails,String>("time"));
	treeView.getSelectionModel().selectedItemProperty().addListener((observable,oldValue,newValue)->{

			TreeItem<String> selectedItem = (TreeItem<String>) newValue;
			System.out.println("Selected Text : " + selectedItem.getValue());
			ObservableList<URLdetails> list = new PopulateTable().PopulateTable(selectedItem.getValue());
			table.setItems(list);
			
	});
	table.focusedProperty().addListener((observable,oldValue,newValue)->{


			String url = table.getSelectionModel().getSelectedItem().getLocation();
			System.out.println("Url of the selected bookmarks: "+url);
			
		
	});
	
	bookMarkCol.setPrefWidth(150);
	nameCol.setPrefWidth(200);
	timeCol.setPrefWidth(150);
	dateCol.setPrefWidth(150);
	locationCol.setPrefWidth(300);
	parentFolder.setExpanded(true);
	treeView.getColumns().add(bookMarkCol);
	treeView.setRoot(parentFolder);
	table.getColumns().addAll(nameCol,locationCol,dateCol,timeCol);
	table.setItems(list);
}
 
Example #6
Source File: FxTreeTableCellValueFactory.java    From FxDock with Apache License 2.0 4 votes vote down vote up
public ObservableValue<T> call(CellDataFeatures<T,T> f)
{
	T v = value(f.getValue(), f.getTreeTableColumn(), f.getTreeTableView());
	return new ReadOnlyObjectWrapper<T>(v);
}