List of usage examples for javafx.scene.control TableColumn TableColumn
public TableColumn(String text)
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXFloatColListPane.java
public CFBamJavaFXFloatColListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamTableObj argContainer, ICFBamFloatColObj argFocus, Collection<ICFBamFloatColObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();//ww w . j av a 2 s .c o m final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamFloatColObj>(); tableColumnId = new TableColumn<ICFBamFloatColObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamFloatColObj, Long> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { long value = obj.getRequiredId(); Long wrapped = new Long(value); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(wrapped); return (observable); } } }); tableColumnId.setCellFactory( new Callback<TableColumn<ICFBamFloatColObj, Long>, TableCell<ICFBamFloatColObj, Long>>() { @Override public TableCell<ICFBamFloatColObj, Long> call(TableColumn<ICFBamFloatColObj, Long> arg) { return new CFInt64TableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamFloatColObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamFloatColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getRequiredName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnName.setCellFactory( new Callback<TableColumn<ICFBamFloatColObj, String>, TableCell<ICFBamFloatColObj, String>>() { @Override public TableCell<ICFBamFloatColObj, String> call(TableColumn<ICFBamFloatColObj, String> arg) { return new CFStringTableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamFloatColObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamFloatColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortName.setCellFactory( new Callback<TableColumn<ICFBamFloatColObj, String>, TableCell<ICFBamFloatColObj, String>>() { @Override public TableCell<ICFBamFloatColObj, String> call(TableColumn<ICFBamFloatColObj, String> arg) { return new CFStringTableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamFloatColObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamFloatColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalLabel(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnLabel.setCellFactory( new Callback<TableColumn<ICFBamFloatColObj, String>, TableCell<ICFBamFloatColObj, String>>() { @Override public TableCell<ICFBamFloatColObj, String> call(TableColumn<ICFBamFloatColObj, String> arg) { return new CFStringTableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamFloatColObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamFloatColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortDescription.setCellFactory( new Callback<TableColumn<ICFBamFloatColObj, String>, TableCell<ICFBamFloatColObj, String>>() { @Override public TableCell<ICFBamFloatColObj, String> call(TableColumn<ICFBamFloatColObj, String> arg) { return new CFStringTableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamFloatColObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamFloatColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDescription.setCellFactory( new Callback<TableColumn<ICFBamFloatColObj, String>, TableCell<ICFBamFloatColObj, String>>() { @Override public TableCell<ICFBamFloatColObj, String> call(TableColumn<ICFBamFloatColObj, String> arg) { return new CFStringTableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamFloatColObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamFloatColObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredIsNullable(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnIsNullable.setCellFactory( new Callback<TableColumn<ICFBamFloatColObj, Boolean>, TableCell<ICFBamFloatColObj, Boolean>>() { @Override public TableCell<ICFBamFloatColObj, Boolean> call(TableColumn<ICFBamFloatColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamFloatColObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamFloatColObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { Boolean value = obj.getOptionalGenerateId(); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(value); return (observable); } } }); tableColumnGenerateId.setCellFactory( new Callback<TableColumn<ICFBamFloatColObj, Boolean>, TableCell<ICFBamFloatColObj, Boolean>>() { @Override public TableCell<ICFBamFloatColObj, Boolean> call(TableColumn<ICFBamFloatColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamFloatColObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamFloatColObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredDefaultVisibility(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnDefaultVisibility.setCellFactory( new Callback<TableColumn<ICFBamFloatColObj, Boolean>, TableCell<ICFBamFloatColObj, Boolean>>() { @Override public TableCell<ICFBamFloatColObj, Boolean> call(TableColumn<ICFBamFloatColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamFloatColObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamFloatColObj, String> p) { ICFBamAtomObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDbName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDbName.setCellFactory( new Callback<TableColumn<ICFBamFloatColObj, String>, TableCell<ICFBamFloatColObj, String>>() { @Override public TableCell<ICFBamFloatColObj, String> call(TableColumn<ICFBamFloatColObj, String> arg) { return new CFStringTableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamFloatColObj, Float>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, Float>, ObservableValue<Float>>() { public ObservableValue<Float> call(CellDataFeatures<ICFBamFloatColObj, Float> p) { ICFBamFloatDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Float value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<Float> observable = new ReadOnlyObjectWrapper<Float>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamFloatColObj, Float>, TableCell<ICFBamFloatColObj, Float>>() { @Override public TableCell<ICFBamFloatColObj, Float> call(TableColumn<ICFBamFloatColObj, Float> arg) { return new CFFloatTableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamFloatColObj, Float>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, Float>, ObservableValue<Float>>() { public ObservableValue<Float> call(CellDataFeatures<ICFBamFloatColObj, Float> p) { ICFBamFloatDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Float value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<Float> observable = new ReadOnlyObjectWrapper<Float>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamFloatColObj, Float>, TableCell<ICFBamFloatColObj, Float>>() { @Override public TableCell<ICFBamFloatColObj, Float> call(TableColumn<ICFBamFloatColObj, Float> arg) { return new CFFloatTableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamFloatColObj, Float>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, Float>, ObservableValue<Float>>() { public ObservableValue<Float> call(CellDataFeatures<ICFBamFloatColObj, Float> p) { ICFBamFloatDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Float value = obj.getOptionalMinValue(); ReadOnlyObjectWrapper<Float> observable = new ReadOnlyObjectWrapper<Float>(); observable.setValue(value); return (observable); } } }); tableColumnMinValue.setCellFactory( new Callback<TableColumn<ICFBamFloatColObj, Float>, TableCell<ICFBamFloatColObj, Float>>() { @Override public TableCell<ICFBamFloatColObj, Float> call(TableColumn<ICFBamFloatColObj, Float> arg) { return new CFFloatTableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamFloatColObj, Float>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, Float>, ObservableValue<Float>>() { public ObservableValue<Float> call(CellDataFeatures<ICFBamFloatColObj, Float> p) { ICFBamFloatDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Float value = obj.getOptionalMaxValue(); ReadOnlyObjectWrapper<Float> observable = new ReadOnlyObjectWrapper<Float>(); observable.setValue(value); return (observable); } } }); tableColumnMaxValue.setCellFactory( new Callback<TableColumn<ICFBamFloatColObj, Float>, TableCell<ICFBamFloatColObj, Float>>() { @Override public TableCell<ICFBamFloatColObj, Float> call(TableColumn<ICFBamFloatColObj, Float> arg) { return new CFFloatTableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamFloatColObj, Float>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, Float>, ObservableValue<Float>>() { public ObservableValue<Float> call(CellDataFeatures<ICFBamFloatColObj, Float> p) { ICFBamFloatDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Float value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<Float> observable = new ReadOnlyObjectWrapper<Float>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamFloatColObj, Float>, TableCell<ICFBamFloatColObj, Float>>() { @Override public TableCell<ICFBamFloatColObj, Float> call(TableColumn<ICFBamFloatColObj, Float> arg) { return new CFFloatTableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamFloatColObj, Float>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, Float>, ObservableValue<Float>>() { public ObservableValue<Float> call(CellDataFeatures<ICFBamFloatColObj, Float> p) { ICFBamFloatDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Float value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<Float> observable = new ReadOnlyObjectWrapper<Float>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamFloatColObj, Float>, TableCell<ICFBamFloatColObj, Float>>() { @Override public TableCell<ICFBamFloatColObj, Float> call(TableColumn<ICFBamFloatColObj, Float> arg) { return new CFFloatTableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamFloatColObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamFloatColObj, ICFBamSchemaDefObj> p) { ICFBamFloatColObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema(); ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupDefSchema.setCellFactory( new Callback<TableColumn<ICFBamFloatColObj, ICFBamSchemaDefObj>, TableCell<ICFBamFloatColObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamFloatColObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamFloatColObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamFloatColObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamFloatColObj>() { @Override public void changed(ObservableValue<? extends ICFBamFloatColObj> observable, ICFBamFloatColObj oldValue, ICFBamFloatColObj newValue) { setJavaFXFocus(newValue); } }); scrollMenu = new ScrollPane(); scrollMenu.setVbarPolicy(ScrollBarPolicy.NEVER); scrollMenu.setHbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollMenu.setFitToHeight(true); scrollMenu.setContent(getPanelHBoxMenu()); setTop(scrollMenu); setCenter(dataTable); javafxIsInitializing = false; if (observableListOfFloatCol != null) { dataTable.setItems(observableListOfFloatCol); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXInt16ColListPane.java
public CFBamJavaFXInt16ColListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamTableObj argContainer, ICFBamInt16ColObj argFocus, Collection<ICFBamInt16ColObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();/*from ww w . j ava 2s . c o m*/ final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamInt16ColObj>(); tableColumnId = new TableColumn<ICFBamInt16ColObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamInt16ColObj, Long> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { long value = obj.getRequiredId(); Long wrapped = new Long(value); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(wrapped); return (observable); } } }); tableColumnId.setCellFactory( new Callback<TableColumn<ICFBamInt16ColObj, Long>, TableCell<ICFBamInt16ColObj, Long>>() { @Override public TableCell<ICFBamInt16ColObj, Long> call(TableColumn<ICFBamInt16ColObj, Long> arg) { return new CFInt64TableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamInt16ColObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt16ColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getRequiredName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnName.setCellFactory( new Callback<TableColumn<ICFBamInt16ColObj, String>, TableCell<ICFBamInt16ColObj, String>>() { @Override public TableCell<ICFBamInt16ColObj, String> call(TableColumn<ICFBamInt16ColObj, String> arg) { return new CFStringTableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamInt16ColObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt16ColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortName.setCellFactory( new Callback<TableColumn<ICFBamInt16ColObj, String>, TableCell<ICFBamInt16ColObj, String>>() { @Override public TableCell<ICFBamInt16ColObj, String> call(TableColumn<ICFBamInt16ColObj, String> arg) { return new CFStringTableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamInt16ColObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt16ColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalLabel(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnLabel.setCellFactory( new Callback<TableColumn<ICFBamInt16ColObj, String>, TableCell<ICFBamInt16ColObj, String>>() { @Override public TableCell<ICFBamInt16ColObj, String> call(TableColumn<ICFBamInt16ColObj, String> arg) { return new CFStringTableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamInt16ColObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt16ColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortDescription.setCellFactory( new Callback<TableColumn<ICFBamInt16ColObj, String>, TableCell<ICFBamInt16ColObj, String>>() { @Override public TableCell<ICFBamInt16ColObj, String> call(TableColumn<ICFBamInt16ColObj, String> arg) { return new CFStringTableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamInt16ColObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt16ColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDescription.setCellFactory( new Callback<TableColumn<ICFBamInt16ColObj, String>, TableCell<ICFBamInt16ColObj, String>>() { @Override public TableCell<ICFBamInt16ColObj, String> call(TableColumn<ICFBamInt16ColObj, String> arg) { return new CFStringTableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamInt16ColObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt16ColObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredIsNullable(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnIsNullable.setCellFactory( new Callback<TableColumn<ICFBamInt16ColObj, Boolean>, TableCell<ICFBamInt16ColObj, Boolean>>() { @Override public TableCell<ICFBamInt16ColObj, Boolean> call(TableColumn<ICFBamInt16ColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamInt16ColObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt16ColObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { Boolean value = obj.getOptionalGenerateId(); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(value); return (observable); } } }); tableColumnGenerateId.setCellFactory( new Callback<TableColumn<ICFBamInt16ColObj, Boolean>, TableCell<ICFBamInt16ColObj, Boolean>>() { @Override public TableCell<ICFBamInt16ColObj, Boolean> call(TableColumn<ICFBamInt16ColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamInt16ColObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt16ColObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredDefaultVisibility(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnDefaultVisibility.setCellFactory( new Callback<TableColumn<ICFBamInt16ColObj, Boolean>, TableCell<ICFBamInt16ColObj, Boolean>>() { @Override public TableCell<ICFBamInt16ColObj, Boolean> call(TableColumn<ICFBamInt16ColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamInt16ColObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt16ColObj, String> p) { ICFBamAtomObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDbName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDbName.setCellFactory( new Callback<TableColumn<ICFBamInt16ColObj, String>, TableCell<ICFBamInt16ColObj, String>>() { @Override public TableCell<ICFBamInt16ColObj, String> call(TableColumn<ICFBamInt16ColObj, String> arg) { return new CFStringTableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamInt16ColObj, Short>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamInt16ColObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamInt16ColObj, Short>, TableCell<ICFBamInt16ColObj, Short>>() { @Override public TableCell<ICFBamInt16ColObj, Short> call(TableColumn<ICFBamInt16ColObj, Short> arg) { return new CFInt16TableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamInt16ColObj, Short>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamInt16ColObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamInt16ColObj, Short>, TableCell<ICFBamInt16ColObj, Short>>() { @Override public TableCell<ICFBamInt16ColObj, Short> call(TableColumn<ICFBamInt16ColObj, Short> arg) { return new CFInt16TableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamInt16ColObj, Short>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamInt16ColObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalMinValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnMinValue.setCellFactory( new Callback<TableColumn<ICFBamInt16ColObj, Short>, TableCell<ICFBamInt16ColObj, Short>>() { @Override public TableCell<ICFBamInt16ColObj, Short> call(TableColumn<ICFBamInt16ColObj, Short> arg) { return new CFInt16TableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamInt16ColObj, Short>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamInt16ColObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalMaxValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnMaxValue.setCellFactory( new Callback<TableColumn<ICFBamInt16ColObj, Short>, TableCell<ICFBamInt16ColObj, Short>>() { @Override public TableCell<ICFBamInt16ColObj, Short> call(TableColumn<ICFBamInt16ColObj, Short> arg) { return new CFInt16TableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamInt16ColObj, Short>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamInt16ColObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamInt16ColObj, Short>, TableCell<ICFBamInt16ColObj, Short>>() { @Override public TableCell<ICFBamInt16ColObj, Short> call(TableColumn<ICFBamInt16ColObj, Short> arg) { return new CFInt16TableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamInt16ColObj, Short>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamInt16ColObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamInt16ColObj, Short>, TableCell<ICFBamInt16ColObj, Short>>() { @Override public TableCell<ICFBamInt16ColObj, Short> call(TableColumn<ICFBamInt16ColObj, Short> arg) { return new CFInt16TableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamInt16ColObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamInt16ColObj, ICFBamSchemaDefObj> p) { ICFBamInt16ColObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema(); ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupDefSchema.setCellFactory( new Callback<TableColumn<ICFBamInt16ColObj, ICFBamSchemaDefObj>, TableCell<ICFBamInt16ColObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamInt16ColObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamInt16ColObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamInt16ColObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamInt16ColObj>() { @Override public void changed(ObservableValue<? extends ICFBamInt16ColObj> observable, ICFBamInt16ColObj oldValue, ICFBamInt16ColObj newValue) { setJavaFXFocus(newValue); } }); scrollMenu = new ScrollPane(); scrollMenu.setVbarPolicy(ScrollBarPolicy.NEVER); scrollMenu.setHbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollMenu.setFitToHeight(true); scrollMenu.setContent(getPanelHBoxMenu()); setTop(scrollMenu); setCenter(dataTable); javafxIsInitializing = false; if (observableListOfInt16Col != null) { dataTable.setItems(observableListOfInt16Col); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXEnumTypeListPane.java
public CFBamJavaFXEnumTypeListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamSchemaDefObj argContainer, ICFBamEnumTypeObj argFocus, Collection<ICFBamEnumTypeObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();//from w ww . j a va 2 s .co m final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamEnumTypeObj>(); tableColumnId = new TableColumn<ICFBamEnumTypeObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumTypeObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamEnumTypeObj, Long> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { long value = obj.getRequiredId(); Long wrapped = new Long(value); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(wrapped); return (observable); } } }); tableColumnId.setCellFactory( new Callback<TableColumn<ICFBamEnumTypeObj, Long>, TableCell<ICFBamEnumTypeObj, Long>>() { @Override public TableCell<ICFBamEnumTypeObj, Long> call(TableColumn<ICFBamEnumTypeObj, Long> arg) { return new CFInt64TableCell<ICFBamEnumTypeObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamEnumTypeObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamEnumTypeObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getRequiredName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnName.setCellFactory( new Callback<TableColumn<ICFBamEnumTypeObj, String>, TableCell<ICFBamEnumTypeObj, String>>() { @Override public TableCell<ICFBamEnumTypeObj, String> call(TableColumn<ICFBamEnumTypeObj, String> arg) { return new CFStringTableCell<ICFBamEnumTypeObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamEnumTypeObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamEnumTypeObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortName.setCellFactory( new Callback<TableColumn<ICFBamEnumTypeObj, String>, TableCell<ICFBamEnumTypeObj, String>>() { @Override public TableCell<ICFBamEnumTypeObj, String> call(TableColumn<ICFBamEnumTypeObj, String> arg) { return new CFStringTableCell<ICFBamEnumTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamEnumTypeObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamEnumTypeObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalLabel(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnLabel.setCellFactory( new Callback<TableColumn<ICFBamEnumTypeObj, String>, TableCell<ICFBamEnumTypeObj, String>>() { @Override public TableCell<ICFBamEnumTypeObj, String> call(TableColumn<ICFBamEnumTypeObj, String> arg) { return new CFStringTableCell<ICFBamEnumTypeObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamEnumTypeObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamEnumTypeObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortDescription.setCellFactory( new Callback<TableColumn<ICFBamEnumTypeObj, String>, TableCell<ICFBamEnumTypeObj, String>>() { @Override public TableCell<ICFBamEnumTypeObj, String> call(TableColumn<ICFBamEnumTypeObj, String> arg) { return new CFStringTableCell<ICFBamEnumTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamEnumTypeObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamEnumTypeObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDescription.setCellFactory( new Callback<TableColumn<ICFBamEnumTypeObj, String>, TableCell<ICFBamEnumTypeObj, String>>() { @Override public TableCell<ICFBamEnumTypeObj, String> call(TableColumn<ICFBamEnumTypeObj, String> arg) { return new CFStringTableCell<ICFBamEnumTypeObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamEnumTypeObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamEnumTypeObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredIsNullable(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnIsNullable.setCellFactory( new Callback<TableColumn<ICFBamEnumTypeObj, Boolean>, TableCell<ICFBamEnumTypeObj, Boolean>>() { @Override public TableCell<ICFBamEnumTypeObj, Boolean> call(TableColumn<ICFBamEnumTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamEnumTypeObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamEnumTypeObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamEnumTypeObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { Boolean value = obj.getOptionalGenerateId(); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(value); return (observable); } } }); tableColumnGenerateId.setCellFactory( new Callback<TableColumn<ICFBamEnumTypeObj, Boolean>, TableCell<ICFBamEnumTypeObj, Boolean>>() { @Override public TableCell<ICFBamEnumTypeObj, Boolean> call(TableColumn<ICFBamEnumTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamEnumTypeObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamEnumTypeObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamEnumTypeObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredDefaultVisibility(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnDefaultVisibility.setCellFactory( new Callback<TableColumn<ICFBamEnumTypeObj, Boolean>, TableCell<ICFBamEnumTypeObj, Boolean>>() { @Override public TableCell<ICFBamEnumTypeObj, Boolean> call(TableColumn<ICFBamEnumTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamEnumTypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamEnumTypeObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamEnumTypeObj, String> p) { ICFBamAtomObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDbName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDbName.setCellFactory( new Callback<TableColumn<ICFBamEnumTypeObj, String>, TableCell<ICFBamEnumTypeObj, String>>() { @Override public TableCell<ICFBamEnumTypeObj, String> call(TableColumn<ICFBamEnumTypeObj, String> arg) { return new CFStringTableCell<ICFBamEnumTypeObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamEnumTypeObj, Short>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumTypeObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamEnumTypeObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamEnumTypeObj, Short>, TableCell<ICFBamEnumTypeObj, Short>>() { @Override public TableCell<ICFBamEnumTypeObj, Short> call(TableColumn<ICFBamEnumTypeObj, Short> arg) { return new CFInt16TableCell<ICFBamEnumTypeObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamEnumTypeObj, Short>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumTypeObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamEnumTypeObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamEnumTypeObj, Short>, TableCell<ICFBamEnumTypeObj, Short>>() { @Override public TableCell<ICFBamEnumTypeObj, Short> call(TableColumn<ICFBamEnumTypeObj, Short> arg) { return new CFInt16TableCell<ICFBamEnumTypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamEnumTypeObj, Short>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumTypeObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamEnumTypeObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalMinValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnMinValue.setCellFactory( new Callback<TableColumn<ICFBamEnumTypeObj, Short>, TableCell<ICFBamEnumTypeObj, Short>>() { @Override public TableCell<ICFBamEnumTypeObj, Short> call(TableColumn<ICFBamEnumTypeObj, Short> arg) { return new CFInt16TableCell<ICFBamEnumTypeObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamEnumTypeObj, Short>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumTypeObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamEnumTypeObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalMaxValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnMaxValue.setCellFactory( new Callback<TableColumn<ICFBamEnumTypeObj, Short>, TableCell<ICFBamEnumTypeObj, Short>>() { @Override public TableCell<ICFBamEnumTypeObj, Short> call(TableColumn<ICFBamEnumTypeObj, Short> arg) { return new CFInt16TableCell<ICFBamEnumTypeObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamEnumTypeObj, Short>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumTypeObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamEnumTypeObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamEnumTypeObj, Short>, TableCell<ICFBamEnumTypeObj, Short>>() { @Override public TableCell<ICFBamEnumTypeObj, Short> call(TableColumn<ICFBamEnumTypeObj, Short> arg) { return new CFInt16TableCell<ICFBamEnumTypeObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamEnumTypeObj, Short>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumTypeObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamEnumTypeObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamEnumTypeObj, Short>, TableCell<ICFBamEnumTypeObj, Short>>() { @Override public TableCell<ICFBamEnumTypeObj, Short> call(TableColumn<ICFBamEnumTypeObj, Short> arg) { return new CFInt16TableCell<ICFBamEnumTypeObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamEnumTypeObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumTypeObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamEnumTypeObj, ICFBamSchemaDefObj> p) { ICFBamEnumTypeObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema(); ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupDefSchema.setCellFactory( new Callback<TableColumn<ICFBamEnumTypeObj, ICFBamSchemaDefObj>, TableCell<ICFBamEnumTypeObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamEnumTypeObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamEnumTypeObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamEnumTypeObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamEnumTypeObj>() { @Override public void changed(ObservableValue<? extends ICFBamEnumTypeObj> observable, ICFBamEnumTypeObj oldValue, ICFBamEnumTypeObj newValue) { setJavaFXFocus(newValue); } }); scrollMenu = new ScrollPane(); scrollMenu.setVbarPolicy(ScrollBarPolicy.NEVER); scrollMenu.setHbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollMenu.setFitToHeight(true); scrollMenu.setContent(getPanelHBoxMenu()); setTop(scrollMenu); setCenter(dataTable); javafxIsInitializing = false; if (observableListOfEnumType != null) { dataTable.setItems(observableListOfEnumType); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXTokenColListPane.java
public CFBamJavaFXTokenColListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamTableObj argContainer, ICFBamTokenColObj argFocus, Collection<ICFBamTokenColObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();//from w w w .j a va 2 s . co m final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamTokenColObj>(); tableColumnId = new TableColumn<ICFBamTokenColObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTokenColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamTokenColObj, Long> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { long value = obj.getRequiredId(); Long wrapped = new Long(value); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(wrapped); return (observable); } } }); tableColumnId.setCellFactory( new Callback<TableColumn<ICFBamTokenColObj, Long>, TableCell<ICFBamTokenColObj, Long>>() { @Override public TableCell<ICFBamTokenColObj, Long> call(TableColumn<ICFBamTokenColObj, Long> arg) { return new CFInt64TableCell<ICFBamTokenColObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamTokenColObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTokenColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTokenColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getRequiredName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnName.setCellFactory( new Callback<TableColumn<ICFBamTokenColObj, String>, TableCell<ICFBamTokenColObj, String>>() { @Override public TableCell<ICFBamTokenColObj, String> call(TableColumn<ICFBamTokenColObj, String> arg) { return new CFStringTableCell<ICFBamTokenColObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamTokenColObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTokenColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTokenColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortName.setCellFactory( new Callback<TableColumn<ICFBamTokenColObj, String>, TableCell<ICFBamTokenColObj, String>>() { @Override public TableCell<ICFBamTokenColObj, String> call(TableColumn<ICFBamTokenColObj, String> arg) { return new CFStringTableCell<ICFBamTokenColObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamTokenColObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTokenColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTokenColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalLabel(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnLabel.setCellFactory( new Callback<TableColumn<ICFBamTokenColObj, String>, TableCell<ICFBamTokenColObj, String>>() { @Override public TableCell<ICFBamTokenColObj, String> call(TableColumn<ICFBamTokenColObj, String> arg) { return new CFStringTableCell<ICFBamTokenColObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamTokenColObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTokenColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTokenColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortDescription.setCellFactory( new Callback<TableColumn<ICFBamTokenColObj, String>, TableCell<ICFBamTokenColObj, String>>() { @Override public TableCell<ICFBamTokenColObj, String> call(TableColumn<ICFBamTokenColObj, String> arg) { return new CFStringTableCell<ICFBamTokenColObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamTokenColObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTokenColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTokenColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDescription.setCellFactory( new Callback<TableColumn<ICFBamTokenColObj, String>, TableCell<ICFBamTokenColObj, String>>() { @Override public TableCell<ICFBamTokenColObj, String> call(TableColumn<ICFBamTokenColObj, String> arg) { return new CFStringTableCell<ICFBamTokenColObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamTokenColObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTokenColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTokenColObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredIsNullable(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnIsNullable.setCellFactory( new Callback<TableColumn<ICFBamTokenColObj, Boolean>, TableCell<ICFBamTokenColObj, Boolean>>() { @Override public TableCell<ICFBamTokenColObj, Boolean> call(TableColumn<ICFBamTokenColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTokenColObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamTokenColObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTokenColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTokenColObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { Boolean value = obj.getOptionalGenerateId(); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(value); return (observable); } } }); tableColumnGenerateId.setCellFactory( new Callback<TableColumn<ICFBamTokenColObj, Boolean>, TableCell<ICFBamTokenColObj, Boolean>>() { @Override public TableCell<ICFBamTokenColObj, Boolean> call(TableColumn<ICFBamTokenColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTokenColObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamTokenColObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTokenColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTokenColObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredDefaultVisibility(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnDefaultVisibility.setCellFactory( new Callback<TableColumn<ICFBamTokenColObj, Boolean>, TableCell<ICFBamTokenColObj, Boolean>>() { @Override public TableCell<ICFBamTokenColObj, Boolean> call(TableColumn<ICFBamTokenColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTokenColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamTokenColObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTokenColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTokenColObj, String> p) { ICFBamAtomObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDbName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDbName.setCellFactory( new Callback<TableColumn<ICFBamTokenColObj, String>, TableCell<ICFBamTokenColObj, String>>() { @Override public TableCell<ICFBamTokenColObj, String> call(TableColumn<ICFBamTokenColObj, String> arg) { return new CFStringTableCell<ICFBamTokenColObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnMaxLen = new TableColumn<ICFBamTokenColObj, Integer>("Max. Length"); tableColumnMaxLen.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTokenColObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamTokenColObj, Integer> p) { ICFBamTokenDefObj obj = p.getValue(); if (obj == null) { return (null); } else { int value = obj.getRequiredMaxLen(); Integer wrapped = new Integer(value); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(wrapped); return (observable); } } }); tableColumnMaxLen.setCellFactory( new Callback<TableColumn<ICFBamTokenColObj, Integer>, TableCell<ICFBamTokenColObj, Integer>>() { @Override public TableCell<ICFBamTokenColObj, Integer> call(TableColumn<ICFBamTokenColObj, Integer> arg) { return new CFInt32TableCell<ICFBamTokenColObj>(); } }); dataTable.getColumns().add(tableColumnMaxLen); tableColumnInitValue = new TableColumn<ICFBamTokenColObj, String>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTokenColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTokenColObj, String> p) { ICFBamTokenDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamTokenColObj, String>, TableCell<ICFBamTokenColObj, String>>() { @Override public TableCell<ICFBamTokenColObj, String> call(TableColumn<ICFBamTokenColObj, String> arg) { return new CFTokenTableCell<ICFBamTokenColObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamTokenColObj, String>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTokenColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTokenColObj, String> p) { ICFBamTokenDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamTokenColObj, String>, TableCell<ICFBamTokenColObj, String>>() { @Override public TableCell<ICFBamTokenColObj, String> call(TableColumn<ICFBamTokenColObj, String> arg) { return new CFTokenTableCell<ICFBamTokenColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnNullValue = new TableColumn<ICFBamTokenColObj, String>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTokenColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTokenColObj, String> p) { ICFBamTokenDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamTokenColObj, String>, TableCell<ICFBamTokenColObj, String>>() { @Override public TableCell<ICFBamTokenColObj, String> call(TableColumn<ICFBamTokenColObj, String> arg) { return new CFTokenTableCell<ICFBamTokenColObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamTokenColObj, String>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTokenColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTokenColObj, String> p) { ICFBamTokenDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamTokenColObj, String>, TableCell<ICFBamTokenColObj, String>>() { @Override public TableCell<ICFBamTokenColObj, String> call(TableColumn<ICFBamTokenColObj, String> arg) { return new CFTokenTableCell<ICFBamTokenColObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnShowLines = new TableColumn<ICFBamTokenColObj, Short>("Show Lines"); tableColumnShowLines.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTokenColObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamTokenColObj, Short> p) { ICFBamTokenDefObj obj = p.getValue(); if (obj == null) { return (null); } else { short value = obj.getRequiredShowLines(); Short wrapped = new Short(value); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(wrapped); return (observable); } } }); tableColumnShowLines.setCellFactory( new Callback<TableColumn<ICFBamTokenColObj, Short>, TableCell<ICFBamTokenColObj, Short>>() { @Override public TableCell<ICFBamTokenColObj, Short> call(TableColumn<ICFBamTokenColObj, Short> arg) { return new CFInt16TableCell<ICFBamTokenColObj>(); } }); dataTable.getColumns().add(tableColumnShowLines); tableColumnLookupDefSchema = new TableColumn<ICFBamTokenColObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTokenColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamTokenColObj, ICFBamSchemaDefObj> p) { ICFBamTokenColObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema(); ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupDefSchema.setCellFactory( new Callback<TableColumn<ICFBamTokenColObj, ICFBamSchemaDefObj>, TableCell<ICFBamTokenColObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamTokenColObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamTokenColObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamTokenColObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamTokenColObj>() { @Override public void changed(ObservableValue<? extends ICFBamTokenColObj> observable, ICFBamTokenColObj oldValue, ICFBamTokenColObj newValue) { setJavaFXFocus(newValue); } }); scrollMenu = new ScrollPane(); scrollMenu.setVbarPolicy(ScrollBarPolicy.NEVER); scrollMenu.setHbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollMenu.setFitToHeight(true); scrollMenu.setContent(getPanelHBoxMenu()); setTop(scrollMenu); setCenter(dataTable); javafxIsInitializing = false; if (observableListOfTokenCol != null) { dataTable.setItems(observableListOfTokenCol); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXInt32ColListPane.java
public CFBamJavaFXInt32ColListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamTableObj argContainer, ICFBamInt32ColObj argFocus, Collection<ICFBamInt32ColObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();/*from ww w . jav a 2 s . c o m*/ final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamInt32ColObj>(); tableColumnId = new TableColumn<ICFBamInt32ColObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32ColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamInt32ColObj, Long> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { long value = obj.getRequiredId(); Long wrapped = new Long(value); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(wrapped); return (observable); } } }); tableColumnId.setCellFactory( new Callback<TableColumn<ICFBamInt32ColObj, Long>, TableCell<ICFBamInt32ColObj, Long>>() { @Override public TableCell<ICFBamInt32ColObj, Long> call(TableColumn<ICFBamInt32ColObj, Long> arg) { return new CFInt64TableCell<ICFBamInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamInt32ColObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32ColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt32ColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getRequiredName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnName.setCellFactory( new Callback<TableColumn<ICFBamInt32ColObj, String>, TableCell<ICFBamInt32ColObj, String>>() { @Override public TableCell<ICFBamInt32ColObj, String> call(TableColumn<ICFBamInt32ColObj, String> arg) { return new CFStringTableCell<ICFBamInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamInt32ColObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32ColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt32ColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortName.setCellFactory( new Callback<TableColumn<ICFBamInt32ColObj, String>, TableCell<ICFBamInt32ColObj, String>>() { @Override public TableCell<ICFBamInt32ColObj, String> call(TableColumn<ICFBamInt32ColObj, String> arg) { return new CFStringTableCell<ICFBamInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamInt32ColObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32ColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt32ColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalLabel(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnLabel.setCellFactory( new Callback<TableColumn<ICFBamInt32ColObj, String>, TableCell<ICFBamInt32ColObj, String>>() { @Override public TableCell<ICFBamInt32ColObj, String> call(TableColumn<ICFBamInt32ColObj, String> arg) { return new CFStringTableCell<ICFBamInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamInt32ColObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32ColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt32ColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortDescription.setCellFactory( new Callback<TableColumn<ICFBamInt32ColObj, String>, TableCell<ICFBamInt32ColObj, String>>() { @Override public TableCell<ICFBamInt32ColObj, String> call(TableColumn<ICFBamInt32ColObj, String> arg) { return new CFStringTableCell<ICFBamInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamInt32ColObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32ColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt32ColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDescription.setCellFactory( new Callback<TableColumn<ICFBamInt32ColObj, String>, TableCell<ICFBamInt32ColObj, String>>() { @Override public TableCell<ICFBamInt32ColObj, String> call(TableColumn<ICFBamInt32ColObj, String> arg) { return new CFStringTableCell<ICFBamInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamInt32ColObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32ColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt32ColObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredIsNullable(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnIsNullable.setCellFactory( new Callback<TableColumn<ICFBamInt32ColObj, Boolean>, TableCell<ICFBamInt32ColObj, Boolean>>() { @Override public TableCell<ICFBamInt32ColObj, Boolean> call(TableColumn<ICFBamInt32ColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamInt32ColObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32ColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt32ColObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { Boolean value = obj.getOptionalGenerateId(); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(value); return (observable); } } }); tableColumnGenerateId.setCellFactory( new Callback<TableColumn<ICFBamInt32ColObj, Boolean>, TableCell<ICFBamInt32ColObj, Boolean>>() { @Override public TableCell<ICFBamInt32ColObj, Boolean> call(TableColumn<ICFBamInt32ColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamInt32ColObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32ColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt32ColObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredDefaultVisibility(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnDefaultVisibility.setCellFactory( new Callback<TableColumn<ICFBamInt32ColObj, Boolean>, TableCell<ICFBamInt32ColObj, Boolean>>() { @Override public TableCell<ICFBamInt32ColObj, Boolean> call(TableColumn<ICFBamInt32ColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamInt32ColObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32ColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt32ColObj, String> p) { ICFBamAtomObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDbName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDbName.setCellFactory( new Callback<TableColumn<ICFBamInt32ColObj, String>, TableCell<ICFBamInt32ColObj, String>>() { @Override public TableCell<ICFBamInt32ColObj, String> call(TableColumn<ICFBamInt32ColObj, String> arg) { return new CFStringTableCell<ICFBamInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamInt32ColObj, Integer>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32ColObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamInt32ColObj, Integer> p) { ICFBamInt32DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Integer value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamInt32ColObj, Integer>, TableCell<ICFBamInt32ColObj, Integer>>() { @Override public TableCell<ICFBamInt32ColObj, Integer> call(TableColumn<ICFBamInt32ColObj, Integer> arg) { return new CFInt32TableCell<ICFBamInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamInt32ColObj, Integer>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32ColObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamInt32ColObj, Integer> p) { ICFBamInt32DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Integer value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamInt32ColObj, Integer>, TableCell<ICFBamInt32ColObj, Integer>>() { @Override public TableCell<ICFBamInt32ColObj, Integer> call(TableColumn<ICFBamInt32ColObj, Integer> arg) { return new CFInt32TableCell<ICFBamInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamInt32ColObj, Integer>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32ColObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamInt32ColObj, Integer> p) { ICFBamInt32DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Integer value = obj.getOptionalMinValue(); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(value); return (observable); } } }); tableColumnMinValue.setCellFactory( new Callback<TableColumn<ICFBamInt32ColObj, Integer>, TableCell<ICFBamInt32ColObj, Integer>>() { @Override public TableCell<ICFBamInt32ColObj, Integer> call(TableColumn<ICFBamInt32ColObj, Integer> arg) { return new CFInt32TableCell<ICFBamInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamInt32ColObj, Integer>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32ColObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamInt32ColObj, Integer> p) { ICFBamInt32DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Integer value = obj.getOptionalMaxValue(); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(value); return (observable); } } }); tableColumnMaxValue.setCellFactory( new Callback<TableColumn<ICFBamInt32ColObj, Integer>, TableCell<ICFBamInt32ColObj, Integer>>() { @Override public TableCell<ICFBamInt32ColObj, Integer> call(TableColumn<ICFBamInt32ColObj, Integer> arg) { return new CFInt32TableCell<ICFBamInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamInt32ColObj, Integer>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32ColObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamInt32ColObj, Integer> p) { ICFBamInt32DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Integer value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamInt32ColObj, Integer>, TableCell<ICFBamInt32ColObj, Integer>>() { @Override public TableCell<ICFBamInt32ColObj, Integer> call(TableColumn<ICFBamInt32ColObj, Integer> arg) { return new CFInt32TableCell<ICFBamInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamInt32ColObj, Integer>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32ColObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamInt32ColObj, Integer> p) { ICFBamInt32DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Integer value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamInt32ColObj, Integer>, TableCell<ICFBamInt32ColObj, Integer>>() { @Override public TableCell<ICFBamInt32ColObj, Integer> call(TableColumn<ICFBamInt32ColObj, Integer> arg) { return new CFInt32TableCell<ICFBamInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamInt32ColObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt32ColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamInt32ColObj, ICFBamSchemaDefObj> p) { ICFBamInt32ColObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema(); ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupDefSchema.setCellFactory( new Callback<TableColumn<ICFBamInt32ColObj, ICFBamSchemaDefObj>, TableCell<ICFBamInt32ColObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamInt32ColObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamInt32ColObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamInt32ColObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamInt32ColObj>() { @Override public void changed(ObservableValue<? extends ICFBamInt32ColObj> observable, ICFBamInt32ColObj oldValue, ICFBamInt32ColObj newValue) { setJavaFXFocus(newValue); } }); scrollMenu = new ScrollPane(); scrollMenu.setVbarPolicy(ScrollBarPolicy.NEVER); scrollMenu.setHbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollMenu.setFitToHeight(true); scrollMenu.setContent(getPanelHBoxMenu()); setTop(scrollMenu); setCenter(dataTable); javafxIsInitializing = false; if (observableListOfInt32Col != null) { dataTable.setItems(observableListOfInt32Col); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXTextTypeListPane.java
public CFBamJavaFXTextTypeListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamSchemaDefObj argContainer, ICFBamTextTypeObj argFocus, Collection<ICFBamTextTypeObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();// ww w . j ava2s . com final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamTextTypeObj>(); tableColumnId = new TableColumn<ICFBamTextTypeObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTextTypeObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamTextTypeObj, Long> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { long value = obj.getRequiredId(); Long wrapped = new Long(value); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(wrapped); return (observable); } } }); tableColumnId.setCellFactory( new Callback<TableColumn<ICFBamTextTypeObj, Long>, TableCell<ICFBamTextTypeObj, Long>>() { @Override public TableCell<ICFBamTextTypeObj, Long> call(TableColumn<ICFBamTextTypeObj, Long> arg) { return new CFInt64TableCell<ICFBamTextTypeObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamTextTypeObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTextTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTextTypeObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getRequiredName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnName.setCellFactory( new Callback<TableColumn<ICFBamTextTypeObj, String>, TableCell<ICFBamTextTypeObj, String>>() { @Override public TableCell<ICFBamTextTypeObj, String> call(TableColumn<ICFBamTextTypeObj, String> arg) { return new CFStringTableCell<ICFBamTextTypeObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamTextTypeObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTextTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTextTypeObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortName.setCellFactory( new Callback<TableColumn<ICFBamTextTypeObj, String>, TableCell<ICFBamTextTypeObj, String>>() { @Override public TableCell<ICFBamTextTypeObj, String> call(TableColumn<ICFBamTextTypeObj, String> arg) { return new CFStringTableCell<ICFBamTextTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamTextTypeObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTextTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTextTypeObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalLabel(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnLabel.setCellFactory( new Callback<TableColumn<ICFBamTextTypeObj, String>, TableCell<ICFBamTextTypeObj, String>>() { @Override public TableCell<ICFBamTextTypeObj, String> call(TableColumn<ICFBamTextTypeObj, String> arg) { return new CFStringTableCell<ICFBamTextTypeObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamTextTypeObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTextTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTextTypeObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortDescription.setCellFactory( new Callback<TableColumn<ICFBamTextTypeObj, String>, TableCell<ICFBamTextTypeObj, String>>() { @Override public TableCell<ICFBamTextTypeObj, String> call(TableColumn<ICFBamTextTypeObj, String> arg) { return new CFStringTableCell<ICFBamTextTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamTextTypeObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTextTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTextTypeObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDescription.setCellFactory( new Callback<TableColumn<ICFBamTextTypeObj, String>, TableCell<ICFBamTextTypeObj, String>>() { @Override public TableCell<ICFBamTextTypeObj, String> call(TableColumn<ICFBamTextTypeObj, String> arg) { return new CFStringTableCell<ICFBamTextTypeObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamTextTypeObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTextTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTextTypeObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredIsNullable(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnIsNullable.setCellFactory( new Callback<TableColumn<ICFBamTextTypeObj, Boolean>, TableCell<ICFBamTextTypeObj, Boolean>>() { @Override public TableCell<ICFBamTextTypeObj, Boolean> call(TableColumn<ICFBamTextTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTextTypeObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamTextTypeObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTextTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTextTypeObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { Boolean value = obj.getOptionalGenerateId(); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(value); return (observable); } } }); tableColumnGenerateId.setCellFactory( new Callback<TableColumn<ICFBamTextTypeObj, Boolean>, TableCell<ICFBamTextTypeObj, Boolean>>() { @Override public TableCell<ICFBamTextTypeObj, Boolean> call(TableColumn<ICFBamTextTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTextTypeObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamTextTypeObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTextTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTextTypeObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredDefaultVisibility(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnDefaultVisibility.setCellFactory( new Callback<TableColumn<ICFBamTextTypeObj, Boolean>, TableCell<ICFBamTextTypeObj, Boolean>>() { @Override public TableCell<ICFBamTextTypeObj, Boolean> call(TableColumn<ICFBamTextTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTextTypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamTextTypeObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTextTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTextTypeObj, String> p) { ICFBamAtomObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDbName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDbName.setCellFactory( new Callback<TableColumn<ICFBamTextTypeObj, String>, TableCell<ICFBamTextTypeObj, String>>() { @Override public TableCell<ICFBamTextTypeObj, String> call(TableColumn<ICFBamTextTypeObj, String> arg) { return new CFStringTableCell<ICFBamTextTypeObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnMaxLen = new TableColumn<ICFBamTextTypeObj, Integer>("Max. Length"); tableColumnMaxLen.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTextTypeObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamTextTypeObj, Integer> p) { ICFBamTextDefObj obj = p.getValue(); if (obj == null) { return (null); } else { int value = obj.getRequiredMaxLen(); Integer wrapped = new Integer(value); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(wrapped); return (observable); } } }); tableColumnMaxLen.setCellFactory( new Callback<TableColumn<ICFBamTextTypeObj, Integer>, TableCell<ICFBamTextTypeObj, Integer>>() { @Override public TableCell<ICFBamTextTypeObj, Integer> call(TableColumn<ICFBamTextTypeObj, Integer> arg) { return new CFInt32TableCell<ICFBamTextTypeObj>(); } }); dataTable.getColumns().add(tableColumnMaxLen); tableColumnShowLines = new TableColumn<ICFBamTextTypeObj, Short>("Show Lines"); tableColumnShowLines.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTextTypeObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamTextTypeObj, Short> p) { ICFBamTextDefObj obj = p.getValue(); if (obj == null) { return (null); } else { short value = obj.getRequiredShowLines(); Short wrapped = new Short(value); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(wrapped); return (observable); } } }); tableColumnShowLines.setCellFactory( new Callback<TableColumn<ICFBamTextTypeObj, Short>, TableCell<ICFBamTextTypeObj, Short>>() { @Override public TableCell<ICFBamTextTypeObj, Short> call(TableColumn<ICFBamTextTypeObj, Short> arg) { return new CFInt16TableCell<ICFBamTextTypeObj>(); } }); dataTable.getColumns().add(tableColumnShowLines); tableColumnInitValue = new TableColumn<ICFBamTextTypeObj, String>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTextTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTextTypeObj, String> p) { ICFBamTextDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamTextTypeObj, String>, TableCell<ICFBamTextTypeObj, String>>() { @Override public TableCell<ICFBamTextTypeObj, String> call(TableColumn<ICFBamTextTypeObj, String> arg) { return new CFTextTableCell<ICFBamTextTypeObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamTextTypeObj, String>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTextTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTextTypeObj, String> p) { ICFBamTextDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamTextTypeObj, String>, TableCell<ICFBamTextTypeObj, String>>() { @Override public TableCell<ICFBamTextTypeObj, String> call(TableColumn<ICFBamTextTypeObj, String> arg) { return new CFTextTableCell<ICFBamTextTypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnNullValue = new TableColumn<ICFBamTextTypeObj, String>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTextTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTextTypeObj, String> p) { ICFBamTextDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamTextTypeObj, String>, TableCell<ICFBamTextTypeObj, String>>() { @Override public TableCell<ICFBamTextTypeObj, String> call(TableColumn<ICFBamTextTypeObj, String> arg) { return new CFTextTableCell<ICFBamTextTypeObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamTextTypeObj, String>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTextTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTextTypeObj, String> p) { ICFBamTextDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamTextTypeObj, String>, TableCell<ICFBamTextTypeObj, String>>() { @Override public TableCell<ICFBamTextTypeObj, String> call(TableColumn<ICFBamTextTypeObj, String> arg) { return new CFTextTableCell<ICFBamTextTypeObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamTextTypeObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTextTypeObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamTextTypeObj, ICFBamSchemaDefObj> p) { ICFBamTextTypeObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema(); ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupDefSchema.setCellFactory( new Callback<TableColumn<ICFBamTextTypeObj, ICFBamSchemaDefObj>, TableCell<ICFBamTextTypeObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamTextTypeObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamTextTypeObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamTextTypeObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamTextTypeObj>() { @Override public void changed(ObservableValue<? extends ICFBamTextTypeObj> observable, ICFBamTextTypeObj oldValue, ICFBamTextTypeObj newValue) { setJavaFXFocus(newValue); } }); scrollMenu = new ScrollPane(); scrollMenu.setVbarPolicy(ScrollBarPolicy.NEVER); scrollMenu.setHbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollMenu.setFitToHeight(true); scrollMenu.setContent(getPanelHBoxMenu()); setTop(scrollMenu); setCenter(dataTable); javafxIsInitializing = false; if (observableListOfTextType != null) { dataTable.setItems(observableListOfTextType); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXUInt32ColListPane.java
public CFBamJavaFXUInt32ColListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamTableObj argContainer, ICFBamUInt32ColObj argFocus, Collection<ICFBamUInt32ColObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();//from w w w. j a va 2s . co m final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamUInt32ColObj>(); tableColumnId = new TableColumn<ICFBamUInt32ColObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt32ColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamUInt32ColObj, Long> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { long value = obj.getRequiredId(); Long wrapped = new Long(value); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(wrapped); return (observable); } } }); tableColumnId.setCellFactory( new Callback<TableColumn<ICFBamUInt32ColObj, Long>, TableCell<ICFBamUInt32ColObj, Long>>() { @Override public TableCell<ICFBamUInt32ColObj, Long> call(TableColumn<ICFBamUInt32ColObj, Long> arg) { return new CFInt64TableCell<ICFBamUInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamUInt32ColObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt32ColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUInt32ColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getRequiredName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnName.setCellFactory( new Callback<TableColumn<ICFBamUInt32ColObj, String>, TableCell<ICFBamUInt32ColObj, String>>() { @Override public TableCell<ICFBamUInt32ColObj, String> call(TableColumn<ICFBamUInt32ColObj, String> arg) { return new CFStringTableCell<ICFBamUInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamUInt32ColObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt32ColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUInt32ColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortName.setCellFactory( new Callback<TableColumn<ICFBamUInt32ColObj, String>, TableCell<ICFBamUInt32ColObj, String>>() { @Override public TableCell<ICFBamUInt32ColObj, String> call(TableColumn<ICFBamUInt32ColObj, String> arg) { return new CFStringTableCell<ICFBamUInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamUInt32ColObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt32ColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUInt32ColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalLabel(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnLabel.setCellFactory( new Callback<TableColumn<ICFBamUInt32ColObj, String>, TableCell<ICFBamUInt32ColObj, String>>() { @Override public TableCell<ICFBamUInt32ColObj, String> call(TableColumn<ICFBamUInt32ColObj, String> arg) { return new CFStringTableCell<ICFBamUInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamUInt32ColObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt32ColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUInt32ColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortDescription.setCellFactory( new Callback<TableColumn<ICFBamUInt32ColObj, String>, TableCell<ICFBamUInt32ColObj, String>>() { @Override public TableCell<ICFBamUInt32ColObj, String> call(TableColumn<ICFBamUInt32ColObj, String> arg) { return new CFStringTableCell<ICFBamUInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamUInt32ColObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt32ColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUInt32ColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDescription.setCellFactory( new Callback<TableColumn<ICFBamUInt32ColObj, String>, TableCell<ICFBamUInt32ColObj, String>>() { @Override public TableCell<ICFBamUInt32ColObj, String> call(TableColumn<ICFBamUInt32ColObj, String> arg) { return new CFStringTableCell<ICFBamUInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamUInt32ColObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt32ColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUInt32ColObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredIsNullable(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnIsNullable.setCellFactory( new Callback<TableColumn<ICFBamUInt32ColObj, Boolean>, TableCell<ICFBamUInt32ColObj, Boolean>>() { @Override public TableCell<ICFBamUInt32ColObj, Boolean> call( TableColumn<ICFBamUInt32ColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamUInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamUInt32ColObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt32ColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUInt32ColObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { Boolean value = obj.getOptionalGenerateId(); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(value); return (observable); } } }); tableColumnGenerateId.setCellFactory( new Callback<TableColumn<ICFBamUInt32ColObj, Boolean>, TableCell<ICFBamUInt32ColObj, Boolean>>() { @Override public TableCell<ICFBamUInt32ColObj, Boolean> call( TableColumn<ICFBamUInt32ColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamUInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamUInt32ColObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt32ColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUInt32ColObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredDefaultVisibility(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnDefaultVisibility.setCellFactory( new Callback<TableColumn<ICFBamUInt32ColObj, Boolean>, TableCell<ICFBamUInt32ColObj, Boolean>>() { @Override public TableCell<ICFBamUInt32ColObj, Boolean> call( TableColumn<ICFBamUInt32ColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamUInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamUInt32ColObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt32ColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUInt32ColObj, String> p) { ICFBamAtomObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDbName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDbName.setCellFactory( new Callback<TableColumn<ICFBamUInt32ColObj, String>, TableCell<ICFBamUInt32ColObj, String>>() { @Override public TableCell<ICFBamUInt32ColObj, String> call(TableColumn<ICFBamUInt32ColObj, String> arg) { return new CFStringTableCell<ICFBamUInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamUInt32ColObj, Long>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt32ColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamUInt32ColObj, Long> p) { ICFBamUInt32DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Long value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamUInt32ColObj, Long>, TableCell<ICFBamUInt32ColObj, Long>>() { @Override public TableCell<ICFBamUInt32ColObj, Long> call(TableColumn<ICFBamUInt32ColObj, Long> arg) { return new CFUInt32TableCell<ICFBamUInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamUInt32ColObj, Long>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt32ColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamUInt32ColObj, Long> p) { ICFBamUInt32DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Long value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamUInt32ColObj, Long>, TableCell<ICFBamUInt32ColObj, Long>>() { @Override public TableCell<ICFBamUInt32ColObj, Long> call(TableColumn<ICFBamUInt32ColObj, Long> arg) { return new CFUInt32TableCell<ICFBamUInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamUInt32ColObj, Long>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt32ColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamUInt32ColObj, Long> p) { ICFBamUInt32DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Long value = obj.getOptionalMinValue(); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(value); return (observable); } } }); tableColumnMinValue.setCellFactory( new Callback<TableColumn<ICFBamUInt32ColObj, Long>, TableCell<ICFBamUInt32ColObj, Long>>() { @Override public TableCell<ICFBamUInt32ColObj, Long> call(TableColumn<ICFBamUInt32ColObj, Long> arg) { return new CFUInt32TableCell<ICFBamUInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamUInt32ColObj, Long>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt32ColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamUInt32ColObj, Long> p) { ICFBamUInt32DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Long value = obj.getOptionalMaxValue(); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(value); return (observable); } } }); tableColumnMaxValue.setCellFactory( new Callback<TableColumn<ICFBamUInt32ColObj, Long>, TableCell<ICFBamUInt32ColObj, Long>>() { @Override public TableCell<ICFBamUInt32ColObj, Long> call(TableColumn<ICFBamUInt32ColObj, Long> arg) { return new CFUInt32TableCell<ICFBamUInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamUInt32ColObj, Long>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt32ColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamUInt32ColObj, Long> p) { ICFBamUInt32DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Long value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamUInt32ColObj, Long>, TableCell<ICFBamUInt32ColObj, Long>>() { @Override public TableCell<ICFBamUInt32ColObj, Long> call(TableColumn<ICFBamUInt32ColObj, Long> arg) { return new CFUInt32TableCell<ICFBamUInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamUInt32ColObj, Long>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt32ColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamUInt32ColObj, Long> p) { ICFBamUInt32DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Long value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamUInt32ColObj, Long>, TableCell<ICFBamUInt32ColObj, Long>>() { @Override public TableCell<ICFBamUInt32ColObj, Long> call(TableColumn<ICFBamUInt32ColObj, Long> arg) { return new CFUInt32TableCell<ICFBamUInt32ColObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamUInt32ColObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt32ColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamUInt32ColObj, ICFBamSchemaDefObj> p) { ICFBamUInt32ColObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema(); ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupDefSchema.setCellFactory( new Callback<TableColumn<ICFBamUInt32ColObj, ICFBamSchemaDefObj>, TableCell<ICFBamUInt32ColObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamUInt32ColObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamUInt32ColObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamUInt32ColObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamUInt32ColObj>() { @Override public void changed(ObservableValue<? extends ICFBamUInt32ColObj> observable, ICFBamUInt32ColObj oldValue, ICFBamUInt32ColObj newValue) { setJavaFXFocus(newValue); } }); scrollMenu = new ScrollPane(); scrollMenu.setVbarPolicy(ScrollBarPolicy.NEVER); scrollMenu.setHbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollMenu.setFitToHeight(true); scrollMenu.setContent(getPanelHBoxMenu()); setTop(scrollMenu); setCenter(dataTable); javafxIsInitializing = false; if (observableListOfUInt32Col != null) { dataTable.setItems(observableListOfUInt32Col); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXDateTypeListPane.java
public CFBamJavaFXDateTypeListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamSchemaDefObj argContainer, ICFBamDateTypeObj argFocus, Collection<ICFBamDateTypeObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();// w ww.j av a 2s .com final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamDateTypeObj>(); tableColumnId = new TableColumn<ICFBamDateTypeObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateTypeObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamDateTypeObj, Long> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { long value = obj.getRequiredId(); Long wrapped = new Long(value); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(wrapped); return (observable); } } }); tableColumnId.setCellFactory( new Callback<TableColumn<ICFBamDateTypeObj, Long>, TableCell<ICFBamDateTypeObj, Long>>() { @Override public TableCell<ICFBamDateTypeObj, Long> call(TableColumn<ICFBamDateTypeObj, Long> arg) { return new CFInt64TableCell<ICFBamDateTypeObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamDateTypeObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamDateTypeObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getRequiredName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnName.setCellFactory( new Callback<TableColumn<ICFBamDateTypeObj, String>, TableCell<ICFBamDateTypeObj, String>>() { @Override public TableCell<ICFBamDateTypeObj, String> call(TableColumn<ICFBamDateTypeObj, String> arg) { return new CFStringTableCell<ICFBamDateTypeObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamDateTypeObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamDateTypeObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortName.setCellFactory( new Callback<TableColumn<ICFBamDateTypeObj, String>, TableCell<ICFBamDateTypeObj, String>>() { @Override public TableCell<ICFBamDateTypeObj, String> call(TableColumn<ICFBamDateTypeObj, String> arg) { return new CFStringTableCell<ICFBamDateTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamDateTypeObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamDateTypeObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalLabel(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnLabel.setCellFactory( new Callback<TableColumn<ICFBamDateTypeObj, String>, TableCell<ICFBamDateTypeObj, String>>() { @Override public TableCell<ICFBamDateTypeObj, String> call(TableColumn<ICFBamDateTypeObj, String> arg) { return new CFStringTableCell<ICFBamDateTypeObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamDateTypeObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamDateTypeObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortDescription.setCellFactory( new Callback<TableColumn<ICFBamDateTypeObj, String>, TableCell<ICFBamDateTypeObj, String>>() { @Override public TableCell<ICFBamDateTypeObj, String> call(TableColumn<ICFBamDateTypeObj, String> arg) { return new CFStringTableCell<ICFBamDateTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamDateTypeObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamDateTypeObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDescription.setCellFactory( new Callback<TableColumn<ICFBamDateTypeObj, String>, TableCell<ICFBamDateTypeObj, String>>() { @Override public TableCell<ICFBamDateTypeObj, String> call(TableColumn<ICFBamDateTypeObj, String> arg) { return new CFStringTableCell<ICFBamDateTypeObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamDateTypeObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamDateTypeObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredIsNullable(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnIsNullable.setCellFactory( new Callback<TableColumn<ICFBamDateTypeObj, Boolean>, TableCell<ICFBamDateTypeObj, Boolean>>() { @Override public TableCell<ICFBamDateTypeObj, Boolean> call(TableColumn<ICFBamDateTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamDateTypeObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamDateTypeObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamDateTypeObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { Boolean value = obj.getOptionalGenerateId(); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(value); return (observable); } } }); tableColumnGenerateId.setCellFactory( new Callback<TableColumn<ICFBamDateTypeObj, Boolean>, TableCell<ICFBamDateTypeObj, Boolean>>() { @Override public TableCell<ICFBamDateTypeObj, Boolean> call(TableColumn<ICFBamDateTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamDateTypeObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamDateTypeObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamDateTypeObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredDefaultVisibility(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnDefaultVisibility.setCellFactory( new Callback<TableColumn<ICFBamDateTypeObj, Boolean>, TableCell<ICFBamDateTypeObj, Boolean>>() { @Override public TableCell<ICFBamDateTypeObj, Boolean> call(TableColumn<ICFBamDateTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamDateTypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamDateTypeObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamDateTypeObj, String> p) { ICFBamAtomObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDbName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDbName.setCellFactory( new Callback<TableColumn<ICFBamDateTypeObj, String>, TableCell<ICFBamDateTypeObj, String>>() { @Override public TableCell<ICFBamDateTypeObj, String> call(TableColumn<ICFBamDateTypeObj, String> arg) { return new CFStringTableCell<ICFBamDateTypeObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamDateTypeObj, Calendar>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamDateTypeObj, Calendar> p) { ICFBamDateDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamDateTypeObj, Calendar>, TableCell<ICFBamDateTypeObj, Calendar>>() { @Override public TableCell<ICFBamDateTypeObj, Calendar> call( TableColumn<ICFBamDateTypeObj, Calendar> arg) { return new CFDateTableCell<ICFBamDateTypeObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamDateTypeObj, Calendar>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamDateTypeObj, Calendar> p) { ICFBamDateDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamDateTypeObj, Calendar>, TableCell<ICFBamDateTypeObj, Calendar>>() { @Override public TableCell<ICFBamDateTypeObj, Calendar> call( TableColumn<ICFBamDateTypeObj, Calendar> arg) { return new CFDateTableCell<ICFBamDateTypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamDateTypeObj, Calendar>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamDateTypeObj, Calendar> p) { ICFBamDateDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalMinValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnMinValue.setCellFactory( new Callback<TableColumn<ICFBamDateTypeObj, Calendar>, TableCell<ICFBamDateTypeObj, Calendar>>() { @Override public TableCell<ICFBamDateTypeObj, Calendar> call( TableColumn<ICFBamDateTypeObj, Calendar> arg) { return new CFDateTableCell<ICFBamDateTypeObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamDateTypeObj, Calendar>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamDateTypeObj, Calendar> p) { ICFBamDateDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalMaxValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnMaxValue.setCellFactory( new Callback<TableColumn<ICFBamDateTypeObj, Calendar>, TableCell<ICFBamDateTypeObj, Calendar>>() { @Override public TableCell<ICFBamDateTypeObj, Calendar> call( TableColumn<ICFBamDateTypeObj, Calendar> arg) { return new CFDateTableCell<ICFBamDateTypeObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamDateTypeObj, Calendar>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamDateTypeObj, Calendar> p) { ICFBamDateDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamDateTypeObj, Calendar>, TableCell<ICFBamDateTypeObj, Calendar>>() { @Override public TableCell<ICFBamDateTypeObj, Calendar> call( TableColumn<ICFBamDateTypeObj, Calendar> arg) { return new CFDateTableCell<ICFBamDateTypeObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamDateTypeObj, Calendar>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamDateTypeObj, Calendar> p) { ICFBamDateDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamDateTypeObj, Calendar>, TableCell<ICFBamDateTypeObj, Calendar>>() { @Override public TableCell<ICFBamDateTypeObj, Calendar> call( TableColumn<ICFBamDateTypeObj, Calendar> arg) { return new CFDateTableCell<ICFBamDateTypeObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamDateTypeObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateTypeObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamDateTypeObj, ICFBamSchemaDefObj> p) { ICFBamDateTypeObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema(); ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupDefSchema.setCellFactory( new Callback<TableColumn<ICFBamDateTypeObj, ICFBamSchemaDefObj>, TableCell<ICFBamDateTypeObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamDateTypeObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamDateTypeObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamDateTypeObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamDateTypeObj>() { @Override public void changed(ObservableValue<? extends ICFBamDateTypeObj> observable, ICFBamDateTypeObj oldValue, ICFBamDateTypeObj newValue) { setJavaFXFocus(newValue); } }); scrollMenu = new ScrollPane(); scrollMenu.setVbarPolicy(ScrollBarPolicy.NEVER); scrollMenu.setHbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollMenu.setFitToHeight(true); scrollMenu.setContent(getPanelHBoxMenu()); setTop(scrollMenu); setCenter(dataTable); javafxIsInitializing = false; if (observableListOfDateType != null) { dataTable.setItems(observableListOfDateType); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXDoubleColListPane.java
public CFBamJavaFXDoubleColListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamTableObj argContainer, ICFBamDoubleColObj argFocus, Collection<ICFBamDoubleColObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();// w ww. j a v a 2s . co m final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamDoubleColObj>(); tableColumnId = new TableColumn<ICFBamDoubleColObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDoubleColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamDoubleColObj, Long> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { long value = obj.getRequiredId(); Long wrapped = new Long(value); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(wrapped); return (observable); } } }); tableColumnId.setCellFactory( new Callback<TableColumn<ICFBamDoubleColObj, Long>, TableCell<ICFBamDoubleColObj, Long>>() { @Override public TableCell<ICFBamDoubleColObj, Long> call(TableColumn<ICFBamDoubleColObj, Long> arg) { return new CFInt64TableCell<ICFBamDoubleColObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamDoubleColObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDoubleColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamDoubleColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getRequiredName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnName.setCellFactory( new Callback<TableColumn<ICFBamDoubleColObj, String>, TableCell<ICFBamDoubleColObj, String>>() { @Override public TableCell<ICFBamDoubleColObj, String> call(TableColumn<ICFBamDoubleColObj, String> arg) { return new CFStringTableCell<ICFBamDoubleColObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamDoubleColObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDoubleColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamDoubleColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortName.setCellFactory( new Callback<TableColumn<ICFBamDoubleColObj, String>, TableCell<ICFBamDoubleColObj, String>>() { @Override public TableCell<ICFBamDoubleColObj, String> call(TableColumn<ICFBamDoubleColObj, String> arg) { return new CFStringTableCell<ICFBamDoubleColObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamDoubleColObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDoubleColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamDoubleColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalLabel(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnLabel.setCellFactory( new Callback<TableColumn<ICFBamDoubleColObj, String>, TableCell<ICFBamDoubleColObj, String>>() { @Override public TableCell<ICFBamDoubleColObj, String> call(TableColumn<ICFBamDoubleColObj, String> arg) { return new CFStringTableCell<ICFBamDoubleColObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamDoubleColObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDoubleColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamDoubleColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortDescription.setCellFactory( new Callback<TableColumn<ICFBamDoubleColObj, String>, TableCell<ICFBamDoubleColObj, String>>() { @Override public TableCell<ICFBamDoubleColObj, String> call(TableColumn<ICFBamDoubleColObj, String> arg) { return new CFStringTableCell<ICFBamDoubleColObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamDoubleColObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDoubleColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamDoubleColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDescription.setCellFactory( new Callback<TableColumn<ICFBamDoubleColObj, String>, TableCell<ICFBamDoubleColObj, String>>() { @Override public TableCell<ICFBamDoubleColObj, String> call(TableColumn<ICFBamDoubleColObj, String> arg) { return new CFStringTableCell<ICFBamDoubleColObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamDoubleColObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDoubleColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamDoubleColObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredIsNullable(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnIsNullable.setCellFactory( new Callback<TableColumn<ICFBamDoubleColObj, Boolean>, TableCell<ICFBamDoubleColObj, Boolean>>() { @Override public TableCell<ICFBamDoubleColObj, Boolean> call( TableColumn<ICFBamDoubleColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamDoubleColObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamDoubleColObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDoubleColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamDoubleColObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { Boolean value = obj.getOptionalGenerateId(); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(value); return (observable); } } }); tableColumnGenerateId.setCellFactory( new Callback<TableColumn<ICFBamDoubleColObj, Boolean>, TableCell<ICFBamDoubleColObj, Boolean>>() { @Override public TableCell<ICFBamDoubleColObj, Boolean> call( TableColumn<ICFBamDoubleColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamDoubleColObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamDoubleColObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDoubleColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamDoubleColObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredDefaultVisibility(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnDefaultVisibility.setCellFactory( new Callback<TableColumn<ICFBamDoubleColObj, Boolean>, TableCell<ICFBamDoubleColObj, Boolean>>() { @Override public TableCell<ICFBamDoubleColObj, Boolean> call( TableColumn<ICFBamDoubleColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamDoubleColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamDoubleColObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDoubleColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamDoubleColObj, String> p) { ICFBamAtomObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDbName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDbName.setCellFactory( new Callback<TableColumn<ICFBamDoubleColObj, String>, TableCell<ICFBamDoubleColObj, String>>() { @Override public TableCell<ICFBamDoubleColObj, String> call(TableColumn<ICFBamDoubleColObj, String> arg) { return new CFStringTableCell<ICFBamDoubleColObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamDoubleColObj, Double>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDoubleColObj, Double>, ObservableValue<Double>>() { public ObservableValue<Double> call(CellDataFeatures<ICFBamDoubleColObj, Double> p) { ICFBamDoubleDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Double value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<Double> observable = new ReadOnlyObjectWrapper<Double>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamDoubleColObj, Double>, TableCell<ICFBamDoubleColObj, Double>>() { @Override public TableCell<ICFBamDoubleColObj, Double> call(TableColumn<ICFBamDoubleColObj, Double> arg) { return new CFDoubleTableCell<ICFBamDoubleColObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamDoubleColObj, Double>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDoubleColObj, Double>, ObservableValue<Double>>() { public ObservableValue<Double> call(CellDataFeatures<ICFBamDoubleColObj, Double> p) { ICFBamDoubleDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Double value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<Double> observable = new ReadOnlyObjectWrapper<Double>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamDoubleColObj, Double>, TableCell<ICFBamDoubleColObj, Double>>() { @Override public TableCell<ICFBamDoubleColObj, Double> call(TableColumn<ICFBamDoubleColObj, Double> arg) { return new CFDoubleTableCell<ICFBamDoubleColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamDoubleColObj, Double>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDoubleColObj, Double>, ObservableValue<Double>>() { public ObservableValue<Double> call(CellDataFeatures<ICFBamDoubleColObj, Double> p) { ICFBamDoubleDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Double value = obj.getOptionalMinValue(); ReadOnlyObjectWrapper<Double> observable = new ReadOnlyObjectWrapper<Double>(); observable.setValue(value); return (observable); } } }); tableColumnMinValue.setCellFactory( new Callback<TableColumn<ICFBamDoubleColObj, Double>, TableCell<ICFBamDoubleColObj, Double>>() { @Override public TableCell<ICFBamDoubleColObj, Double> call(TableColumn<ICFBamDoubleColObj, Double> arg) { return new CFDoubleTableCell<ICFBamDoubleColObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamDoubleColObj, Double>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDoubleColObj, Double>, ObservableValue<Double>>() { public ObservableValue<Double> call(CellDataFeatures<ICFBamDoubleColObj, Double> p) { ICFBamDoubleDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Double value = obj.getOptionalMaxValue(); ReadOnlyObjectWrapper<Double> observable = new ReadOnlyObjectWrapper<Double>(); observable.setValue(value); return (observable); } } }); tableColumnMaxValue.setCellFactory( new Callback<TableColumn<ICFBamDoubleColObj, Double>, TableCell<ICFBamDoubleColObj, Double>>() { @Override public TableCell<ICFBamDoubleColObj, Double> call(TableColumn<ICFBamDoubleColObj, Double> arg) { return new CFDoubleTableCell<ICFBamDoubleColObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamDoubleColObj, Double>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDoubleColObj, Double>, ObservableValue<Double>>() { public ObservableValue<Double> call(CellDataFeatures<ICFBamDoubleColObj, Double> p) { ICFBamDoubleDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Double value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<Double> observable = new ReadOnlyObjectWrapper<Double>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamDoubleColObj, Double>, TableCell<ICFBamDoubleColObj, Double>>() { @Override public TableCell<ICFBamDoubleColObj, Double> call(TableColumn<ICFBamDoubleColObj, Double> arg) { return new CFDoubleTableCell<ICFBamDoubleColObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamDoubleColObj, Double>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDoubleColObj, Double>, ObservableValue<Double>>() { public ObservableValue<Double> call(CellDataFeatures<ICFBamDoubleColObj, Double> p) { ICFBamDoubleDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Double value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<Double> observable = new ReadOnlyObjectWrapper<Double>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamDoubleColObj, Double>, TableCell<ICFBamDoubleColObj, Double>>() { @Override public TableCell<ICFBamDoubleColObj, Double> call(TableColumn<ICFBamDoubleColObj, Double> arg) { return new CFDoubleTableCell<ICFBamDoubleColObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamDoubleColObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDoubleColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamDoubleColObj, ICFBamSchemaDefObj> p) { ICFBamDoubleColObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema(); ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupDefSchema.setCellFactory( new Callback<TableColumn<ICFBamDoubleColObj, ICFBamSchemaDefObj>, TableCell<ICFBamDoubleColObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamDoubleColObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamDoubleColObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamDoubleColObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamDoubleColObj>() { @Override public void changed(ObservableValue<? extends ICFBamDoubleColObj> observable, ICFBamDoubleColObj oldValue, ICFBamDoubleColObj newValue) { setJavaFXFocus(newValue); } }); scrollMenu = new ScrollPane(); scrollMenu.setVbarPolicy(ScrollBarPolicy.NEVER); scrollMenu.setHbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollMenu.setFitToHeight(true); scrollMenu.setContent(getPanelHBoxMenu()); setTop(scrollMenu); setCenter(dataTable); javafxIsInitializing = false; if (observableListOfDoubleCol != null) { dataTable.setItems(observableListOfDoubleCol); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXFloatTypeListPane.java
public CFBamJavaFXFloatTypeListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamSchemaDefObj argContainer, ICFBamFloatTypeObj argFocus, Collection<ICFBamFloatTypeObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();/*w w w . j a va 2s . c om*/ final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamFloatTypeObj>(); tableColumnId = new TableColumn<ICFBamFloatTypeObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatTypeObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamFloatTypeObj, Long> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { long value = obj.getRequiredId(); Long wrapped = new Long(value); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(wrapped); return (observable); } } }); tableColumnId.setCellFactory( new Callback<TableColumn<ICFBamFloatTypeObj, Long>, TableCell<ICFBamFloatTypeObj, Long>>() { @Override public TableCell<ICFBamFloatTypeObj, Long> call(TableColumn<ICFBamFloatTypeObj, Long> arg) { return new CFInt64TableCell<ICFBamFloatTypeObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamFloatTypeObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamFloatTypeObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getRequiredName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnName.setCellFactory( new Callback<TableColumn<ICFBamFloatTypeObj, String>, TableCell<ICFBamFloatTypeObj, String>>() { @Override public TableCell<ICFBamFloatTypeObj, String> call(TableColumn<ICFBamFloatTypeObj, String> arg) { return new CFStringTableCell<ICFBamFloatTypeObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamFloatTypeObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamFloatTypeObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortName.setCellFactory( new Callback<TableColumn<ICFBamFloatTypeObj, String>, TableCell<ICFBamFloatTypeObj, String>>() { @Override public TableCell<ICFBamFloatTypeObj, String> call(TableColumn<ICFBamFloatTypeObj, String> arg) { return new CFStringTableCell<ICFBamFloatTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamFloatTypeObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamFloatTypeObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalLabel(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnLabel.setCellFactory( new Callback<TableColumn<ICFBamFloatTypeObj, String>, TableCell<ICFBamFloatTypeObj, String>>() { @Override public TableCell<ICFBamFloatTypeObj, String> call(TableColumn<ICFBamFloatTypeObj, String> arg) { return new CFStringTableCell<ICFBamFloatTypeObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamFloatTypeObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamFloatTypeObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortDescription.setCellFactory( new Callback<TableColumn<ICFBamFloatTypeObj, String>, TableCell<ICFBamFloatTypeObj, String>>() { @Override public TableCell<ICFBamFloatTypeObj, String> call(TableColumn<ICFBamFloatTypeObj, String> arg) { return new CFStringTableCell<ICFBamFloatTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamFloatTypeObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamFloatTypeObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDescription.setCellFactory( new Callback<TableColumn<ICFBamFloatTypeObj, String>, TableCell<ICFBamFloatTypeObj, String>>() { @Override public TableCell<ICFBamFloatTypeObj, String> call(TableColumn<ICFBamFloatTypeObj, String> arg) { return new CFStringTableCell<ICFBamFloatTypeObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamFloatTypeObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamFloatTypeObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredIsNullable(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnIsNullable.setCellFactory( new Callback<TableColumn<ICFBamFloatTypeObj, Boolean>, TableCell<ICFBamFloatTypeObj, Boolean>>() { @Override public TableCell<ICFBamFloatTypeObj, Boolean> call( TableColumn<ICFBamFloatTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamFloatTypeObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamFloatTypeObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamFloatTypeObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { Boolean value = obj.getOptionalGenerateId(); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(value); return (observable); } } }); tableColumnGenerateId.setCellFactory( new Callback<TableColumn<ICFBamFloatTypeObj, Boolean>, TableCell<ICFBamFloatTypeObj, Boolean>>() { @Override public TableCell<ICFBamFloatTypeObj, Boolean> call( TableColumn<ICFBamFloatTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamFloatTypeObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamFloatTypeObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamFloatTypeObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredDefaultVisibility(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnDefaultVisibility.setCellFactory( new Callback<TableColumn<ICFBamFloatTypeObj, Boolean>, TableCell<ICFBamFloatTypeObj, Boolean>>() { @Override public TableCell<ICFBamFloatTypeObj, Boolean> call( TableColumn<ICFBamFloatTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamFloatTypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamFloatTypeObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamFloatTypeObj, String> p) { ICFBamAtomObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDbName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDbName.setCellFactory( new Callback<TableColumn<ICFBamFloatTypeObj, String>, TableCell<ICFBamFloatTypeObj, String>>() { @Override public TableCell<ICFBamFloatTypeObj, String> call(TableColumn<ICFBamFloatTypeObj, String> arg) { return new CFStringTableCell<ICFBamFloatTypeObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamFloatTypeObj, Float>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatTypeObj, Float>, ObservableValue<Float>>() { public ObservableValue<Float> call(CellDataFeatures<ICFBamFloatTypeObj, Float> p) { ICFBamFloatDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Float value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<Float> observable = new ReadOnlyObjectWrapper<Float>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamFloatTypeObj, Float>, TableCell<ICFBamFloatTypeObj, Float>>() { @Override public TableCell<ICFBamFloatTypeObj, Float> call(TableColumn<ICFBamFloatTypeObj, Float> arg) { return new CFFloatTableCell<ICFBamFloatTypeObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamFloatTypeObj, Float>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatTypeObj, Float>, ObservableValue<Float>>() { public ObservableValue<Float> call(CellDataFeatures<ICFBamFloatTypeObj, Float> p) { ICFBamFloatDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Float value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<Float> observable = new ReadOnlyObjectWrapper<Float>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamFloatTypeObj, Float>, TableCell<ICFBamFloatTypeObj, Float>>() { @Override public TableCell<ICFBamFloatTypeObj, Float> call(TableColumn<ICFBamFloatTypeObj, Float> arg) { return new CFFloatTableCell<ICFBamFloatTypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamFloatTypeObj, Float>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatTypeObj, Float>, ObservableValue<Float>>() { public ObservableValue<Float> call(CellDataFeatures<ICFBamFloatTypeObj, Float> p) { ICFBamFloatDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Float value = obj.getOptionalMinValue(); ReadOnlyObjectWrapper<Float> observable = new ReadOnlyObjectWrapper<Float>(); observable.setValue(value); return (observable); } } }); tableColumnMinValue.setCellFactory( new Callback<TableColumn<ICFBamFloatTypeObj, Float>, TableCell<ICFBamFloatTypeObj, Float>>() { @Override public TableCell<ICFBamFloatTypeObj, Float> call(TableColumn<ICFBamFloatTypeObj, Float> arg) { return new CFFloatTableCell<ICFBamFloatTypeObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamFloatTypeObj, Float>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatTypeObj, Float>, ObservableValue<Float>>() { public ObservableValue<Float> call(CellDataFeatures<ICFBamFloatTypeObj, Float> p) { ICFBamFloatDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Float value = obj.getOptionalMaxValue(); ReadOnlyObjectWrapper<Float> observable = new ReadOnlyObjectWrapper<Float>(); observable.setValue(value); return (observable); } } }); tableColumnMaxValue.setCellFactory( new Callback<TableColumn<ICFBamFloatTypeObj, Float>, TableCell<ICFBamFloatTypeObj, Float>>() { @Override public TableCell<ICFBamFloatTypeObj, Float> call(TableColumn<ICFBamFloatTypeObj, Float> arg) { return new CFFloatTableCell<ICFBamFloatTypeObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamFloatTypeObj, Float>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatTypeObj, Float>, ObservableValue<Float>>() { public ObservableValue<Float> call(CellDataFeatures<ICFBamFloatTypeObj, Float> p) { ICFBamFloatDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Float value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<Float> observable = new ReadOnlyObjectWrapper<Float>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamFloatTypeObj, Float>, TableCell<ICFBamFloatTypeObj, Float>>() { @Override public TableCell<ICFBamFloatTypeObj, Float> call(TableColumn<ICFBamFloatTypeObj, Float> arg) { return new CFFloatTableCell<ICFBamFloatTypeObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamFloatTypeObj, Float>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatTypeObj, Float>, ObservableValue<Float>>() { public ObservableValue<Float> call(CellDataFeatures<ICFBamFloatTypeObj, Float> p) { ICFBamFloatDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Float value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<Float> observable = new ReadOnlyObjectWrapper<Float>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamFloatTypeObj, Float>, TableCell<ICFBamFloatTypeObj, Float>>() { @Override public TableCell<ICFBamFloatTypeObj, Float> call(TableColumn<ICFBamFloatTypeObj, Float> arg) { return new CFFloatTableCell<ICFBamFloatTypeObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamFloatTypeObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatTypeObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamFloatTypeObj, ICFBamSchemaDefObj> p) { ICFBamFloatTypeObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema(); ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupDefSchema.setCellFactory( new Callback<TableColumn<ICFBamFloatTypeObj, ICFBamSchemaDefObj>, TableCell<ICFBamFloatTypeObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamFloatTypeObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamFloatTypeObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamFloatTypeObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamFloatTypeObj>() { @Override public void changed(ObservableValue<? extends ICFBamFloatTypeObj> observable, ICFBamFloatTypeObj oldValue, ICFBamFloatTypeObj newValue) { setJavaFXFocus(newValue); } }); scrollMenu = new ScrollPane(); scrollMenu.setVbarPolicy(ScrollBarPolicy.NEVER); scrollMenu.setHbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollMenu.setFitToHeight(true); scrollMenu.setContent(getPanelHBoxMenu()); setTop(scrollMenu); setCenter(dataTable); javafxIsInitializing = false; if (observableListOfFloatType != null) { dataTable.setItems(observableListOfFloatType); } adjustListButtons(); }