List of usage examples for javafx.scene.control ScrollPane ScrollPane
public ScrollPane()
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXUInt16DefListPane.java
public CFBamJavaFXUInt16DefListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamScopeObj argContainer, ICFBamUInt16DefObj argFocus, Collection<ICFBamUInt16DefObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();// w ww . ja v 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<ICFBamUInt16DefObj>(); tableColumnObjKind = new TableColumn<ICFBamUInt16DefObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamUInt16DefObj, String> p) { ICFBamUInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { String classCode = obj.getClassCode(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(classCode); return (observable); } } }); tableColumnObjKind.setCellFactory( new Callback<TableColumn<ICFBamUInt16DefObj, String>, TableCell<ICFBamUInt16DefObj, String>>() { @Override public TableCell<ICFBamUInt16DefObj, String> call(TableColumn<ICFBamUInt16DefObj, String> arg) { return new CFStringTableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamUInt16DefObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamUInt16DefObj, 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<ICFBamUInt16DefObj, Long>, TableCell<ICFBamUInt16DefObj, Long>>() { @Override public TableCell<ICFBamUInt16DefObj, Long> call(TableColumn<ICFBamUInt16DefObj, Long> arg) { return new CFInt64TableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamUInt16DefObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUInt16DefObj, 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<ICFBamUInt16DefObj, String>, TableCell<ICFBamUInt16DefObj, String>>() { @Override public TableCell<ICFBamUInt16DefObj, String> call(TableColumn<ICFBamUInt16DefObj, String> arg) { return new CFStringTableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamUInt16DefObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUInt16DefObj, 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<ICFBamUInt16DefObj, String>, TableCell<ICFBamUInt16DefObj, String>>() { @Override public TableCell<ICFBamUInt16DefObj, String> call(TableColumn<ICFBamUInt16DefObj, String> arg) { return new CFStringTableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamUInt16DefObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUInt16DefObj, 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<ICFBamUInt16DefObj, String>, TableCell<ICFBamUInt16DefObj, String>>() { @Override public TableCell<ICFBamUInt16DefObj, String> call(TableColumn<ICFBamUInt16DefObj, String> arg) { return new CFStringTableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamUInt16DefObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUInt16DefObj, 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<ICFBamUInt16DefObj, String>, TableCell<ICFBamUInt16DefObj, String>>() { @Override public TableCell<ICFBamUInt16DefObj, String> call(TableColumn<ICFBamUInt16DefObj, String> arg) { return new CFStringTableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamUInt16DefObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUInt16DefObj, 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<ICFBamUInt16DefObj, String>, TableCell<ICFBamUInt16DefObj, String>>() { @Override public TableCell<ICFBamUInt16DefObj, String> call(TableColumn<ICFBamUInt16DefObj, String> arg) { return new CFStringTableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamUInt16DefObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUInt16DefObj, 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<ICFBamUInt16DefObj, Boolean>, TableCell<ICFBamUInt16DefObj, Boolean>>() { @Override public TableCell<ICFBamUInt16DefObj, Boolean> call( TableColumn<ICFBamUInt16DefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamUInt16DefObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUInt16DefObj, 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<ICFBamUInt16DefObj, Boolean>, TableCell<ICFBamUInt16DefObj, Boolean>>() { @Override public TableCell<ICFBamUInt16DefObj, Boolean> call( TableColumn<ICFBamUInt16DefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamUInt16DefObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUInt16DefObj, 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<ICFBamUInt16DefObj, Boolean>, TableCell<ICFBamUInt16DefObj, Boolean>>() { @Override public TableCell<ICFBamUInt16DefObj, Boolean> call( TableColumn<ICFBamUInt16DefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamUInt16DefObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUInt16DefObj, 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<ICFBamUInt16DefObj, String>, TableCell<ICFBamUInt16DefObj, String>>() { @Override public TableCell<ICFBamUInt16DefObj, String> call(TableColumn<ICFBamUInt16DefObj, String> arg) { return new CFStringTableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamUInt16DefObj, Integer>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamUInt16DefObj, Integer> p) { ICFBamUInt16DefObj 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<ICFBamUInt16DefObj, Integer>, TableCell<ICFBamUInt16DefObj, Integer>>() { @Override public TableCell<ICFBamUInt16DefObj, Integer> call( TableColumn<ICFBamUInt16DefObj, Integer> arg) { return new CFUInt16TableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamUInt16DefObj, Integer>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamUInt16DefObj, Integer> p) { ICFBamUInt16DefObj 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<ICFBamUInt16DefObj, Integer>, TableCell<ICFBamUInt16DefObj, Integer>>() { @Override public TableCell<ICFBamUInt16DefObj, Integer> call( TableColumn<ICFBamUInt16DefObj, Integer> arg) { return new CFUInt16TableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamUInt16DefObj, Integer>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamUInt16DefObj, Integer> p) { ICFBamUInt16DefObj 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<ICFBamUInt16DefObj, Integer>, TableCell<ICFBamUInt16DefObj, Integer>>() { @Override public TableCell<ICFBamUInt16DefObj, Integer> call( TableColumn<ICFBamUInt16DefObj, Integer> arg) { return new CFUInt16TableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamUInt16DefObj, Integer>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamUInt16DefObj, Integer> p) { ICFBamUInt16DefObj 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<ICFBamUInt16DefObj, Integer>, TableCell<ICFBamUInt16DefObj, Integer>>() { @Override public TableCell<ICFBamUInt16DefObj, Integer> call( TableColumn<ICFBamUInt16DefObj, Integer> arg) { return new CFUInt16TableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamUInt16DefObj, Integer>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamUInt16DefObj, Integer> p) { ICFBamUInt16DefObj 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<ICFBamUInt16DefObj, Integer>, TableCell<ICFBamUInt16DefObj, Integer>>() { @Override public TableCell<ICFBamUInt16DefObj, Integer> call( TableColumn<ICFBamUInt16DefObj, Integer> arg) { return new CFUInt16TableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamUInt16DefObj, Integer>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamUInt16DefObj, Integer> p) { ICFBamUInt16DefObj 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<ICFBamUInt16DefObj, Integer>, TableCell<ICFBamUInt16DefObj, Integer>>() { @Override public TableCell<ICFBamUInt16DefObj, Integer> call( TableColumn<ICFBamUInt16DefObj, Integer> arg) { return new CFUInt16TableCell<ICFBamUInt16DefObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamUInt16DefObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt16DefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamUInt16DefObj, ICFBamSchemaDefObj> p) { ICFBamUInt16DefObj 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<ICFBamUInt16DefObj, ICFBamSchemaDefObj>, TableCell<ICFBamUInt16DefObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamUInt16DefObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamUInt16DefObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamUInt16DefObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamUInt16DefObj>() { @Override public void changed(ObservableValue<? extends ICFBamUInt16DefObj> observable, ICFBamUInt16DefObj oldValue, ICFBamUInt16DefObj 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 (observableListOfUInt16Def != null) { dataTable.setItems(observableListOfUInt16Def); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXTZDateDefListPane.java
public CFBamJavaFXTZDateDefListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamScopeObj argContainer, ICFBamTZDateDefObj argFocus, Collection<ICFBamTZDateDefObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();/* w w w . 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<ICFBamTZDateDefObj>(); tableColumnObjKind = new TableColumn<ICFBamTZDateDefObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamTZDateDefObj, String> p) { ICFBamTZDateDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String classCode = obj.getClassCode(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(classCode); return (observable); } } }); tableColumnObjKind.setCellFactory( new Callback<TableColumn<ICFBamTZDateDefObj, String>, TableCell<ICFBamTZDateDefObj, String>>() { @Override public TableCell<ICFBamTZDateDefObj, String> call(TableColumn<ICFBamTZDateDefObj, String> arg) { return new CFStringTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamTZDateDefObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamTZDateDefObj, 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<ICFBamTZDateDefObj, Long>, TableCell<ICFBamTZDateDefObj, Long>>() { @Override public TableCell<ICFBamTZDateDefObj, Long> call(TableColumn<ICFBamTZDateDefObj, Long> arg) { return new CFInt64TableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamTZDateDefObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZDateDefObj, 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<ICFBamTZDateDefObj, String>, TableCell<ICFBamTZDateDefObj, String>>() { @Override public TableCell<ICFBamTZDateDefObj, String> call(TableColumn<ICFBamTZDateDefObj, String> arg) { return new CFStringTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamTZDateDefObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZDateDefObj, 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<ICFBamTZDateDefObj, String>, TableCell<ICFBamTZDateDefObj, String>>() { @Override public TableCell<ICFBamTZDateDefObj, String> call(TableColumn<ICFBamTZDateDefObj, String> arg) { return new CFStringTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamTZDateDefObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZDateDefObj, 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<ICFBamTZDateDefObj, String>, TableCell<ICFBamTZDateDefObj, String>>() { @Override public TableCell<ICFBamTZDateDefObj, String> call(TableColumn<ICFBamTZDateDefObj, String> arg) { return new CFStringTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamTZDateDefObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZDateDefObj, 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<ICFBamTZDateDefObj, String>, TableCell<ICFBamTZDateDefObj, String>>() { @Override public TableCell<ICFBamTZDateDefObj, String> call(TableColumn<ICFBamTZDateDefObj, String> arg) { return new CFStringTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamTZDateDefObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZDateDefObj, 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<ICFBamTZDateDefObj, String>, TableCell<ICFBamTZDateDefObj, String>>() { @Override public TableCell<ICFBamTZDateDefObj, String> call(TableColumn<ICFBamTZDateDefObj, String> arg) { return new CFStringTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamTZDateDefObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZDateDefObj, 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<ICFBamTZDateDefObj, Boolean>, TableCell<ICFBamTZDateDefObj, Boolean>>() { @Override public TableCell<ICFBamTZDateDefObj, Boolean> call( TableColumn<ICFBamTZDateDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamTZDateDefObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZDateDefObj, 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<ICFBamTZDateDefObj, Boolean>, TableCell<ICFBamTZDateDefObj, Boolean>>() { @Override public TableCell<ICFBamTZDateDefObj, Boolean> call( TableColumn<ICFBamTZDateDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamTZDateDefObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZDateDefObj, 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<ICFBamTZDateDefObj, Boolean>, TableCell<ICFBamTZDateDefObj, Boolean>>() { @Override public TableCell<ICFBamTZDateDefObj, Boolean> call( TableColumn<ICFBamTZDateDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamTZDateDefObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZDateDefObj, 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<ICFBamTZDateDefObj, String>, TableCell<ICFBamTZDateDefObj, String>>() { @Override public TableCell<ICFBamTZDateDefObj, String> call(TableColumn<ICFBamTZDateDefObj, String> arg) { return new CFStringTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamTZDateDefObj, Calendar>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZDateDefObj, Calendar> p) { ICFBamTZDateDefObj 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<ICFBamTZDateDefObj, Calendar>, TableCell<ICFBamTZDateDefObj, Calendar>>() { @Override public TableCell<ICFBamTZDateDefObj, Calendar> call( TableColumn<ICFBamTZDateDefObj, Calendar> arg) { return new CFTZDateTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamTZDateDefObj, Calendar>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZDateDefObj, Calendar> p) { ICFBamTZDateDefObj 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<ICFBamTZDateDefObj, Calendar>, TableCell<ICFBamTZDateDefObj, Calendar>>() { @Override public TableCell<ICFBamTZDateDefObj, Calendar> call( TableColumn<ICFBamTZDateDefObj, Calendar> arg) { return new CFTZDateTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamTZDateDefObj, Calendar>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZDateDefObj, Calendar> p) { ICFBamTZDateDefObj 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<ICFBamTZDateDefObj, Calendar>, TableCell<ICFBamTZDateDefObj, Calendar>>() { @Override public TableCell<ICFBamTZDateDefObj, Calendar> call( TableColumn<ICFBamTZDateDefObj, Calendar> arg) { return new CFTZDateTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamTZDateDefObj, Calendar>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZDateDefObj, Calendar> p) { ICFBamTZDateDefObj 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<ICFBamTZDateDefObj, Calendar>, TableCell<ICFBamTZDateDefObj, Calendar>>() { @Override public TableCell<ICFBamTZDateDefObj, Calendar> call( TableColumn<ICFBamTZDateDefObj, Calendar> arg) { return new CFTZDateTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamTZDateDefObj, Calendar>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZDateDefObj, Calendar> p) { ICFBamTZDateDefObj 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<ICFBamTZDateDefObj, Calendar>, TableCell<ICFBamTZDateDefObj, Calendar>>() { @Override public TableCell<ICFBamTZDateDefObj, Calendar> call( TableColumn<ICFBamTZDateDefObj, Calendar> arg) { return new CFTZDateTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamTZDateDefObj, Calendar>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZDateDefObj, Calendar> p) { ICFBamTZDateDefObj 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<ICFBamTZDateDefObj, Calendar>, TableCell<ICFBamTZDateDefObj, Calendar>>() { @Override public TableCell<ICFBamTZDateDefObj, Calendar> call( TableColumn<ICFBamTZDateDefObj, Calendar> arg) { return new CFTZDateTableCell<ICFBamTZDateDefObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamTZDateDefObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZDateDefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamTZDateDefObj, ICFBamSchemaDefObj> p) { ICFBamTZDateDefObj 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<ICFBamTZDateDefObj, ICFBamSchemaDefObj>, TableCell<ICFBamTZDateDefObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamTZDateDefObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamTZDateDefObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamTZDateDefObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamTZDateDefObj>() { @Override public void changed(ObservableValue<? extends ICFBamTZDateDefObj> observable, ICFBamTZDateDefObj oldValue, ICFBamTZDateDefObj 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 (observableListOfTZDateDef != null) { dataTable.setItems(observableListOfTZDateDef); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXUInt64DefListPane.java
public CFBamJavaFXUInt64DefListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamScopeObj argContainer, ICFBamUInt64DefObj argFocus, Collection<ICFBamUInt64DefObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();//from w w w. ja v 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<ICFBamUInt64DefObj>(); tableColumnObjKind = new TableColumn<ICFBamUInt64DefObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamUInt64DefObj, String> p) { ICFBamUInt64DefObj obj = p.getValue(); if (obj == null) { return (null); } else { String classCode = obj.getClassCode(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(classCode); return (observable); } } }); tableColumnObjKind.setCellFactory( new Callback<TableColumn<ICFBamUInt64DefObj, String>, TableCell<ICFBamUInt64DefObj, String>>() { @Override public TableCell<ICFBamUInt64DefObj, String> call(TableColumn<ICFBamUInt64DefObj, String> arg) { return new CFStringTableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamUInt64DefObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamUInt64DefObj, 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<ICFBamUInt64DefObj, Long>, TableCell<ICFBamUInt64DefObj, Long>>() { @Override public TableCell<ICFBamUInt64DefObj, Long> call(TableColumn<ICFBamUInt64DefObj, Long> arg) { return new CFInt64TableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamUInt64DefObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUInt64DefObj, 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<ICFBamUInt64DefObj, String>, TableCell<ICFBamUInt64DefObj, String>>() { @Override public TableCell<ICFBamUInt64DefObj, String> call(TableColumn<ICFBamUInt64DefObj, String> arg) { return new CFStringTableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamUInt64DefObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUInt64DefObj, 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<ICFBamUInt64DefObj, String>, TableCell<ICFBamUInt64DefObj, String>>() { @Override public TableCell<ICFBamUInt64DefObj, String> call(TableColumn<ICFBamUInt64DefObj, String> arg) { return new CFStringTableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamUInt64DefObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUInt64DefObj, 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<ICFBamUInt64DefObj, String>, TableCell<ICFBamUInt64DefObj, String>>() { @Override public TableCell<ICFBamUInt64DefObj, String> call(TableColumn<ICFBamUInt64DefObj, String> arg) { return new CFStringTableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamUInt64DefObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUInt64DefObj, 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<ICFBamUInt64DefObj, String>, TableCell<ICFBamUInt64DefObj, String>>() { @Override public TableCell<ICFBamUInt64DefObj, String> call(TableColumn<ICFBamUInt64DefObj, String> arg) { return new CFStringTableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamUInt64DefObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUInt64DefObj, 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<ICFBamUInt64DefObj, String>, TableCell<ICFBamUInt64DefObj, String>>() { @Override public TableCell<ICFBamUInt64DefObj, String> call(TableColumn<ICFBamUInt64DefObj, String> arg) { return new CFStringTableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamUInt64DefObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUInt64DefObj, 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<ICFBamUInt64DefObj, Boolean>, TableCell<ICFBamUInt64DefObj, Boolean>>() { @Override public TableCell<ICFBamUInt64DefObj, Boolean> call( TableColumn<ICFBamUInt64DefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamUInt64DefObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUInt64DefObj, 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<ICFBamUInt64DefObj, Boolean>, TableCell<ICFBamUInt64DefObj, Boolean>>() { @Override public TableCell<ICFBamUInt64DefObj, Boolean> call( TableColumn<ICFBamUInt64DefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamUInt64DefObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUInt64DefObj, 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<ICFBamUInt64DefObj, Boolean>, TableCell<ICFBamUInt64DefObj, Boolean>>() { @Override public TableCell<ICFBamUInt64DefObj, Boolean> call( TableColumn<ICFBamUInt64DefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamUInt64DefObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUInt64DefObj, 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<ICFBamUInt64DefObj, String>, TableCell<ICFBamUInt64DefObj, String>>() { @Override public TableCell<ICFBamUInt64DefObj, String> call(TableColumn<ICFBamUInt64DefObj, String> arg) { return new CFStringTableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamUInt64DefObj, BigDecimal>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, BigDecimal>, ObservableValue<BigDecimal>>() { public ObservableValue<BigDecimal> call(CellDataFeatures<ICFBamUInt64DefObj, BigDecimal> p) { ICFBamUInt64DefObj obj = p.getValue(); if (obj == null) { return (null); } else { BigDecimal value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<BigDecimal> observable = new ReadOnlyObjectWrapper<BigDecimal>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamUInt64DefObj, BigDecimal>, TableCell<ICFBamUInt64DefObj, BigDecimal>>() { @Override public TableCell<ICFBamUInt64DefObj, BigDecimal> call( TableColumn<ICFBamUInt64DefObj, BigDecimal> arg) { return new CFUInt64TableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamUInt64DefObj, BigDecimal>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, BigDecimal>, ObservableValue<BigDecimal>>() { public ObservableValue<BigDecimal> call(CellDataFeatures<ICFBamUInt64DefObj, BigDecimal> p) { ICFBamUInt64DefObj obj = p.getValue(); if (obj == null) { return (null); } else { BigDecimal value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<BigDecimal> observable = new ReadOnlyObjectWrapper<BigDecimal>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamUInt64DefObj, BigDecimal>, TableCell<ICFBamUInt64DefObj, BigDecimal>>() { @Override public TableCell<ICFBamUInt64DefObj, BigDecimal> call( TableColumn<ICFBamUInt64DefObj, BigDecimal> arg) { return new CFUInt64TableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamUInt64DefObj, BigDecimal>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, BigDecimal>, ObservableValue<BigDecimal>>() { public ObservableValue<BigDecimal> call(CellDataFeatures<ICFBamUInt64DefObj, BigDecimal> p) { ICFBamUInt64DefObj obj = p.getValue(); if (obj == null) { return (null); } else { BigDecimal value = obj.getOptionalMinValue(); ReadOnlyObjectWrapper<BigDecimal> observable = new ReadOnlyObjectWrapper<BigDecimal>(); observable.setValue(value); return (observable); } } }); tableColumnMinValue.setCellFactory( new Callback<TableColumn<ICFBamUInt64DefObj, BigDecimal>, TableCell<ICFBamUInt64DefObj, BigDecimal>>() { @Override public TableCell<ICFBamUInt64DefObj, BigDecimal> call( TableColumn<ICFBamUInt64DefObj, BigDecimal> arg) { return new CFUInt64TableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamUInt64DefObj, BigDecimal>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, BigDecimal>, ObservableValue<BigDecimal>>() { public ObservableValue<BigDecimal> call(CellDataFeatures<ICFBamUInt64DefObj, BigDecimal> p) { ICFBamUInt64DefObj obj = p.getValue(); if (obj == null) { return (null); } else { BigDecimal value = obj.getOptionalMaxValue(); ReadOnlyObjectWrapper<BigDecimal> observable = new ReadOnlyObjectWrapper<BigDecimal>(); observable.setValue(value); return (observable); } } }); tableColumnMaxValue.setCellFactory( new Callback<TableColumn<ICFBamUInt64DefObj, BigDecimal>, TableCell<ICFBamUInt64DefObj, BigDecimal>>() { @Override public TableCell<ICFBamUInt64DefObj, BigDecimal> call( TableColumn<ICFBamUInt64DefObj, BigDecimal> arg) { return new CFUInt64TableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamUInt64DefObj, BigDecimal>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, BigDecimal>, ObservableValue<BigDecimal>>() { public ObservableValue<BigDecimal> call(CellDataFeatures<ICFBamUInt64DefObj, BigDecimal> p) { ICFBamUInt64DefObj obj = p.getValue(); if (obj == null) { return (null); } else { BigDecimal value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<BigDecimal> observable = new ReadOnlyObjectWrapper<BigDecimal>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamUInt64DefObj, BigDecimal>, TableCell<ICFBamUInt64DefObj, BigDecimal>>() { @Override public TableCell<ICFBamUInt64DefObj, BigDecimal> call( TableColumn<ICFBamUInt64DefObj, BigDecimal> arg) { return new CFUInt64TableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamUInt64DefObj, BigDecimal>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, BigDecimal>, ObservableValue<BigDecimal>>() { public ObservableValue<BigDecimal> call(CellDataFeatures<ICFBamUInt64DefObj, BigDecimal> p) { ICFBamUInt64DefObj obj = p.getValue(); if (obj == null) { return (null); } else { BigDecimal value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<BigDecimal> observable = new ReadOnlyObjectWrapper<BigDecimal>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamUInt64DefObj, BigDecimal>, TableCell<ICFBamUInt64DefObj, BigDecimal>>() { @Override public TableCell<ICFBamUInt64DefObj, BigDecimal> call( TableColumn<ICFBamUInt64DefObj, BigDecimal> arg) { return new CFUInt64TableCell<ICFBamUInt64DefObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamUInt64DefObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUInt64DefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamUInt64DefObj, ICFBamSchemaDefObj> p) { ICFBamUInt64DefObj 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<ICFBamUInt64DefObj, ICFBamSchemaDefObj>, TableCell<ICFBamUInt64DefObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamUInt64DefObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamUInt64DefObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamUInt64DefObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamUInt64DefObj>() { @Override public void changed(ObservableValue<? extends ICFBamUInt64DefObj> observable, ICFBamUInt64DefObj oldValue, ICFBamUInt64DefObj 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 (observableListOfUInt64Def != null) { dataTable.setItems(observableListOfUInt64Def); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXNmTokenDefListPane.java
public CFBamJavaFXNmTokenDefListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamScopeObj argContainer, ICFBamNmTokenDefObj argFocus, Collection<ICFBamNmTokenDefObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();/*from w w w . j av a 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<ICFBamNmTokenDefObj>(); tableColumnObjKind = new TableColumn<ICFBamNmTokenDefObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamNmTokenDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String classCode = obj.getClassCode(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(classCode); return (observable); } } }); tableColumnObjKind.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamNmTokenDefObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamNmTokenDefObj, 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<ICFBamNmTokenDefObj, Long>, TableCell<ICFBamNmTokenDefObj, Long>>() { @Override public TableCell<ICFBamNmTokenDefObj, Long> call(TableColumn<ICFBamNmTokenDefObj, Long> arg) { return new CFInt64TableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamNmTokenDefObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, 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<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamNmTokenDefObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, 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<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamNmTokenDefObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, 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<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamNmTokenDefObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, 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<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamNmTokenDefObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, 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<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamNmTokenDefObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokenDefObj, 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<ICFBamNmTokenDefObj, Boolean>, TableCell<ICFBamNmTokenDefObj, Boolean>>() { @Override public TableCell<ICFBamNmTokenDefObj, Boolean> call( TableColumn<ICFBamNmTokenDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamNmTokenDefObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokenDefObj, 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<ICFBamNmTokenDefObj, Boolean>, TableCell<ICFBamNmTokenDefObj, Boolean>>() { @Override public TableCell<ICFBamNmTokenDefObj, Boolean> call( TableColumn<ICFBamNmTokenDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamNmTokenDefObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokenDefObj, 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<ICFBamNmTokenDefObj, Boolean>, TableCell<ICFBamNmTokenDefObj, Boolean>>() { @Override public TableCell<ICFBamNmTokenDefObj, Boolean> call( TableColumn<ICFBamNmTokenDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamNmTokenDefObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, 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<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnMaxLen = new TableColumn<ICFBamNmTokenDefObj, Integer>("Max. Length"); tableColumnMaxLen.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamNmTokenDefObj, Integer> p) { ICFBamNmTokenDefObj 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<ICFBamNmTokenDefObj, Integer>, TableCell<ICFBamNmTokenDefObj, Integer>>() { @Override public TableCell<ICFBamNmTokenDefObj, Integer> call( TableColumn<ICFBamNmTokenDefObj, Integer> arg) { return new CFInt32TableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnMaxLen); tableColumnInitValue = new TableColumn<ICFBamNmTokenDefObj, String>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamNmTokenDefObj 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<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFNmTokenTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamNmTokenDefObj, String>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamNmTokenDefObj 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<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFNmTokenTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnNullValue = new TableColumn<ICFBamNmTokenDefObj, String>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamNmTokenDefObj 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<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFNmTokenTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamNmTokenDefObj, String>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamNmTokenDefObj 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<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFNmTokenTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnShowLines = new TableColumn<ICFBamNmTokenDefObj, Short>("Show Lines"); tableColumnShowLines.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamNmTokenDefObj, Short> p) { ICFBamNmTokenDefObj 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<ICFBamNmTokenDefObj, Short>, TableCell<ICFBamNmTokenDefObj, Short>>() { @Override public TableCell<ICFBamNmTokenDefObj, Short> call(TableColumn<ICFBamNmTokenDefObj, Short> arg) { return new CFInt16TableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnShowLines); tableColumnLookupDefSchema = new TableColumn<ICFBamNmTokenDefObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamNmTokenDefObj, ICFBamSchemaDefObj> p) { ICFBamNmTokenDefObj 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<ICFBamNmTokenDefObj, ICFBamSchemaDefObj>, TableCell<ICFBamNmTokenDefObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamNmTokenDefObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamNmTokenDefObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamNmTokenDefObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamNmTokenDefObj>() { @Override public void changed(ObservableValue<? extends ICFBamNmTokenDefObj> observable, ICFBamNmTokenDefObj oldValue, ICFBamNmTokenDefObj 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 (observableListOfNmTokenDef != null) { dataTable.setItems(observableListOfNmTokenDef); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXRelationListPane.java
public CFBamJavaFXRelationListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamTableObj argContainer, ICFBamRelationObj argFocus, Collection<ICFBamRelationObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();//from w w w .ja v a2 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<ICFBamRelationObj>(); tableColumnId = new TableColumn<ICFBamRelationObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamRelationObj, Long> p) { ICFBamScopeObj 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<ICFBamRelationObj, Long>, TableCell<ICFBamRelationObj, Long>>() { @Override public TableCell<ICFBamRelationObj, Long> call(TableColumn<ICFBamRelationObj, Long> arg) { return new CFInt64TableCell<ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamRelationObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamRelationObj, String> p) { ICFBamRelationObj 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<ICFBamRelationObj, String>, TableCell<ICFBamRelationObj, String>>() { @Override public TableCell<ICFBamRelationObj, String> call(TableColumn<ICFBamRelationObj, String> arg) { return new CFStringTableCell<ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamRelationObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamRelationObj, String> p) { ICFBamRelationObj 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<ICFBamRelationObj, String>, TableCell<ICFBamRelationObj, String>>() { @Override public TableCell<ICFBamRelationObj, String> call(TableColumn<ICFBamRelationObj, String> arg) { return new CFStringTableCell<ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamRelationObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamRelationObj, String> p) { ICFBamRelationObj 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<ICFBamRelationObj, String>, TableCell<ICFBamRelationObj, String>>() { @Override public TableCell<ICFBamRelationObj, String> call(TableColumn<ICFBamRelationObj, String> arg) { return new CFStringTableCell<ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamRelationObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamRelationObj, String> p) { ICFBamRelationObj 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<ICFBamRelationObj, String>, TableCell<ICFBamRelationObj, String>>() { @Override public TableCell<ICFBamRelationObj, String> call(TableColumn<ICFBamRelationObj, String> arg) { return new CFStringTableCell<ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamRelationObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamRelationObj, String> p) { ICFBamRelationObj 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<ICFBamRelationObj, String>, TableCell<ICFBamRelationObj, String>>() { @Override public TableCell<ICFBamRelationObj, String> call(TableColumn<ICFBamRelationObj, String> arg) { return new CFStringTableCell<ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnRelationType = new TableColumn<ICFBamRelationObj, ICFBamSchema.RelationTypeEnum>("RelationType"); tableColumnRelationType.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, ICFBamSchema.RelationTypeEnum>, ObservableValue<ICFBamSchema.RelationTypeEnum>>() { public ObservableValue<ICFBamSchema.RelationTypeEnum> call( CellDataFeatures<ICFBamRelationObj, ICFBamSchema.RelationTypeEnum> p) { ICFBamRelationObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchema.RelationTypeEnum value = obj.getRequiredRelationType(); ReadOnlyObjectWrapper<ICFBamSchema.RelationTypeEnum> observable = new ReadOnlyObjectWrapper<ICFBamSchema.RelationTypeEnum>(); observable.setValue(value); return (observable); } } }); tableColumnRelationType.setCellFactory( new Callback<TableColumn<ICFBamRelationObj, ICFBamSchema.RelationTypeEnum>, TableCell<ICFBamRelationObj, ICFBamSchema.RelationTypeEnum>>() { @Override public TableCell<ICFBamRelationObj, ICFBamSchema.RelationTypeEnum> call( TableColumn<ICFBamRelationObj, ICFBamSchema.RelationTypeEnum> arg) { return new CFEnumTableCell<ICFBamRelationObj, ICFBamSchema.RelationTypeEnum>(); } }); dataTable.getColumns().add(tableColumnRelationType); tableColumnDbName = new TableColumn<ICFBamRelationObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamRelationObj, String> p) { ICFBamRelationObj 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<ICFBamRelationObj, String>, TableCell<ICFBamRelationObj, String>>() { @Override public TableCell<ICFBamRelationObj, String> call(TableColumn<ICFBamRelationObj, String> arg) { return new CFStringTableCell<ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnSuffix = new TableColumn<ICFBamRelationObj, String>("Suffix"); tableColumnSuffix.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamRelationObj, String> p) { ICFBamRelationObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalSuffix(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnSuffix.setCellFactory( new Callback<TableColumn<ICFBamRelationObj, String>, TableCell<ICFBamRelationObj, String>>() { @Override public TableCell<ICFBamRelationObj, String> call(TableColumn<ICFBamRelationObj, String> arg) { return new CFStringTableCell<ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnSuffix); tableColumnIsRequired = new TableColumn<ICFBamRelationObj, Boolean>("Is Required"); tableColumnIsRequired.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamRelationObj, Boolean> p) { ICFBamRelationObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredIsRequired(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnIsRequired.setCellFactory( new Callback<TableColumn<ICFBamRelationObj, Boolean>, TableCell<ICFBamRelationObj, Boolean>>() { @Override public TableCell<ICFBamRelationObj, Boolean> call(TableColumn<ICFBamRelationObj, Boolean> arg) { return new CFBoolTableCell<ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnIsRequired); tableColumnIsAbstract = new TableColumn<ICFBamRelationObj, Boolean>("Is Abstract"); tableColumnIsAbstract.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamRelationObj, Boolean> p) { ICFBamRelationObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredIsAbstract(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnIsAbstract.setCellFactory( new Callback<TableColumn<ICFBamRelationObj, Boolean>, TableCell<ICFBamRelationObj, Boolean>>() { @Override public TableCell<ICFBamRelationObj, Boolean> call(TableColumn<ICFBamRelationObj, Boolean> arg) { return new CFBoolTableCell<ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnIsAbstract); tableColumnIsXsdContainer = new TableColumn<ICFBamRelationObj, Boolean>("Is XSD Container"); tableColumnIsXsdContainer.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamRelationObj, Boolean> p) { ICFBamRelationObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredIsXsdContainer(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnIsXsdContainer.setCellFactory( new Callback<TableColumn<ICFBamRelationObj, Boolean>, TableCell<ICFBamRelationObj, Boolean>>() { @Override public TableCell<ICFBamRelationObj, Boolean> call(TableColumn<ICFBamRelationObj, Boolean> arg) { return new CFBoolTableCell<ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnIsXsdContainer); tableColumnDefaultVisibility = new TableColumn<ICFBamRelationObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamRelationObj, Boolean> p) { ICFBamRelationObj 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<ICFBamRelationObj, Boolean>, TableCell<ICFBamRelationObj, Boolean>>() { @Override public TableCell<ICFBamRelationObj, Boolean> call(TableColumn<ICFBamRelationObj, Boolean> arg) { return new CFBoolTableCell<ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnLookupDefSchema = new TableColumn<ICFBamRelationObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamRelationObj, ICFBamSchemaDefObj> p) { ICFBamRelationObj 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<ICFBamRelationObj, ICFBamSchemaDefObj>, TableCell<ICFBamRelationObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamRelationObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamRelationObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamRelationObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); tableColumnLookupFromIndex = new TableColumn<ICFBamRelationObj, ICFBamIndexObj>("From Index"); tableColumnLookupFromIndex.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, ICFBamIndexObj>, ObservableValue<ICFBamIndexObj>>() { public ObservableValue<ICFBamIndexObj> call( CellDataFeatures<ICFBamRelationObj, ICFBamIndexObj> p) { ICFBamRelationObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamIndexObj ref = obj.getRequiredLookupFromIndex(); ReadOnlyObjectWrapper<ICFBamIndexObj> observable = new ReadOnlyObjectWrapper<ICFBamIndexObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupFromIndex.setCellFactory( new Callback<TableColumn<ICFBamRelationObj, ICFBamIndexObj>, TableCell<ICFBamRelationObj, ICFBamIndexObj>>() { @Override public TableCell<ICFBamRelationObj, ICFBamIndexObj> call( TableColumn<ICFBamRelationObj, ICFBamIndexObj> arg) { return new CFReferenceTableCell<ICFBamRelationObj, ICFBamIndexObj>(); } }); dataTable.getColumns().add(tableColumnLookupFromIndex); tableColumnLookupToTable = new TableColumn<ICFBamRelationObj, ICFBamTableObj>("To Table"); tableColumnLookupToTable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, ICFBamTableObj>, ObservableValue<ICFBamTableObj>>() { public ObservableValue<ICFBamTableObj> call( CellDataFeatures<ICFBamRelationObj, ICFBamTableObj> p) { ICFBamRelationObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamTableObj ref = obj.getRequiredLookupToTable(); ReadOnlyObjectWrapper<ICFBamTableObj> observable = new ReadOnlyObjectWrapper<ICFBamTableObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupToTable.setCellFactory( new Callback<TableColumn<ICFBamRelationObj, ICFBamTableObj>, TableCell<ICFBamRelationObj, ICFBamTableObj>>() { @Override public TableCell<ICFBamRelationObj, ICFBamTableObj> call( TableColumn<ICFBamRelationObj, ICFBamTableObj> arg) { return new CFReferenceTableCell<ICFBamRelationObj, ICFBamTableObj>(); } }); dataTable.getColumns().add(tableColumnLookupToTable); tableColumnLookupToIndex = new TableColumn<ICFBamRelationObj, ICFBamIndexObj>("To Index"); tableColumnLookupToIndex.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, ICFBamIndexObj>, ObservableValue<ICFBamIndexObj>>() { public ObservableValue<ICFBamIndexObj> call( CellDataFeatures<ICFBamRelationObj, ICFBamIndexObj> p) { ICFBamRelationObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamIndexObj ref = obj.getRequiredLookupToIndex(); ReadOnlyObjectWrapper<ICFBamIndexObj> observable = new ReadOnlyObjectWrapper<ICFBamIndexObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupToIndex.setCellFactory( new Callback<TableColumn<ICFBamRelationObj, ICFBamIndexObj>, TableCell<ICFBamRelationObj, ICFBamIndexObj>>() { @Override public TableCell<ICFBamRelationObj, ICFBamIndexObj> call( TableColumn<ICFBamRelationObj, ICFBamIndexObj> arg) { return new CFReferenceTableCell<ICFBamRelationObj, ICFBamIndexObj>(); } }); dataTable.getColumns().add(tableColumnLookupToIndex); tableColumnLookupNarrowed = new TableColumn<ICFBamRelationObj, ICFBamRelationObj>("Narrowed Relation"); tableColumnLookupNarrowed.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, ICFBamRelationObj>, ObservableValue<ICFBamRelationObj>>() { public ObservableValue<ICFBamRelationObj> call( CellDataFeatures<ICFBamRelationObj, ICFBamRelationObj> p) { ICFBamRelationObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamRelationObj ref = obj.getOptionalLookupNarrowed(); ReadOnlyObjectWrapper<ICFBamRelationObj> observable = new ReadOnlyObjectWrapper<ICFBamRelationObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupNarrowed.setCellFactory( new Callback<TableColumn<ICFBamRelationObj, ICFBamRelationObj>, TableCell<ICFBamRelationObj, ICFBamRelationObj>>() { @Override public TableCell<ICFBamRelationObj, ICFBamRelationObj> call( TableColumn<ICFBamRelationObj, ICFBamRelationObj> arg) { return new CFReferenceTableCell<ICFBamRelationObj, ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnLookupNarrowed); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamRelationObj>() { @Override public void changed(ObservableValue<? extends ICFBamRelationObj> observable, ICFBamRelationObj oldValue, ICFBamRelationObj 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 (observableListOfRelation != null) { dataTable.setItems(observableListOfRelation); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXNmTokensDefListPane.java
public CFBamJavaFXNmTokensDefListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamScopeObj argContainer, ICFBamNmTokensDefObj argFocus, Collection<ICFBamNmTokensDefObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();/* ww w . j a va2 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<ICFBamNmTokensDefObj>(); tableColumnObjKind = new TableColumn<ICFBamNmTokensDefObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamNmTokensDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String classCode = obj.getClassCode(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(classCode); return (observable); } } }); tableColumnObjKind.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamNmTokensDefObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamNmTokensDefObj, 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<ICFBamNmTokensDefObj, Long>, TableCell<ICFBamNmTokensDefObj, Long>>() { @Override public TableCell<ICFBamNmTokensDefObj, Long> call(TableColumn<ICFBamNmTokensDefObj, Long> arg) { return new CFInt64TableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamNmTokensDefObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, 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<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamNmTokensDefObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, 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<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamNmTokensDefObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, 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<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamNmTokensDefObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, 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<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamNmTokensDefObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, 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<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamNmTokensDefObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokensDefObj, 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<ICFBamNmTokensDefObj, Boolean>, TableCell<ICFBamNmTokensDefObj, Boolean>>() { @Override public TableCell<ICFBamNmTokensDefObj, Boolean> call( TableColumn<ICFBamNmTokensDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamNmTokensDefObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokensDefObj, 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<ICFBamNmTokensDefObj, Boolean>, TableCell<ICFBamNmTokensDefObj, Boolean>>() { @Override public TableCell<ICFBamNmTokensDefObj, Boolean> call( TableColumn<ICFBamNmTokensDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamNmTokensDefObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokensDefObj, 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<ICFBamNmTokensDefObj, Boolean>, TableCell<ICFBamNmTokensDefObj, Boolean>>() { @Override public TableCell<ICFBamNmTokensDefObj, Boolean> call( TableColumn<ICFBamNmTokensDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamNmTokensDefObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, 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<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnMaxLen = new TableColumn<ICFBamNmTokensDefObj, Integer>("Max. Length"); tableColumnMaxLen.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamNmTokensDefObj, Integer> p) { ICFBamNmTokensDefObj 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<ICFBamNmTokensDefObj, Integer>, TableCell<ICFBamNmTokensDefObj, Integer>>() { @Override public TableCell<ICFBamNmTokensDefObj, Integer> call( TableColumn<ICFBamNmTokensDefObj, Integer> arg) { return new CFInt32TableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnMaxLen); tableColumnInitValue = new TableColumn<ICFBamNmTokensDefObj, String>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamNmTokensDefObj 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<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFNmTokensTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamNmTokensDefObj, String>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamNmTokensDefObj 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<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFNmTokensTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnNullValue = new TableColumn<ICFBamNmTokensDefObj, String>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamNmTokensDefObj 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<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFNmTokensTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamNmTokensDefObj, String>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamNmTokensDefObj 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<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFNmTokensTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnShowLines = new TableColumn<ICFBamNmTokensDefObj, Short>("Show Lines"); tableColumnShowLines.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamNmTokensDefObj, Short> p) { ICFBamNmTokensDefObj 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<ICFBamNmTokensDefObj, Short>, TableCell<ICFBamNmTokensDefObj, Short>>() { @Override public TableCell<ICFBamNmTokensDefObj, Short> call( TableColumn<ICFBamNmTokensDefObj, Short> arg) { return new CFInt16TableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnShowLines); tableColumnLookupDefSchema = new TableColumn<ICFBamNmTokensDefObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamNmTokensDefObj, ICFBamSchemaDefObj> p) { ICFBamNmTokensDefObj 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<ICFBamNmTokensDefObj, ICFBamSchemaDefObj>, TableCell<ICFBamNmTokensDefObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamNmTokensDefObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamNmTokensDefObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamNmTokensDefObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty() .addListener(new ChangeListener<ICFBamNmTokensDefObj>() { @Override public void changed(ObservableValue<? extends ICFBamNmTokensDefObj> observable, ICFBamNmTokensDefObj oldValue, ICFBamNmTokensDefObj 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 (observableListOfNmTokensDef != null) { dataTable.setItems(observableListOfNmTokensDef); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXTimestampDefListPane.java
public CFBamJavaFXTimestampDefListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamScopeObj argContainer, ICFBamTimestampDefObj argFocus, Collection<ICFBamTimestampDefObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();// w ww . j av a 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<ICFBamTimestampDefObj>(); tableColumnObjKind = new TableColumn<ICFBamTimestampDefObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampDefObj, String> p) { ICFBamTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String classCode = obj.getClassCode(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(classCode); return (observable); } } }); tableColumnObjKind.setCellFactory( new Callback<TableColumn<ICFBamTimestampDefObj, String>, TableCell<ICFBamTimestampDefObj, String>>() { @Override public TableCell<ICFBamTimestampDefObj, String> call( TableColumn<ICFBamTimestampDefObj, String> arg) { return new CFStringTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamTimestampDefObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, Long>, TableCell<ICFBamTimestampDefObj, Long>>() { @Override public TableCell<ICFBamTimestampDefObj, Long> call( TableColumn<ICFBamTimestampDefObj, Long> arg) { return new CFInt64TableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamTimestampDefObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, String>, TableCell<ICFBamTimestampDefObj, String>>() { @Override public TableCell<ICFBamTimestampDefObj, String> call( TableColumn<ICFBamTimestampDefObj, String> arg) { return new CFStringTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamTimestampDefObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, String>, TableCell<ICFBamTimestampDefObj, String>>() { @Override public TableCell<ICFBamTimestampDefObj, String> call( TableColumn<ICFBamTimestampDefObj, String> arg) { return new CFStringTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamTimestampDefObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, String>, TableCell<ICFBamTimestampDefObj, String>>() { @Override public TableCell<ICFBamTimestampDefObj, String> call( TableColumn<ICFBamTimestampDefObj, String> arg) { return new CFStringTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamTimestampDefObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, String>, TableCell<ICFBamTimestampDefObj, String>>() { @Override public TableCell<ICFBamTimestampDefObj, String> call( TableColumn<ICFBamTimestampDefObj, String> arg) { return new CFStringTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamTimestampDefObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, String>, TableCell<ICFBamTimestampDefObj, String>>() { @Override public TableCell<ICFBamTimestampDefObj, String> call( TableColumn<ICFBamTimestampDefObj, String> arg) { return new CFStringTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamTimestampDefObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, Boolean>, TableCell<ICFBamTimestampDefObj, Boolean>>() { @Override public TableCell<ICFBamTimestampDefObj, Boolean> call( TableColumn<ICFBamTimestampDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamTimestampDefObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, Boolean>, TableCell<ICFBamTimestampDefObj, Boolean>>() { @Override public TableCell<ICFBamTimestampDefObj, Boolean> call( TableColumn<ICFBamTimestampDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamTimestampDefObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, Boolean>, TableCell<ICFBamTimestampDefObj, Boolean>>() { @Override public TableCell<ICFBamTimestampDefObj, Boolean> call( TableColumn<ICFBamTimestampDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamTimestampDefObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, String>, TableCell<ICFBamTimestampDefObj, String>>() { @Override public TableCell<ICFBamTimestampDefObj, String> call( TableColumn<ICFBamTimestampDefObj, String> arg) { return new CFStringTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamTimestampDefObj, Calendar>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampDefObj, Calendar> p) { ICFBamTimestampDefObj 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<ICFBamTimestampDefObj, Calendar>, TableCell<ICFBamTimestampDefObj, Calendar>>() { @Override public TableCell<ICFBamTimestampDefObj, Calendar> call( TableColumn<ICFBamTimestampDefObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamTimestampDefObj, Calendar>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampDefObj, Calendar> p) { ICFBamTimestampDefObj 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<ICFBamTimestampDefObj, Calendar>, TableCell<ICFBamTimestampDefObj, Calendar>>() { @Override public TableCell<ICFBamTimestampDefObj, Calendar> call( TableColumn<ICFBamTimestampDefObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamTimestampDefObj, Calendar>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampDefObj, Calendar> p) { ICFBamTimestampDefObj 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<ICFBamTimestampDefObj, Calendar>, TableCell<ICFBamTimestampDefObj, Calendar>>() { @Override public TableCell<ICFBamTimestampDefObj, Calendar> call( TableColumn<ICFBamTimestampDefObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamTimestampDefObj, Calendar>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampDefObj, Calendar> p) { ICFBamTimestampDefObj 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<ICFBamTimestampDefObj, Calendar>, TableCell<ICFBamTimestampDefObj, Calendar>>() { @Override public TableCell<ICFBamTimestampDefObj, Calendar> call( TableColumn<ICFBamTimestampDefObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamTimestampDefObj, Calendar>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampDefObj, Calendar> p) { ICFBamTimestampDefObj 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<ICFBamTimestampDefObj, Calendar>, TableCell<ICFBamTimestampDefObj, Calendar>>() { @Override public TableCell<ICFBamTimestampDefObj, Calendar> call( TableColumn<ICFBamTimestampDefObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamTimestampDefObj, Calendar>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampDefObj, Calendar> p) { ICFBamTimestampDefObj 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<ICFBamTimestampDefObj, Calendar>, TableCell<ICFBamTimestampDefObj, Calendar>>() { @Override public TableCell<ICFBamTimestampDefObj, Calendar> call( TableColumn<ICFBamTimestampDefObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamTimestampDefObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamTimestampDefObj, ICFBamSchemaDefObj> p) { ICFBamTimestampDefObj 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<ICFBamTimestampDefObj, ICFBamSchemaDefObj>, TableCell<ICFBamTimestampDefObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamTimestampDefObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamTimestampDefObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamTimestampDefObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty() .addListener(new ChangeListener<ICFBamTimestampDefObj>() { @Override public void changed(ObservableValue<? extends ICFBamTimestampDefObj> observable, ICFBamTimestampDefObj oldValue, ICFBamTimestampDefObj 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 (observableListOfTimestampDef != null) { dataTable.setItems(observableListOfTimestampDef); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXTZTimestampDefListPane.java
public CFBamJavaFXTZTimestampDefListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamScopeObj argContainer, ICFBamTZTimestampDefObj argFocus, Collection<ICFBamTZTimestampDefObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();//from w w w . jav a 2 s .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<ICFBamTZTimestampDefObj>(); tableColumnObjKind = new TableColumn<ICFBamTZTimestampDefObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampDefObj, String> p) { ICFBamTZTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String classCode = obj.getClassCode(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(classCode); return (observable); } } }); tableColumnObjKind.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampDefObj, String>, TableCell<ICFBamTZTimestampDefObj, String>>() { @Override public TableCell<ICFBamTZTimestampDefObj, String> call( TableColumn<ICFBamTZTimestampDefObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamTZTimestampDefObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamTZTimestampDefObj, 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<ICFBamTZTimestampDefObj, Long>, TableCell<ICFBamTZTimestampDefObj, Long>>() { @Override public TableCell<ICFBamTZTimestampDefObj, Long> call( TableColumn<ICFBamTZTimestampDefObj, Long> arg) { return new CFInt64TableCell<ICFBamTZTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamTZTimestampDefObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampDefObj, 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<ICFBamTZTimestampDefObj, String>, TableCell<ICFBamTZTimestampDefObj, String>>() { @Override public TableCell<ICFBamTZTimestampDefObj, String> call( TableColumn<ICFBamTZTimestampDefObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamTZTimestampDefObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampDefObj, 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<ICFBamTZTimestampDefObj, String>, TableCell<ICFBamTZTimestampDefObj, String>>() { @Override public TableCell<ICFBamTZTimestampDefObj, String> call( TableColumn<ICFBamTZTimestampDefObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamTZTimestampDefObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampDefObj, 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<ICFBamTZTimestampDefObj, String>, TableCell<ICFBamTZTimestampDefObj, String>>() { @Override public TableCell<ICFBamTZTimestampDefObj, String> call( TableColumn<ICFBamTZTimestampDefObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamTZTimestampDefObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampDefObj, 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<ICFBamTZTimestampDefObj, String>, TableCell<ICFBamTZTimestampDefObj, String>>() { @Override public TableCell<ICFBamTZTimestampDefObj, String> call( TableColumn<ICFBamTZTimestampDefObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamTZTimestampDefObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampDefObj, 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<ICFBamTZTimestampDefObj, String>, TableCell<ICFBamTZTimestampDefObj, String>>() { @Override public TableCell<ICFBamTZTimestampDefObj, String> call( TableColumn<ICFBamTZTimestampDefObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamTZTimestampDefObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimestampDefObj, 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<ICFBamTZTimestampDefObj, Boolean>, TableCell<ICFBamTZTimestampDefObj, Boolean>>() { @Override public TableCell<ICFBamTZTimestampDefObj, Boolean> call( TableColumn<ICFBamTZTimestampDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamTZTimestampDefObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimestampDefObj, 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<ICFBamTZTimestampDefObj, Boolean>, TableCell<ICFBamTZTimestampDefObj, Boolean>>() { @Override public TableCell<ICFBamTZTimestampDefObj, Boolean> call( TableColumn<ICFBamTZTimestampDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamTZTimestampDefObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimestampDefObj, 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<ICFBamTZTimestampDefObj, Boolean>, TableCell<ICFBamTZTimestampDefObj, Boolean>>() { @Override public TableCell<ICFBamTZTimestampDefObj, Boolean> call( TableColumn<ICFBamTZTimestampDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamTZTimestampDefObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampDefObj, 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<ICFBamTZTimestampDefObj, String>, TableCell<ICFBamTZTimestampDefObj, String>>() { @Override public TableCell<ICFBamTZTimestampDefObj, String> call( TableColumn<ICFBamTZTimestampDefObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamTZTimestampDefObj, Calendar>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampDefObj, Calendar> p) { ICFBamTZTimestampDefObj 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<ICFBamTZTimestampDefObj, Calendar>, TableCell<ICFBamTZTimestampDefObj, Calendar>>() { @Override public TableCell<ICFBamTZTimestampDefObj, Calendar> call( TableColumn<ICFBamTZTimestampDefObj, Calendar> arg) { return new CFTZTimestampTableCell<ICFBamTZTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamTZTimestampDefObj, Calendar>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampDefObj, Calendar> p) { ICFBamTZTimestampDefObj 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<ICFBamTZTimestampDefObj, Calendar>, TableCell<ICFBamTZTimestampDefObj, Calendar>>() { @Override public TableCell<ICFBamTZTimestampDefObj, Calendar> call( TableColumn<ICFBamTZTimestampDefObj, Calendar> arg) { return new CFTZTimestampTableCell<ICFBamTZTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamTZTimestampDefObj, Calendar>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampDefObj, Calendar> p) { ICFBamTZTimestampDefObj 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<ICFBamTZTimestampDefObj, Calendar>, TableCell<ICFBamTZTimestampDefObj, Calendar>>() { @Override public TableCell<ICFBamTZTimestampDefObj, Calendar> call( TableColumn<ICFBamTZTimestampDefObj, Calendar> arg) { return new CFTZTimestampTableCell<ICFBamTZTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamTZTimestampDefObj, Calendar>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampDefObj, Calendar> p) { ICFBamTZTimestampDefObj 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<ICFBamTZTimestampDefObj, Calendar>, TableCell<ICFBamTZTimestampDefObj, Calendar>>() { @Override public TableCell<ICFBamTZTimestampDefObj, Calendar> call( TableColumn<ICFBamTZTimestampDefObj, Calendar> arg) { return new CFTZTimestampTableCell<ICFBamTZTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamTZTimestampDefObj, Calendar>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampDefObj, Calendar> p) { ICFBamTZTimestampDefObj 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<ICFBamTZTimestampDefObj, Calendar>, TableCell<ICFBamTZTimestampDefObj, Calendar>>() { @Override public TableCell<ICFBamTZTimestampDefObj, Calendar> call( TableColumn<ICFBamTZTimestampDefObj, Calendar> arg) { return new CFTZTimestampTableCell<ICFBamTZTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamTZTimestampDefObj, Calendar>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampDefObj, Calendar> p) { ICFBamTZTimestampDefObj 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<ICFBamTZTimestampDefObj, Calendar>, TableCell<ICFBamTZTimestampDefObj, Calendar>>() { @Override public TableCell<ICFBamTZTimestampDefObj, Calendar> call( TableColumn<ICFBamTZTimestampDefObj, Calendar> arg) { return new CFTZTimestampTableCell<ICFBamTZTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamTZTimestampDefObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamTZTimestampDefObj, ICFBamSchemaDefObj> p) { ICFBamTZTimestampDefObj 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<ICFBamTZTimestampDefObj, ICFBamSchemaDefObj>, TableCell<ICFBamTZTimestampDefObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamTZTimestampDefObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamTZTimestampDefObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamTZTimestampDefObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty() .addListener(new ChangeListener<ICFBamTZTimestampDefObj>() { @Override public void changed(ObservableValue<? extends ICFBamTZTimestampDefObj> observable, ICFBamTZTimestampDefObj oldValue, ICFBamTZTimestampDefObj 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 (observableListOfTZTimestampDef != null) { dataTable.setItems(observableListOfTZTimestampDef); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXNumberColListPane.java
public CFBamJavaFXNumberColListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamTableObj argContainer, ICFBamNumberColObj argFocus, Collection<ICFBamNumberColObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();/* w ww . java 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<ICFBamNumberColObj>(); tableColumnId = new TableColumn<ICFBamNumberColObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamNumberColObj, 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<ICFBamNumberColObj, Long>, TableCell<ICFBamNumberColObj, Long>>() { @Override public TableCell<ICFBamNumberColObj, Long> call(TableColumn<ICFBamNumberColObj, Long> arg) { return new CFInt64TableCell<ICFBamNumberColObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamNumberColObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNumberColObj, 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<ICFBamNumberColObj, String>, TableCell<ICFBamNumberColObj, String>>() { @Override public TableCell<ICFBamNumberColObj, String> call(TableColumn<ICFBamNumberColObj, String> arg) { return new CFStringTableCell<ICFBamNumberColObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamNumberColObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNumberColObj, 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<ICFBamNumberColObj, String>, TableCell<ICFBamNumberColObj, String>>() { @Override public TableCell<ICFBamNumberColObj, String> call(TableColumn<ICFBamNumberColObj, String> arg) { return new CFStringTableCell<ICFBamNumberColObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamNumberColObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNumberColObj, 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<ICFBamNumberColObj, String>, TableCell<ICFBamNumberColObj, String>>() { @Override public TableCell<ICFBamNumberColObj, String> call(TableColumn<ICFBamNumberColObj, String> arg) { return new CFStringTableCell<ICFBamNumberColObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamNumberColObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNumberColObj, 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<ICFBamNumberColObj, String>, TableCell<ICFBamNumberColObj, String>>() { @Override public TableCell<ICFBamNumberColObj, String> call(TableColumn<ICFBamNumberColObj, String> arg) { return new CFStringTableCell<ICFBamNumberColObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamNumberColObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNumberColObj, 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<ICFBamNumberColObj, String>, TableCell<ICFBamNumberColObj, String>>() { @Override public TableCell<ICFBamNumberColObj, String> call(TableColumn<ICFBamNumberColObj, String> arg) { return new CFStringTableCell<ICFBamNumberColObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamNumberColObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNumberColObj, 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<ICFBamNumberColObj, Boolean>, TableCell<ICFBamNumberColObj, Boolean>>() { @Override public TableCell<ICFBamNumberColObj, Boolean> call( TableColumn<ICFBamNumberColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNumberColObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamNumberColObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNumberColObj, 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<ICFBamNumberColObj, Boolean>, TableCell<ICFBamNumberColObj, Boolean>>() { @Override public TableCell<ICFBamNumberColObj, Boolean> call( TableColumn<ICFBamNumberColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNumberColObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamNumberColObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNumberColObj, 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<ICFBamNumberColObj, Boolean>, TableCell<ICFBamNumberColObj, Boolean>>() { @Override public TableCell<ICFBamNumberColObj, Boolean> call( TableColumn<ICFBamNumberColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNumberColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamNumberColObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNumberColObj, 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<ICFBamNumberColObj, String>, TableCell<ICFBamNumberColObj, String>>() { @Override public TableCell<ICFBamNumberColObj, String> call(TableColumn<ICFBamNumberColObj, String> arg) { return new CFStringTableCell<ICFBamNumberColObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnDigits = new TableColumn<ICFBamNumberColObj, Short>("Digits"); tableColumnDigits.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberColObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamNumberColObj, Short> p) { ICFBamNumberDefObj obj = p.getValue(); if (obj == null) { return (null); } else { short value = obj.getRequiredDigits(); Short wrapped = new Short(value); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(wrapped); return (observable); } } }); tableColumnDigits.setCellFactory( new Callback<TableColumn<ICFBamNumberColObj, Short>, TableCell<ICFBamNumberColObj, Short>>() { @Override public TableCell<ICFBamNumberColObj, Short> call(TableColumn<ICFBamNumberColObj, Short> arg) { return new CFInt16TableCell<ICFBamNumberColObj>(); } }); dataTable.getColumns().add(tableColumnDigits); tableColumnPrecis = new TableColumn<ICFBamNumberColObj, Short>("Precision"); tableColumnPrecis.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberColObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamNumberColObj, Short> p) { ICFBamNumberDefObj obj = p.getValue(); if (obj == null) { return (null); } else { short value = obj.getRequiredPrecis(); Short wrapped = new Short(value); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(wrapped); return (observable); } } }); tableColumnPrecis.setCellFactory( new Callback<TableColumn<ICFBamNumberColObj, Short>, TableCell<ICFBamNumberColObj, Short>>() { @Override public TableCell<ICFBamNumberColObj, Short> call(TableColumn<ICFBamNumberColObj, Short> arg) { return new CFInt16TableCell<ICFBamNumberColObj>(); } }); dataTable.getColumns().add(tableColumnPrecis); tableColumnInitValue = new TableColumn<ICFBamNumberColObj, BigDecimal>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberColObj, BigDecimal>, ObservableValue<BigDecimal>>() { public ObservableValue<BigDecimal> call(CellDataFeatures<ICFBamNumberColObj, BigDecimal> p) { ICFBamNumberDefObj obj = p.getValue(); if (obj == null) { return (null); } else { BigDecimal value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<BigDecimal> observable = new ReadOnlyObjectWrapper<BigDecimal>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamNumberColObj, BigDecimal>, TableCell<ICFBamNumberColObj, BigDecimal>>() { @Override public TableCell<ICFBamNumberColObj, BigDecimal> call( TableColumn<ICFBamNumberColObj, BigDecimal> arg) { return new CFNumberTableCell<ICFBamNumberColObj>(31, 5); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamNumberColObj, BigDecimal>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberColObj, BigDecimal>, ObservableValue<BigDecimal>>() { public ObservableValue<BigDecimal> call(CellDataFeatures<ICFBamNumberColObj, BigDecimal> p) { ICFBamNumberDefObj obj = p.getValue(); if (obj == null) { return (null); } else { BigDecimal value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<BigDecimal> observable = new ReadOnlyObjectWrapper<BigDecimal>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamNumberColObj, BigDecimal>, TableCell<ICFBamNumberColObj, BigDecimal>>() { @Override public TableCell<ICFBamNumberColObj, BigDecimal> call( TableColumn<ICFBamNumberColObj, BigDecimal> arg) { return new CFNumberTableCell<ICFBamNumberColObj>(31, 5); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamNumberColObj, BigDecimal>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberColObj, BigDecimal>, ObservableValue<BigDecimal>>() { public ObservableValue<BigDecimal> call(CellDataFeatures<ICFBamNumberColObj, BigDecimal> p) { ICFBamNumberDefObj obj = p.getValue(); if (obj == null) { return (null); } else { BigDecimal value = obj.getOptionalMinValue(); ReadOnlyObjectWrapper<BigDecimal> observable = new ReadOnlyObjectWrapper<BigDecimal>(); observable.setValue(value); return (observable); } } }); tableColumnMinValue.setCellFactory( new Callback<TableColumn<ICFBamNumberColObj, BigDecimal>, TableCell<ICFBamNumberColObj, BigDecimal>>() { @Override public TableCell<ICFBamNumberColObj, BigDecimal> call( TableColumn<ICFBamNumberColObj, BigDecimal> arg) { return new CFNumberTableCell<ICFBamNumberColObj>(31, 5); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamNumberColObj, BigDecimal>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberColObj, BigDecimal>, ObservableValue<BigDecimal>>() { public ObservableValue<BigDecimal> call(CellDataFeatures<ICFBamNumberColObj, BigDecimal> p) { ICFBamNumberDefObj obj = p.getValue(); if (obj == null) { return (null); } else { BigDecimal value = obj.getOptionalMaxValue(); ReadOnlyObjectWrapper<BigDecimal> observable = new ReadOnlyObjectWrapper<BigDecimal>(); observable.setValue(value); return (observable); } } }); tableColumnMaxValue.setCellFactory( new Callback<TableColumn<ICFBamNumberColObj, BigDecimal>, TableCell<ICFBamNumberColObj, BigDecimal>>() { @Override public TableCell<ICFBamNumberColObj, BigDecimal> call( TableColumn<ICFBamNumberColObj, BigDecimal> arg) { return new CFNumberTableCell<ICFBamNumberColObj>(31, 5); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamNumberColObj, BigDecimal>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberColObj, BigDecimal>, ObservableValue<BigDecimal>>() { public ObservableValue<BigDecimal> call(CellDataFeatures<ICFBamNumberColObj, BigDecimal> p) { ICFBamNumberDefObj obj = p.getValue(); if (obj == null) { return (null); } else { BigDecimal value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<BigDecimal> observable = new ReadOnlyObjectWrapper<BigDecimal>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamNumberColObj, BigDecimal>, TableCell<ICFBamNumberColObj, BigDecimal>>() { @Override public TableCell<ICFBamNumberColObj, BigDecimal> call( TableColumn<ICFBamNumberColObj, BigDecimal> arg) { return new CFNumberTableCell<ICFBamNumberColObj>(31, 5); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamNumberColObj, BigDecimal>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberColObj, BigDecimal>, ObservableValue<BigDecimal>>() { public ObservableValue<BigDecimal> call(CellDataFeatures<ICFBamNumberColObj, BigDecimal> p) { ICFBamNumberDefObj obj = p.getValue(); if (obj == null) { return (null); } else { BigDecimal value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<BigDecimal> observable = new ReadOnlyObjectWrapper<BigDecimal>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamNumberColObj, BigDecimal>, TableCell<ICFBamNumberColObj, BigDecimal>>() { @Override public TableCell<ICFBamNumberColObj, BigDecimal> call( TableColumn<ICFBamNumberColObj, BigDecimal> arg) { return new CFNumberTableCell<ICFBamNumberColObj>(31, 5); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamNumberColObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamNumberColObj, ICFBamSchemaDefObj> p) { ICFBamNumberColObj 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<ICFBamNumberColObj, ICFBamSchemaDefObj>, TableCell<ICFBamNumberColObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamNumberColObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamNumberColObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamNumberColObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamNumberColObj>() { @Override public void changed(ObservableValue<? extends ICFBamNumberColObj> observable, ICFBamNumberColObj oldValue, ICFBamNumberColObj 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 (observableListOfNumberCol != null) { dataTable.setItems(observableListOfNumberCol); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXNumberTypeListPane.java
public CFBamJavaFXNumberTypeListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamSchemaDefObj argContainer, ICFBamNumberTypeObj argFocus, Collection<ICFBamNumberTypeObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();/* www . ja v a2s . 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<ICFBamNumberTypeObj>(); tableColumnId = new TableColumn<ICFBamNumberTypeObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberTypeObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamNumberTypeObj, 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<ICFBamNumberTypeObj, Long>, TableCell<ICFBamNumberTypeObj, Long>>() { @Override public TableCell<ICFBamNumberTypeObj, Long> call(TableColumn<ICFBamNumberTypeObj, Long> arg) { return new CFInt64TableCell<ICFBamNumberTypeObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamNumberTypeObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNumberTypeObj, 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<ICFBamNumberTypeObj, String>, TableCell<ICFBamNumberTypeObj, String>>() { @Override public TableCell<ICFBamNumberTypeObj, String> call( TableColumn<ICFBamNumberTypeObj, String> arg) { return new CFStringTableCell<ICFBamNumberTypeObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamNumberTypeObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNumberTypeObj, 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<ICFBamNumberTypeObj, String>, TableCell<ICFBamNumberTypeObj, String>>() { @Override public TableCell<ICFBamNumberTypeObj, String> call( TableColumn<ICFBamNumberTypeObj, String> arg) { return new CFStringTableCell<ICFBamNumberTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamNumberTypeObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNumberTypeObj, 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<ICFBamNumberTypeObj, String>, TableCell<ICFBamNumberTypeObj, String>>() { @Override public TableCell<ICFBamNumberTypeObj, String> call( TableColumn<ICFBamNumberTypeObj, String> arg) { return new CFStringTableCell<ICFBamNumberTypeObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamNumberTypeObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNumberTypeObj, 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<ICFBamNumberTypeObj, String>, TableCell<ICFBamNumberTypeObj, String>>() { @Override public TableCell<ICFBamNumberTypeObj, String> call( TableColumn<ICFBamNumberTypeObj, String> arg) { return new CFStringTableCell<ICFBamNumberTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamNumberTypeObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNumberTypeObj, 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<ICFBamNumberTypeObj, String>, TableCell<ICFBamNumberTypeObj, String>>() { @Override public TableCell<ICFBamNumberTypeObj, String> call( TableColumn<ICFBamNumberTypeObj, String> arg) { return new CFStringTableCell<ICFBamNumberTypeObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamNumberTypeObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNumberTypeObj, 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<ICFBamNumberTypeObj, Boolean>, TableCell<ICFBamNumberTypeObj, Boolean>>() { @Override public TableCell<ICFBamNumberTypeObj, Boolean> call( TableColumn<ICFBamNumberTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNumberTypeObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamNumberTypeObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNumberTypeObj, 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<ICFBamNumberTypeObj, Boolean>, TableCell<ICFBamNumberTypeObj, Boolean>>() { @Override public TableCell<ICFBamNumberTypeObj, Boolean> call( TableColumn<ICFBamNumberTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNumberTypeObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamNumberTypeObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNumberTypeObj, 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<ICFBamNumberTypeObj, Boolean>, TableCell<ICFBamNumberTypeObj, Boolean>>() { @Override public TableCell<ICFBamNumberTypeObj, Boolean> call( TableColumn<ICFBamNumberTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNumberTypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamNumberTypeObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNumberTypeObj, 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<ICFBamNumberTypeObj, String>, TableCell<ICFBamNumberTypeObj, String>>() { @Override public TableCell<ICFBamNumberTypeObj, String> call( TableColumn<ICFBamNumberTypeObj, String> arg) { return new CFStringTableCell<ICFBamNumberTypeObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnDigits = new TableColumn<ICFBamNumberTypeObj, Short>("Digits"); tableColumnDigits.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberTypeObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamNumberTypeObj, Short> p) { ICFBamNumberDefObj obj = p.getValue(); if (obj == null) { return (null); } else { short value = obj.getRequiredDigits(); Short wrapped = new Short(value); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(wrapped); return (observable); } } }); tableColumnDigits.setCellFactory( new Callback<TableColumn<ICFBamNumberTypeObj, Short>, TableCell<ICFBamNumberTypeObj, Short>>() { @Override public TableCell<ICFBamNumberTypeObj, Short> call(TableColumn<ICFBamNumberTypeObj, Short> arg) { return new CFInt16TableCell<ICFBamNumberTypeObj>(); } }); dataTable.getColumns().add(tableColumnDigits); tableColumnPrecis = new TableColumn<ICFBamNumberTypeObj, Short>("Precision"); tableColumnPrecis.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberTypeObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamNumberTypeObj, Short> p) { ICFBamNumberDefObj obj = p.getValue(); if (obj == null) { return (null); } else { short value = obj.getRequiredPrecis(); Short wrapped = new Short(value); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(wrapped); return (observable); } } }); tableColumnPrecis.setCellFactory( new Callback<TableColumn<ICFBamNumberTypeObj, Short>, TableCell<ICFBamNumberTypeObj, Short>>() { @Override public TableCell<ICFBamNumberTypeObj, Short> call(TableColumn<ICFBamNumberTypeObj, Short> arg) { return new CFInt16TableCell<ICFBamNumberTypeObj>(); } }); dataTable.getColumns().add(tableColumnPrecis); tableColumnInitValue = new TableColumn<ICFBamNumberTypeObj, BigDecimal>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberTypeObj, BigDecimal>, ObservableValue<BigDecimal>>() { public ObservableValue<BigDecimal> call(CellDataFeatures<ICFBamNumberTypeObj, BigDecimal> p) { ICFBamNumberDefObj obj = p.getValue(); if (obj == null) { return (null); } else { BigDecimal value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<BigDecimal> observable = new ReadOnlyObjectWrapper<BigDecimal>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamNumberTypeObj, BigDecimal>, TableCell<ICFBamNumberTypeObj, BigDecimal>>() { @Override public TableCell<ICFBamNumberTypeObj, BigDecimal> call( TableColumn<ICFBamNumberTypeObj, BigDecimal> arg) { return new CFNumberTableCell<ICFBamNumberTypeObj>(31, 5); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamNumberTypeObj, BigDecimal>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberTypeObj, BigDecimal>, ObservableValue<BigDecimal>>() { public ObservableValue<BigDecimal> call(CellDataFeatures<ICFBamNumberTypeObj, BigDecimal> p) { ICFBamNumberDefObj obj = p.getValue(); if (obj == null) { return (null); } else { BigDecimal value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<BigDecimal> observable = new ReadOnlyObjectWrapper<BigDecimal>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamNumberTypeObj, BigDecimal>, TableCell<ICFBamNumberTypeObj, BigDecimal>>() { @Override public TableCell<ICFBamNumberTypeObj, BigDecimal> call( TableColumn<ICFBamNumberTypeObj, BigDecimal> arg) { return new CFNumberTableCell<ICFBamNumberTypeObj>(31, 5); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamNumberTypeObj, BigDecimal>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberTypeObj, BigDecimal>, ObservableValue<BigDecimal>>() { public ObservableValue<BigDecimal> call(CellDataFeatures<ICFBamNumberTypeObj, BigDecimal> p) { ICFBamNumberDefObj obj = p.getValue(); if (obj == null) { return (null); } else { BigDecimal value = obj.getOptionalMinValue(); ReadOnlyObjectWrapper<BigDecimal> observable = new ReadOnlyObjectWrapper<BigDecimal>(); observable.setValue(value); return (observable); } } }); tableColumnMinValue.setCellFactory( new Callback<TableColumn<ICFBamNumberTypeObj, BigDecimal>, TableCell<ICFBamNumberTypeObj, BigDecimal>>() { @Override public TableCell<ICFBamNumberTypeObj, BigDecimal> call( TableColumn<ICFBamNumberTypeObj, BigDecimal> arg) { return new CFNumberTableCell<ICFBamNumberTypeObj>(31, 5); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamNumberTypeObj, BigDecimal>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberTypeObj, BigDecimal>, ObservableValue<BigDecimal>>() { public ObservableValue<BigDecimal> call(CellDataFeatures<ICFBamNumberTypeObj, BigDecimal> p) { ICFBamNumberDefObj obj = p.getValue(); if (obj == null) { return (null); } else { BigDecimal value = obj.getOptionalMaxValue(); ReadOnlyObjectWrapper<BigDecimal> observable = new ReadOnlyObjectWrapper<BigDecimal>(); observable.setValue(value); return (observable); } } }); tableColumnMaxValue.setCellFactory( new Callback<TableColumn<ICFBamNumberTypeObj, BigDecimal>, TableCell<ICFBamNumberTypeObj, BigDecimal>>() { @Override public TableCell<ICFBamNumberTypeObj, BigDecimal> call( TableColumn<ICFBamNumberTypeObj, BigDecimal> arg) { return new CFNumberTableCell<ICFBamNumberTypeObj>(31, 5); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamNumberTypeObj, BigDecimal>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberTypeObj, BigDecimal>, ObservableValue<BigDecimal>>() { public ObservableValue<BigDecimal> call(CellDataFeatures<ICFBamNumberTypeObj, BigDecimal> p) { ICFBamNumberDefObj obj = p.getValue(); if (obj == null) { return (null); } else { BigDecimal value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<BigDecimal> observable = new ReadOnlyObjectWrapper<BigDecimal>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamNumberTypeObj, BigDecimal>, TableCell<ICFBamNumberTypeObj, BigDecimal>>() { @Override public TableCell<ICFBamNumberTypeObj, BigDecimal> call( TableColumn<ICFBamNumberTypeObj, BigDecimal> arg) { return new CFNumberTableCell<ICFBamNumberTypeObj>(31, 5); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamNumberTypeObj, BigDecimal>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberTypeObj, BigDecimal>, ObservableValue<BigDecimal>>() { public ObservableValue<BigDecimal> call(CellDataFeatures<ICFBamNumberTypeObj, BigDecimal> p) { ICFBamNumberDefObj obj = p.getValue(); if (obj == null) { return (null); } else { BigDecimal value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<BigDecimal> observable = new ReadOnlyObjectWrapper<BigDecimal>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamNumberTypeObj, BigDecimal>, TableCell<ICFBamNumberTypeObj, BigDecimal>>() { @Override public TableCell<ICFBamNumberTypeObj, BigDecimal> call( TableColumn<ICFBamNumberTypeObj, BigDecimal> arg) { return new CFNumberTableCell<ICFBamNumberTypeObj>(31, 5); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamNumberTypeObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNumberTypeObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamNumberTypeObj, ICFBamSchemaDefObj> p) { ICFBamNumberTypeObj 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<ICFBamNumberTypeObj, ICFBamSchemaDefObj>, TableCell<ICFBamNumberTypeObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamNumberTypeObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamNumberTypeObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamNumberTypeObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamNumberTypeObj>() { @Override public void changed(ObservableValue<? extends ICFBamNumberTypeObj> observable, ICFBamNumberTypeObj oldValue, ICFBamNumberTypeObj 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 (observableListOfNumberType != null) { dataTable.setItems(observableListOfNumberType); } adjustListButtons(); }