List of usage examples for javafx.scene.control TableView TableView
public TableView()
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXTimestampTypeListPane.java
public CFBamJavaFXTimestampTypeListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamSchemaDefObj argContainer, ICFBamTimestampTypeObj argFocus, Collection<ICFBamTimestampTypeObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();/* w w w . j a va 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<ICFBamTimestampTypeObj>(); tableColumnId = new TableColumn<ICFBamTimestampTypeObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamTimestampTypeObj, 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<ICFBamTimestampTypeObj, Long>, TableCell<ICFBamTimestampTypeObj, Long>>() { @Override public TableCell<ICFBamTimestampTypeObj, Long> call( TableColumn<ICFBamTimestampTypeObj, Long> arg) { return new CFInt64TableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamTimestampTypeObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampTypeObj, 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<ICFBamTimestampTypeObj, String>, TableCell<ICFBamTimestampTypeObj, String>>() { @Override public TableCell<ICFBamTimestampTypeObj, String> call( TableColumn<ICFBamTimestampTypeObj, String> arg) { return new CFStringTableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamTimestampTypeObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampTypeObj, 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<ICFBamTimestampTypeObj, String>, TableCell<ICFBamTimestampTypeObj, String>>() { @Override public TableCell<ICFBamTimestampTypeObj, String> call( TableColumn<ICFBamTimestampTypeObj, String> arg) { return new CFStringTableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamTimestampTypeObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampTypeObj, 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<ICFBamTimestampTypeObj, String>, TableCell<ICFBamTimestampTypeObj, String>>() { @Override public TableCell<ICFBamTimestampTypeObj, String> call( TableColumn<ICFBamTimestampTypeObj, String> arg) { return new CFStringTableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamTimestampTypeObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampTypeObj, 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<ICFBamTimestampTypeObj, String>, TableCell<ICFBamTimestampTypeObj, String>>() { @Override public TableCell<ICFBamTimestampTypeObj, String> call( TableColumn<ICFBamTimestampTypeObj, String> arg) { return new CFStringTableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamTimestampTypeObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampTypeObj, 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<ICFBamTimestampTypeObj, String>, TableCell<ICFBamTimestampTypeObj, String>>() { @Override public TableCell<ICFBamTimestampTypeObj, String> call( TableColumn<ICFBamTimestampTypeObj, String> arg) { return new CFStringTableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamTimestampTypeObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimestampTypeObj, 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<ICFBamTimestampTypeObj, Boolean>, TableCell<ICFBamTimestampTypeObj, Boolean>>() { @Override public TableCell<ICFBamTimestampTypeObj, Boolean> call( TableColumn<ICFBamTimestampTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamTimestampTypeObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimestampTypeObj, 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<ICFBamTimestampTypeObj, Boolean>, TableCell<ICFBamTimestampTypeObj, Boolean>>() { @Override public TableCell<ICFBamTimestampTypeObj, Boolean> call( TableColumn<ICFBamTimestampTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamTimestampTypeObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimestampTypeObj, 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<ICFBamTimestampTypeObj, Boolean>, TableCell<ICFBamTimestampTypeObj, Boolean>>() { @Override public TableCell<ICFBamTimestampTypeObj, Boolean> call( TableColumn<ICFBamTimestampTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamTimestampTypeObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampTypeObj, 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<ICFBamTimestampTypeObj, String>, TableCell<ICFBamTimestampTypeObj, String>>() { @Override public TableCell<ICFBamTimestampTypeObj, String> call( TableColumn<ICFBamTimestampTypeObj, String> arg) { return new CFStringTableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamTimestampTypeObj, Calendar>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampTypeObj, 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<ICFBamTimestampTypeObj, Calendar>, TableCell<ICFBamTimestampTypeObj, Calendar>>() { @Override public TableCell<ICFBamTimestampTypeObj, Calendar> call( TableColumn<ICFBamTimestampTypeObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamTimestampTypeObj, Calendar>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampTypeObj, 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<ICFBamTimestampTypeObj, Calendar>, TableCell<ICFBamTimestampTypeObj, Calendar>>() { @Override public TableCell<ICFBamTimestampTypeObj, Calendar> call( TableColumn<ICFBamTimestampTypeObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamTimestampTypeObj, Calendar>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampTypeObj, 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<ICFBamTimestampTypeObj, Calendar>, TableCell<ICFBamTimestampTypeObj, Calendar>>() { @Override public TableCell<ICFBamTimestampTypeObj, Calendar> call( TableColumn<ICFBamTimestampTypeObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamTimestampTypeObj, Calendar>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampTypeObj, 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<ICFBamTimestampTypeObj, Calendar>, TableCell<ICFBamTimestampTypeObj, Calendar>>() { @Override public TableCell<ICFBamTimestampTypeObj, Calendar> call( TableColumn<ICFBamTimestampTypeObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamTimestampTypeObj, Calendar>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampTypeObj, 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<ICFBamTimestampTypeObj, Calendar>, TableCell<ICFBamTimestampTypeObj, Calendar>>() { @Override public TableCell<ICFBamTimestampTypeObj, Calendar> call( TableColumn<ICFBamTimestampTypeObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamTimestampTypeObj, Calendar>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampTypeObj, 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<ICFBamTimestampTypeObj, Calendar>, TableCell<ICFBamTimestampTypeObj, Calendar>>() { @Override public TableCell<ICFBamTimestampTypeObj, Calendar> call( TableColumn<ICFBamTimestampTypeObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamTimestampTypeObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamTimestampTypeObj, ICFBamSchemaDefObj> p) { ICFBamTimestampTypeObj 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<ICFBamTimestampTypeObj, ICFBamSchemaDefObj>, TableCell<ICFBamTimestampTypeObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamTimestampTypeObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamTimestampTypeObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamTimestampTypeObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty() .addListener(new ChangeListener<ICFBamTimestampTypeObj>() { @Override public void changed(ObservableValue<? extends ICFBamTimestampTypeObj> observable, ICFBamTimestampTypeObj oldValue, ICFBamTimestampTypeObj 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 (observableListOfTimestampType != null) { dataTable.setItems(observableListOfTimestampType); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXUuidTypeListPane.java
public CFBamJavaFXUuidTypeListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamSchemaDefObj argContainer, ICFBamUuidTypeObj argFocus, Collection<ICFBamUuidTypeObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();/*from ww w.j ava 2 s. co m*/ final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamUuidTypeObj>(); tableColumnObjKind = new TableColumn<ICFBamUuidTypeObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidTypeObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamUuidTypeObj, String> p) { ICFBamUuidTypeObj 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<ICFBamUuidTypeObj, String>, TableCell<ICFBamUuidTypeObj, String>>() { @Override public TableCell<ICFBamUuidTypeObj, String> call(TableColumn<ICFBamUuidTypeObj, String> arg) { return new CFStringTableCell<ICFBamUuidTypeObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamUuidTypeObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidTypeObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamUuidTypeObj, 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<ICFBamUuidTypeObj, Long>, TableCell<ICFBamUuidTypeObj, Long>>() { @Override public TableCell<ICFBamUuidTypeObj, Long> call(TableColumn<ICFBamUuidTypeObj, Long> arg) { return new CFInt64TableCell<ICFBamUuidTypeObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamUuidTypeObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUuidTypeObj, 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<ICFBamUuidTypeObj, String>, TableCell<ICFBamUuidTypeObj, String>>() { @Override public TableCell<ICFBamUuidTypeObj, String> call(TableColumn<ICFBamUuidTypeObj, String> arg) { return new CFStringTableCell<ICFBamUuidTypeObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamUuidTypeObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUuidTypeObj, 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<ICFBamUuidTypeObj, String>, TableCell<ICFBamUuidTypeObj, String>>() { @Override public TableCell<ICFBamUuidTypeObj, String> call(TableColumn<ICFBamUuidTypeObj, String> arg) { return new CFStringTableCell<ICFBamUuidTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamUuidTypeObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUuidTypeObj, 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<ICFBamUuidTypeObj, String>, TableCell<ICFBamUuidTypeObj, String>>() { @Override public TableCell<ICFBamUuidTypeObj, String> call(TableColumn<ICFBamUuidTypeObj, String> arg) { return new CFStringTableCell<ICFBamUuidTypeObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamUuidTypeObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUuidTypeObj, 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<ICFBamUuidTypeObj, String>, TableCell<ICFBamUuidTypeObj, String>>() { @Override public TableCell<ICFBamUuidTypeObj, String> call(TableColumn<ICFBamUuidTypeObj, String> arg) { return new CFStringTableCell<ICFBamUuidTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamUuidTypeObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUuidTypeObj, 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<ICFBamUuidTypeObj, String>, TableCell<ICFBamUuidTypeObj, String>>() { @Override public TableCell<ICFBamUuidTypeObj, String> call(TableColumn<ICFBamUuidTypeObj, String> arg) { return new CFStringTableCell<ICFBamUuidTypeObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamUuidTypeObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUuidTypeObj, 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<ICFBamUuidTypeObj, Boolean>, TableCell<ICFBamUuidTypeObj, Boolean>>() { @Override public TableCell<ICFBamUuidTypeObj, Boolean> call(TableColumn<ICFBamUuidTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamUuidTypeObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamUuidTypeObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUuidTypeObj, 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<ICFBamUuidTypeObj, Boolean>, TableCell<ICFBamUuidTypeObj, Boolean>>() { @Override public TableCell<ICFBamUuidTypeObj, Boolean> call(TableColumn<ICFBamUuidTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamUuidTypeObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamUuidTypeObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUuidTypeObj, 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<ICFBamUuidTypeObj, Boolean>, TableCell<ICFBamUuidTypeObj, Boolean>>() { @Override public TableCell<ICFBamUuidTypeObj, Boolean> call(TableColumn<ICFBamUuidTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamUuidTypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamUuidTypeObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUuidTypeObj, 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<ICFBamUuidTypeObj, String>, TableCell<ICFBamUuidTypeObj, String>>() { @Override public TableCell<ICFBamUuidTypeObj, String> call(TableColumn<ICFBamUuidTypeObj, String> arg) { return new CFStringTableCell<ICFBamUuidTypeObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamUuidTypeObj, UUID>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidTypeObj, UUID>, ObservableValue<UUID>>() { public ObservableValue<UUID> call(CellDataFeatures<ICFBamUuidTypeObj, UUID> p) { ICFBamUuidDefObj obj = p.getValue(); if (obj == null) { return (null); } else { UUID value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<UUID> observable = new ReadOnlyObjectWrapper<UUID>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamUuidTypeObj, UUID>, TableCell<ICFBamUuidTypeObj, UUID>>() { @Override public TableCell<ICFBamUuidTypeObj, UUID> call(TableColumn<ICFBamUuidTypeObj, UUID> arg) { return new CFUuidTableCell<ICFBamUuidTypeObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamUuidTypeObj, UUID>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidTypeObj, UUID>, ObservableValue<UUID>>() { public ObservableValue<UUID> call(CellDataFeatures<ICFBamUuidTypeObj, UUID> p) { ICFBamUuidDefObj obj = p.getValue(); if (obj == null) { return (null); } else { UUID value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<UUID> observable = new ReadOnlyObjectWrapper<UUID>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamUuidTypeObj, UUID>, TableCell<ICFBamUuidTypeObj, UUID>>() { @Override public TableCell<ICFBamUuidTypeObj, UUID> call(TableColumn<ICFBamUuidTypeObj, UUID> arg) { return new CFUuidTableCell<ICFBamUuidTypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnNullValue = new TableColumn<ICFBamUuidTypeObj, UUID>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidTypeObj, UUID>, ObservableValue<UUID>>() { public ObservableValue<UUID> call(CellDataFeatures<ICFBamUuidTypeObj, UUID> p) { ICFBamUuidDefObj obj = p.getValue(); if (obj == null) { return (null); } else { UUID value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<UUID> observable = new ReadOnlyObjectWrapper<UUID>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamUuidTypeObj, UUID>, TableCell<ICFBamUuidTypeObj, UUID>>() { @Override public TableCell<ICFBamUuidTypeObj, UUID> call(TableColumn<ICFBamUuidTypeObj, UUID> arg) { return new CFUuidTableCell<ICFBamUuidTypeObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamUuidTypeObj, UUID>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidTypeObj, UUID>, ObservableValue<UUID>>() { public ObservableValue<UUID> call(CellDataFeatures<ICFBamUuidTypeObj, UUID> p) { ICFBamUuidDefObj obj = p.getValue(); if (obj == null) { return (null); } else { UUID value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<UUID> observable = new ReadOnlyObjectWrapper<UUID>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamUuidTypeObj, UUID>, TableCell<ICFBamUuidTypeObj, UUID>>() { @Override public TableCell<ICFBamUuidTypeObj, UUID> call(TableColumn<ICFBamUuidTypeObj, UUID> arg) { return new CFUuidTableCell<ICFBamUuidTypeObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamUuidTypeObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidTypeObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamUuidTypeObj, ICFBamSchemaDefObj> p) { ICFBamUuidTypeObj 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<ICFBamUuidTypeObj, ICFBamSchemaDefObj>, TableCell<ICFBamUuidTypeObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamUuidTypeObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamUuidTypeObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamUuidTypeObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamUuidTypeObj>() { @Override public void changed(ObservableValue<? extends ICFBamUuidTypeObj> observable, ICFBamUuidTypeObj oldValue, ICFBamUuidTypeObj 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 (observableListOfUuidType != null) { dataTable.setItems(observableListOfUuidType); } 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();// w ww . j a va 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<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.CFBamJavaFXTZTimestampColListPane.java
public CFBamJavaFXTZTimestampColListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamTableObj argContainer, ICFBamTZTimestampColObj argFocus, Collection<ICFBamTZTimestampColObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();//from w ww .j ava2s.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<ICFBamTZTimestampColObj>(); tableColumnId = new TableColumn<ICFBamTZTimestampColObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamTZTimestampColObj, 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<ICFBamTZTimestampColObj, Long>, TableCell<ICFBamTZTimestampColObj, Long>>() { @Override public TableCell<ICFBamTZTimestampColObj, Long> call( TableColumn<ICFBamTZTimestampColObj, Long> arg) { return new CFInt64TableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamTZTimestampColObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampColObj, 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<ICFBamTZTimestampColObj, String>, TableCell<ICFBamTZTimestampColObj, String>>() { @Override public TableCell<ICFBamTZTimestampColObj, String> call( TableColumn<ICFBamTZTimestampColObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamTZTimestampColObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampColObj, 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<ICFBamTZTimestampColObj, String>, TableCell<ICFBamTZTimestampColObj, String>>() { @Override public TableCell<ICFBamTZTimestampColObj, String> call( TableColumn<ICFBamTZTimestampColObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamTZTimestampColObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampColObj, 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<ICFBamTZTimestampColObj, String>, TableCell<ICFBamTZTimestampColObj, String>>() { @Override public TableCell<ICFBamTZTimestampColObj, String> call( TableColumn<ICFBamTZTimestampColObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamTZTimestampColObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampColObj, 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<ICFBamTZTimestampColObj, String>, TableCell<ICFBamTZTimestampColObj, String>>() { @Override public TableCell<ICFBamTZTimestampColObj, String> call( TableColumn<ICFBamTZTimestampColObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamTZTimestampColObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampColObj, 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<ICFBamTZTimestampColObj, String>, TableCell<ICFBamTZTimestampColObj, String>>() { @Override public TableCell<ICFBamTZTimestampColObj, String> call( TableColumn<ICFBamTZTimestampColObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamTZTimestampColObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimestampColObj, 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<ICFBamTZTimestampColObj, Boolean>, TableCell<ICFBamTZTimestampColObj, Boolean>>() { @Override public TableCell<ICFBamTZTimestampColObj, Boolean> call( TableColumn<ICFBamTZTimestampColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamTZTimestampColObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimestampColObj, 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<ICFBamTZTimestampColObj, Boolean>, TableCell<ICFBamTZTimestampColObj, Boolean>>() { @Override public TableCell<ICFBamTZTimestampColObj, Boolean> call( TableColumn<ICFBamTZTimestampColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamTZTimestampColObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimestampColObj, 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<ICFBamTZTimestampColObj, Boolean>, TableCell<ICFBamTZTimestampColObj, Boolean>>() { @Override public TableCell<ICFBamTZTimestampColObj, Boolean> call( TableColumn<ICFBamTZTimestampColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamTZTimestampColObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampColObj, 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<ICFBamTZTimestampColObj, String>, TableCell<ICFBamTZTimestampColObj, String>>() { @Override public TableCell<ICFBamTZTimestampColObj, String> call( TableColumn<ICFBamTZTimestampColObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamTZTimestampColObj, Calendar>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampColObj, 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<ICFBamTZTimestampColObj, Calendar>, TableCell<ICFBamTZTimestampColObj, Calendar>>() { @Override public TableCell<ICFBamTZTimestampColObj, Calendar> call( TableColumn<ICFBamTZTimestampColObj, Calendar> arg) { return new CFTZTimestampTableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamTZTimestampColObj, Calendar>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampColObj, 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<ICFBamTZTimestampColObj, Calendar>, TableCell<ICFBamTZTimestampColObj, Calendar>>() { @Override public TableCell<ICFBamTZTimestampColObj, Calendar> call( TableColumn<ICFBamTZTimestampColObj, Calendar> arg) { return new CFTZTimestampTableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamTZTimestampColObj, Calendar>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampColObj, 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<ICFBamTZTimestampColObj, Calendar>, TableCell<ICFBamTZTimestampColObj, Calendar>>() { @Override public TableCell<ICFBamTZTimestampColObj, Calendar> call( TableColumn<ICFBamTZTimestampColObj, Calendar> arg) { return new CFTZTimestampTableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamTZTimestampColObj, Calendar>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampColObj, 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<ICFBamTZTimestampColObj, Calendar>, TableCell<ICFBamTZTimestampColObj, Calendar>>() { @Override public TableCell<ICFBamTZTimestampColObj, Calendar> call( TableColumn<ICFBamTZTimestampColObj, Calendar> arg) { return new CFTZTimestampTableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamTZTimestampColObj, Calendar>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampColObj, 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<ICFBamTZTimestampColObj, Calendar>, TableCell<ICFBamTZTimestampColObj, Calendar>>() { @Override public TableCell<ICFBamTZTimestampColObj, Calendar> call( TableColumn<ICFBamTZTimestampColObj, Calendar> arg) { return new CFTZTimestampTableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamTZTimestampColObj, Calendar>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampColObj, 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<ICFBamTZTimestampColObj, Calendar>, TableCell<ICFBamTZTimestampColObj, Calendar>>() { @Override public TableCell<ICFBamTZTimestampColObj, Calendar> call( TableColumn<ICFBamTZTimestampColObj, Calendar> arg) { return new CFTZTimestampTableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamTZTimestampColObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamTZTimestampColObj, ICFBamSchemaDefObj> p) { ICFBamTZTimestampColObj 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<ICFBamTZTimestampColObj, ICFBamSchemaDefObj>, TableCell<ICFBamTZTimestampColObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamTZTimestampColObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamTZTimestampColObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamTZTimestampColObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty() .addListener(new ChangeListener<ICFBamTZTimestampColObj>() { @Override public void changed(ObservableValue<? extends ICFBamTZTimestampColObj> observable, ICFBamTZTimestampColObj oldValue, ICFBamTZTimestampColObj 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 (observableListOfTZTimestampCol != null) { dataTable.setItems(observableListOfTZTimestampCol); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXTZTimestampTypeListPane.java
public CFBamJavaFXTZTimestampTypeListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamSchemaDefObj argContainer, ICFBamTZTimestampTypeObj argFocus, Collection<ICFBamTZTimestampTypeObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();/*w w w . j a v a2 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<ICFBamTZTimestampTypeObj>(); tableColumnId = new TableColumn<ICFBamTZTimestampTypeObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamTZTimestampTypeObj, 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<ICFBamTZTimestampTypeObj, Long>, TableCell<ICFBamTZTimestampTypeObj, Long>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, Long> call( TableColumn<ICFBamTZTimestampTypeObj, Long> arg) { return new CFInt64TableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamTZTimestampTypeObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampTypeObj, 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<ICFBamTZTimestampTypeObj, String>, TableCell<ICFBamTZTimestampTypeObj, String>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, String> call( TableColumn<ICFBamTZTimestampTypeObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamTZTimestampTypeObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampTypeObj, 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<ICFBamTZTimestampTypeObj, String>, TableCell<ICFBamTZTimestampTypeObj, String>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, String> call( TableColumn<ICFBamTZTimestampTypeObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamTZTimestampTypeObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampTypeObj, 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<ICFBamTZTimestampTypeObj, String>, TableCell<ICFBamTZTimestampTypeObj, String>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, String> call( TableColumn<ICFBamTZTimestampTypeObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamTZTimestampTypeObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampTypeObj, 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<ICFBamTZTimestampTypeObj, String>, TableCell<ICFBamTZTimestampTypeObj, String>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, String> call( TableColumn<ICFBamTZTimestampTypeObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamTZTimestampTypeObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampTypeObj, 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<ICFBamTZTimestampTypeObj, String>, TableCell<ICFBamTZTimestampTypeObj, String>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, String> call( TableColumn<ICFBamTZTimestampTypeObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamTZTimestampTypeObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimestampTypeObj, 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<ICFBamTZTimestampTypeObj, Boolean>, TableCell<ICFBamTZTimestampTypeObj, Boolean>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, Boolean> call( TableColumn<ICFBamTZTimestampTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamTZTimestampTypeObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimestampTypeObj, 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<ICFBamTZTimestampTypeObj, Boolean>, TableCell<ICFBamTZTimestampTypeObj, Boolean>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, Boolean> call( TableColumn<ICFBamTZTimestampTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamTZTimestampTypeObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimestampTypeObj, 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<ICFBamTZTimestampTypeObj, Boolean>, TableCell<ICFBamTZTimestampTypeObj, Boolean>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, Boolean> call( TableColumn<ICFBamTZTimestampTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamTZTimestampTypeObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampTypeObj, 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<ICFBamTZTimestampTypeObj, String>, TableCell<ICFBamTZTimestampTypeObj, String>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, String> call( TableColumn<ICFBamTZTimestampTypeObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamTZTimestampTypeObj, Calendar>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampTypeObj, 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<ICFBamTZTimestampTypeObj, Calendar>, TableCell<ICFBamTZTimestampTypeObj, Calendar>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, Calendar> call( TableColumn<ICFBamTZTimestampTypeObj, Calendar> arg) { return new CFTZTimestampTableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamTZTimestampTypeObj, Calendar>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampTypeObj, 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<ICFBamTZTimestampTypeObj, Calendar>, TableCell<ICFBamTZTimestampTypeObj, Calendar>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, Calendar> call( TableColumn<ICFBamTZTimestampTypeObj, Calendar> arg) { return new CFTZTimestampTableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamTZTimestampTypeObj, Calendar>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampTypeObj, 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<ICFBamTZTimestampTypeObj, Calendar>, TableCell<ICFBamTZTimestampTypeObj, Calendar>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, Calendar> call( TableColumn<ICFBamTZTimestampTypeObj, Calendar> arg) { return new CFTZTimestampTableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamTZTimestampTypeObj, Calendar>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampTypeObj, 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<ICFBamTZTimestampTypeObj, Calendar>, TableCell<ICFBamTZTimestampTypeObj, Calendar>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, Calendar> call( TableColumn<ICFBamTZTimestampTypeObj, Calendar> arg) { return new CFTZTimestampTableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamTZTimestampTypeObj, Calendar>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampTypeObj, 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<ICFBamTZTimestampTypeObj, Calendar>, TableCell<ICFBamTZTimestampTypeObj, Calendar>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, Calendar> call( TableColumn<ICFBamTZTimestampTypeObj, Calendar> arg) { return new CFTZTimestampTableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamTZTimestampTypeObj, Calendar>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampTypeObj, 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<ICFBamTZTimestampTypeObj, Calendar>, TableCell<ICFBamTZTimestampTypeObj, Calendar>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, Calendar> call( TableColumn<ICFBamTZTimestampTypeObj, Calendar> arg) { return new CFTZTimestampTableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamTZTimestampTypeObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamTZTimestampTypeObj, ICFBamSchemaDefObj> p) { ICFBamTZTimestampTypeObj 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<ICFBamTZTimestampTypeObj, ICFBamSchemaDefObj>, TableCell<ICFBamTZTimestampTypeObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamTZTimestampTypeObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamTZTimestampTypeObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty() .addListener(new ChangeListener<ICFBamTZTimestampTypeObj>() { @Override public void changed(ObservableValue<? extends ICFBamTZTimestampTypeObj> observable, ICFBamTZTimestampTypeObj oldValue, ICFBamTZTimestampTypeObj 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 (observableListOfTZTimestampType != null) { dataTable.setItems(observableListOfTZTimestampType); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXUuidDefListPane.java
public CFBamJavaFXUuidDefListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamScopeObj argContainer, ICFBamUuidDefObj argFocus, Collection<ICFBamUuidDefObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();// w w w . j a v a 2 s . co m final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamUuidDefObj>(); tableColumnObjKind = new TableColumn<ICFBamUuidDefObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidDefObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamUuidDefObj, String> p) { ICFBamUuidDefObj 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<ICFBamUuidDefObj, String>, TableCell<ICFBamUuidDefObj, String>>() { @Override public TableCell<ICFBamUuidDefObj, String> call(TableColumn<ICFBamUuidDefObj, String> arg) { return new CFStringTableCell<ICFBamUuidDefObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamUuidDefObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidDefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamUuidDefObj, 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<ICFBamUuidDefObj, Long>, TableCell<ICFBamUuidDefObj, Long>>() { @Override public TableCell<ICFBamUuidDefObj, Long> call(TableColumn<ICFBamUuidDefObj, Long> arg) { return new CFInt64TableCell<ICFBamUuidDefObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamUuidDefObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUuidDefObj, 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<ICFBamUuidDefObj, String>, TableCell<ICFBamUuidDefObj, String>>() { @Override public TableCell<ICFBamUuidDefObj, String> call(TableColumn<ICFBamUuidDefObj, String> arg) { return new CFStringTableCell<ICFBamUuidDefObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamUuidDefObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUuidDefObj, 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<ICFBamUuidDefObj, String>, TableCell<ICFBamUuidDefObj, String>>() { @Override public TableCell<ICFBamUuidDefObj, String> call(TableColumn<ICFBamUuidDefObj, String> arg) { return new CFStringTableCell<ICFBamUuidDefObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamUuidDefObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUuidDefObj, 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<ICFBamUuidDefObj, String>, TableCell<ICFBamUuidDefObj, String>>() { @Override public TableCell<ICFBamUuidDefObj, String> call(TableColumn<ICFBamUuidDefObj, String> arg) { return new CFStringTableCell<ICFBamUuidDefObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamUuidDefObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUuidDefObj, 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<ICFBamUuidDefObj, String>, TableCell<ICFBamUuidDefObj, String>>() { @Override public TableCell<ICFBamUuidDefObj, String> call(TableColumn<ICFBamUuidDefObj, String> arg) { return new CFStringTableCell<ICFBamUuidDefObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamUuidDefObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUuidDefObj, 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<ICFBamUuidDefObj, String>, TableCell<ICFBamUuidDefObj, String>>() { @Override public TableCell<ICFBamUuidDefObj, String> call(TableColumn<ICFBamUuidDefObj, String> arg) { return new CFStringTableCell<ICFBamUuidDefObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamUuidDefObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUuidDefObj, 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<ICFBamUuidDefObj, Boolean>, TableCell<ICFBamUuidDefObj, Boolean>>() { @Override public TableCell<ICFBamUuidDefObj, Boolean> call(TableColumn<ICFBamUuidDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamUuidDefObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamUuidDefObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUuidDefObj, 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<ICFBamUuidDefObj, Boolean>, TableCell<ICFBamUuidDefObj, Boolean>>() { @Override public TableCell<ICFBamUuidDefObj, Boolean> call(TableColumn<ICFBamUuidDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamUuidDefObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamUuidDefObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUuidDefObj, 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<ICFBamUuidDefObj, Boolean>, TableCell<ICFBamUuidDefObj, Boolean>>() { @Override public TableCell<ICFBamUuidDefObj, Boolean> call(TableColumn<ICFBamUuidDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamUuidDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamUuidDefObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUuidDefObj, 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<ICFBamUuidDefObj, String>, TableCell<ICFBamUuidDefObj, String>>() { @Override public TableCell<ICFBamUuidDefObj, String> call(TableColumn<ICFBamUuidDefObj, String> arg) { return new CFStringTableCell<ICFBamUuidDefObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamUuidDefObj, UUID>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidDefObj, UUID>, ObservableValue<UUID>>() { public ObservableValue<UUID> call(CellDataFeatures<ICFBamUuidDefObj, UUID> p) { ICFBamUuidDefObj obj = p.getValue(); if (obj == null) { return (null); } else { UUID value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<UUID> observable = new ReadOnlyObjectWrapper<UUID>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamUuidDefObj, UUID>, TableCell<ICFBamUuidDefObj, UUID>>() { @Override public TableCell<ICFBamUuidDefObj, UUID> call(TableColumn<ICFBamUuidDefObj, UUID> arg) { return new CFUuidTableCell<ICFBamUuidDefObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamUuidDefObj, UUID>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidDefObj, UUID>, ObservableValue<UUID>>() { public ObservableValue<UUID> call(CellDataFeatures<ICFBamUuidDefObj, UUID> p) { ICFBamUuidDefObj obj = p.getValue(); if (obj == null) { return (null); } else { UUID value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<UUID> observable = new ReadOnlyObjectWrapper<UUID>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamUuidDefObj, UUID>, TableCell<ICFBamUuidDefObj, UUID>>() { @Override public TableCell<ICFBamUuidDefObj, UUID> call(TableColumn<ICFBamUuidDefObj, UUID> arg) { return new CFUuidTableCell<ICFBamUuidDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnNullValue = new TableColumn<ICFBamUuidDefObj, UUID>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidDefObj, UUID>, ObservableValue<UUID>>() { public ObservableValue<UUID> call(CellDataFeatures<ICFBamUuidDefObj, UUID> p) { ICFBamUuidDefObj obj = p.getValue(); if (obj == null) { return (null); } else { UUID value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<UUID> observable = new ReadOnlyObjectWrapper<UUID>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamUuidDefObj, UUID>, TableCell<ICFBamUuidDefObj, UUID>>() { @Override public TableCell<ICFBamUuidDefObj, UUID> call(TableColumn<ICFBamUuidDefObj, UUID> arg) { return new CFUuidTableCell<ICFBamUuidDefObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamUuidDefObj, UUID>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidDefObj, UUID>, ObservableValue<UUID>>() { public ObservableValue<UUID> call(CellDataFeatures<ICFBamUuidDefObj, UUID> p) { ICFBamUuidDefObj obj = p.getValue(); if (obj == null) { return (null); } else { UUID value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<UUID> observable = new ReadOnlyObjectWrapper<UUID>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamUuidDefObj, UUID>, TableCell<ICFBamUuidDefObj, UUID>>() { @Override public TableCell<ICFBamUuidDefObj, UUID> call(TableColumn<ICFBamUuidDefObj, UUID> arg) { return new CFUuidTableCell<ICFBamUuidDefObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamUuidDefObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidDefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamUuidDefObj, ICFBamSchemaDefObj> p) { ICFBamUuidDefObj 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<ICFBamUuidDefObj, ICFBamSchemaDefObj>, TableCell<ICFBamUuidDefObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamUuidDefObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamUuidDefObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamUuidDefObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamUuidDefObj>() { @Override public void changed(ObservableValue<? extends ICFBamUuidDefObj> observable, ICFBamUuidDefObj oldValue, ICFBamUuidDefObj 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 (observableListOfUuidDef != null) { dataTable.setItems(observableListOfUuidDef); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXTZTimeDefListPane.java
public CFBamJavaFXTZTimeDefListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamScopeObj argContainer, ICFBamTZTimeDefObj argFocus, Collection<ICFBamTZTimeDefObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();// w w w . j a v a 2s .c om final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamTZTimeDefObj>(); tableColumnObjKind = new TableColumn<ICFBamTZTimeDefObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeDefObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeDefObj, String> p) { ICFBamTZTimeDefObj 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<ICFBamTZTimeDefObj, String>, TableCell<ICFBamTZTimeDefObj, String>>() { @Override public TableCell<ICFBamTZTimeDefObj, String> call(TableColumn<ICFBamTZTimeDefObj, String> arg) { return new CFStringTableCell<ICFBamTZTimeDefObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamTZTimeDefObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeDefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamTZTimeDefObj, 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<ICFBamTZTimeDefObj, Long>, TableCell<ICFBamTZTimeDefObj, Long>>() { @Override public TableCell<ICFBamTZTimeDefObj, Long> call(TableColumn<ICFBamTZTimeDefObj, Long> arg) { return new CFInt64TableCell<ICFBamTZTimeDefObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamTZTimeDefObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeDefObj, 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<ICFBamTZTimeDefObj, String>, TableCell<ICFBamTZTimeDefObj, String>>() { @Override public TableCell<ICFBamTZTimeDefObj, String> call(TableColumn<ICFBamTZTimeDefObj, String> arg) { return new CFStringTableCell<ICFBamTZTimeDefObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamTZTimeDefObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeDefObj, 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<ICFBamTZTimeDefObj, String>, TableCell<ICFBamTZTimeDefObj, String>>() { @Override public TableCell<ICFBamTZTimeDefObj, String> call(TableColumn<ICFBamTZTimeDefObj, String> arg) { return new CFStringTableCell<ICFBamTZTimeDefObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamTZTimeDefObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeDefObj, 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<ICFBamTZTimeDefObj, String>, TableCell<ICFBamTZTimeDefObj, String>>() { @Override public TableCell<ICFBamTZTimeDefObj, String> call(TableColumn<ICFBamTZTimeDefObj, String> arg) { return new CFStringTableCell<ICFBamTZTimeDefObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamTZTimeDefObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeDefObj, 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<ICFBamTZTimeDefObj, String>, TableCell<ICFBamTZTimeDefObj, String>>() { @Override public TableCell<ICFBamTZTimeDefObj, String> call(TableColumn<ICFBamTZTimeDefObj, String> arg) { return new CFStringTableCell<ICFBamTZTimeDefObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamTZTimeDefObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeDefObj, 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<ICFBamTZTimeDefObj, String>, TableCell<ICFBamTZTimeDefObj, String>>() { @Override public TableCell<ICFBamTZTimeDefObj, String> call(TableColumn<ICFBamTZTimeDefObj, String> arg) { return new CFStringTableCell<ICFBamTZTimeDefObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamTZTimeDefObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimeDefObj, 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<ICFBamTZTimeDefObj, Boolean>, TableCell<ICFBamTZTimeDefObj, Boolean>>() { @Override public TableCell<ICFBamTZTimeDefObj, Boolean> call( TableColumn<ICFBamTZTimeDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZTimeDefObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamTZTimeDefObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimeDefObj, 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<ICFBamTZTimeDefObj, Boolean>, TableCell<ICFBamTZTimeDefObj, Boolean>>() { @Override public TableCell<ICFBamTZTimeDefObj, Boolean> call( TableColumn<ICFBamTZTimeDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZTimeDefObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamTZTimeDefObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimeDefObj, 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<ICFBamTZTimeDefObj, Boolean>, TableCell<ICFBamTZTimeDefObj, Boolean>>() { @Override public TableCell<ICFBamTZTimeDefObj, Boolean> call( TableColumn<ICFBamTZTimeDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZTimeDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamTZTimeDefObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeDefObj, 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<ICFBamTZTimeDefObj, String>, TableCell<ICFBamTZTimeDefObj, String>>() { @Override public TableCell<ICFBamTZTimeDefObj, String> call(TableColumn<ICFBamTZTimeDefObj, String> arg) { return new CFStringTableCell<ICFBamTZTimeDefObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamTZTimeDefObj, Calendar>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimeDefObj, Calendar> p) { ICFBamTZTimeDefObj 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<ICFBamTZTimeDefObj, Calendar>, TableCell<ICFBamTZTimeDefObj, Calendar>>() { @Override public TableCell<ICFBamTZTimeDefObj, Calendar> call( TableColumn<ICFBamTZTimeDefObj, Calendar> arg) { return new CFTZTimeTableCell<ICFBamTZTimeDefObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamTZTimeDefObj, Calendar>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimeDefObj, Calendar> p) { ICFBamTZTimeDefObj 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<ICFBamTZTimeDefObj, Calendar>, TableCell<ICFBamTZTimeDefObj, Calendar>>() { @Override public TableCell<ICFBamTZTimeDefObj, Calendar> call( TableColumn<ICFBamTZTimeDefObj, Calendar> arg) { return new CFTZTimeTableCell<ICFBamTZTimeDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnNullValue = new TableColumn<ICFBamTZTimeDefObj, Calendar>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimeDefObj, Calendar> p) { ICFBamTZTimeDefObj 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<ICFBamTZTimeDefObj, Calendar>, TableCell<ICFBamTZTimeDefObj, Calendar>>() { @Override public TableCell<ICFBamTZTimeDefObj, Calendar> call( TableColumn<ICFBamTZTimeDefObj, Calendar> arg) { return new CFTZTimeTableCell<ICFBamTZTimeDefObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamTZTimeDefObj, Calendar>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimeDefObj, Calendar> p) { ICFBamTZTimeDefObj 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<ICFBamTZTimeDefObj, Calendar>, TableCell<ICFBamTZTimeDefObj, Calendar>>() { @Override public TableCell<ICFBamTZTimeDefObj, Calendar> call( TableColumn<ICFBamTZTimeDefObj, Calendar> arg) { return new CFTZTimeTableCell<ICFBamTZTimeDefObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamTZTimeDefObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeDefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamTZTimeDefObj, ICFBamSchemaDefObj> p) { ICFBamTZTimeDefObj 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<ICFBamTZTimeDefObj, ICFBamSchemaDefObj>, TableCell<ICFBamTZTimeDefObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamTZTimeDefObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamTZTimeDefObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamTZTimeDefObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamTZTimeDefObj>() { @Override public void changed(ObservableValue<? extends ICFBamTZTimeDefObj> observable, ICFBamTZTimeDefObj oldValue, ICFBamTZTimeDefObj 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 (observableListOfTZTimeDef != null) { dataTable.setItems(observableListOfTZTimeDef); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXBoolDefListPane.java
public CFBamJavaFXBoolDefListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamScopeObj argContainer, ICFBamBoolDefObj argFocus, Collection<ICFBamBoolDefObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();/*from w w w.j a v a2 s. 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<ICFBamBoolDefObj>(); tableColumnObjKind = new TableColumn<ICFBamBoolDefObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamBoolDefObj, String> p) { ICFBamBoolDefObj 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<ICFBamBoolDefObj, String>, TableCell<ICFBamBoolDefObj, String>>() { @Override public TableCell<ICFBamBoolDefObj, String> call(TableColumn<ICFBamBoolDefObj, String> arg) { return new CFStringTableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamBoolDefObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamBoolDefObj, 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<ICFBamBoolDefObj, Long>, TableCell<ICFBamBoolDefObj, Long>>() { @Override public TableCell<ICFBamBoolDefObj, Long> call(TableColumn<ICFBamBoolDefObj, Long> arg) { return new CFInt64TableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamBoolDefObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBoolDefObj, 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<ICFBamBoolDefObj, String>, TableCell<ICFBamBoolDefObj, String>>() { @Override public TableCell<ICFBamBoolDefObj, String> call(TableColumn<ICFBamBoolDefObj, String> arg) { return new CFStringTableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamBoolDefObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBoolDefObj, 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<ICFBamBoolDefObj, String>, TableCell<ICFBamBoolDefObj, String>>() { @Override public TableCell<ICFBamBoolDefObj, String> call(TableColumn<ICFBamBoolDefObj, String> arg) { return new CFStringTableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamBoolDefObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBoolDefObj, 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<ICFBamBoolDefObj, String>, TableCell<ICFBamBoolDefObj, String>>() { @Override public TableCell<ICFBamBoolDefObj, String> call(TableColumn<ICFBamBoolDefObj, String> arg) { return new CFStringTableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamBoolDefObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBoolDefObj, 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<ICFBamBoolDefObj, String>, TableCell<ICFBamBoolDefObj, String>>() { @Override public TableCell<ICFBamBoolDefObj, String> call(TableColumn<ICFBamBoolDefObj, String> arg) { return new CFStringTableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamBoolDefObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBoolDefObj, 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<ICFBamBoolDefObj, String>, TableCell<ICFBamBoolDefObj, String>>() { @Override public TableCell<ICFBamBoolDefObj, String> call(TableColumn<ICFBamBoolDefObj, String> arg) { return new CFStringTableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamBoolDefObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBoolDefObj, 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<ICFBamBoolDefObj, Boolean>, TableCell<ICFBamBoolDefObj, Boolean>>() { @Override public TableCell<ICFBamBoolDefObj, Boolean> call(TableColumn<ICFBamBoolDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamBoolDefObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBoolDefObj, 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<ICFBamBoolDefObj, Boolean>, TableCell<ICFBamBoolDefObj, Boolean>>() { @Override public TableCell<ICFBamBoolDefObj, Boolean> call(TableColumn<ICFBamBoolDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamBoolDefObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBoolDefObj, 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<ICFBamBoolDefObj, Boolean>, TableCell<ICFBamBoolDefObj, Boolean>>() { @Override public TableCell<ICFBamBoolDefObj, Boolean> call(TableColumn<ICFBamBoolDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamBoolDefObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBoolDefObj, 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<ICFBamBoolDefObj, String>, TableCell<ICFBamBoolDefObj, String>>() { @Override public TableCell<ICFBamBoolDefObj, String> call(TableColumn<ICFBamBoolDefObj, String> arg) { return new CFStringTableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamBoolDefObj, Boolean>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBoolDefObj, Boolean> p) { ICFBamBoolDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Boolean value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamBoolDefObj, Boolean>, TableCell<ICFBamBoolDefObj, Boolean>>() { @Override public TableCell<ICFBamBoolDefObj, Boolean> call(TableColumn<ICFBamBoolDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamBoolDefObj, Boolean>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBoolDefObj, Boolean> p) { ICFBamBoolDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Boolean value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamBoolDefObj, Boolean>, TableCell<ICFBamBoolDefObj, Boolean>>() { @Override public TableCell<ICFBamBoolDefObj, Boolean> call(TableColumn<ICFBamBoolDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnFalseString = new TableColumn<ICFBamBoolDefObj, String>("FalseString"); tableColumnFalseString.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBoolDefObj, String> p) { ICFBamBoolDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalFalseString(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnFalseString.setCellFactory( new Callback<TableColumn<ICFBamBoolDefObj, String>, TableCell<ICFBamBoolDefObj, String>>() { @Override public TableCell<ICFBamBoolDefObj, String> call(TableColumn<ICFBamBoolDefObj, String> arg) { return new CFStringTableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnFalseString); tableColumnTrueString = new TableColumn<ICFBamBoolDefObj, String>("TrueString"); tableColumnTrueString.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBoolDefObj, String> p) { ICFBamBoolDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalTrueString(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnTrueString.setCellFactory( new Callback<TableColumn<ICFBamBoolDefObj, String>, TableCell<ICFBamBoolDefObj, String>>() { @Override public TableCell<ICFBamBoolDefObj, String> call(TableColumn<ICFBamBoolDefObj, String> arg) { return new CFStringTableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnTrueString); tableColumnNullString = new TableColumn<ICFBamBoolDefObj, String>("NullString"); tableColumnNullString.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBoolDefObj, String> p) { ICFBamBoolDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalNullString(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnNullString.setCellFactory( new Callback<TableColumn<ICFBamBoolDefObj, String>, TableCell<ICFBamBoolDefObj, String>>() { @Override public TableCell<ICFBamBoolDefObj, String> call(TableColumn<ICFBamBoolDefObj, String> arg) { return new CFStringTableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnNullString); tableColumnLookupDefSchema = new TableColumn<ICFBamBoolDefObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamBoolDefObj, ICFBamSchemaDefObj> p) { ICFBamBoolDefObj 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<ICFBamBoolDefObj, ICFBamSchemaDefObj>, TableCell<ICFBamBoolDefObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamBoolDefObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamBoolDefObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamBoolDefObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamBoolDefObj>() { @Override public void changed(ObservableValue<? extends ICFBamBoolDefObj> observable, ICFBamBoolDefObj oldValue, ICFBamBoolDefObj 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 (observableListOfBoolDef != null) { dataTable.setItems(observableListOfBoolDef); } 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();//from w ww . j a v 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<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.CFBamJavaFXEnumDefListPane.java
public CFBamJavaFXEnumDefListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamScopeObj argContainer, ICFBamEnumDefObj argFocus, Collection<ICFBamEnumDefObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();// www. j a v a 2 s . 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<ICFBamEnumDefObj>(); tableColumnObjKind = new TableColumn<ICFBamEnumDefObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamEnumDefObj, String> p) { ICFBamEnumDefObj 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<ICFBamEnumDefObj, String>, TableCell<ICFBamEnumDefObj, String>>() { @Override public TableCell<ICFBamEnumDefObj, String> call(TableColumn<ICFBamEnumDefObj, String> arg) { return new CFStringTableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamEnumDefObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamEnumDefObj, 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<ICFBamEnumDefObj, Long>, TableCell<ICFBamEnumDefObj, Long>>() { @Override public TableCell<ICFBamEnumDefObj, Long> call(TableColumn<ICFBamEnumDefObj, Long> arg) { return new CFInt64TableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamEnumDefObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamEnumDefObj, 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<ICFBamEnumDefObj, String>, TableCell<ICFBamEnumDefObj, String>>() { @Override public TableCell<ICFBamEnumDefObj, String> call(TableColumn<ICFBamEnumDefObj, String> arg) { return new CFStringTableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamEnumDefObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamEnumDefObj, 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<ICFBamEnumDefObj, String>, TableCell<ICFBamEnumDefObj, String>>() { @Override public TableCell<ICFBamEnumDefObj, String> call(TableColumn<ICFBamEnumDefObj, String> arg) { return new CFStringTableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamEnumDefObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamEnumDefObj, 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<ICFBamEnumDefObj, String>, TableCell<ICFBamEnumDefObj, String>>() { @Override public TableCell<ICFBamEnumDefObj, String> call(TableColumn<ICFBamEnumDefObj, String> arg) { return new CFStringTableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamEnumDefObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamEnumDefObj, 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<ICFBamEnumDefObj, String>, TableCell<ICFBamEnumDefObj, String>>() { @Override public TableCell<ICFBamEnumDefObj, String> call(TableColumn<ICFBamEnumDefObj, String> arg) { return new CFStringTableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamEnumDefObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamEnumDefObj, 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<ICFBamEnumDefObj, String>, TableCell<ICFBamEnumDefObj, String>>() { @Override public TableCell<ICFBamEnumDefObj, String> call(TableColumn<ICFBamEnumDefObj, String> arg) { return new CFStringTableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamEnumDefObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamEnumDefObj, 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<ICFBamEnumDefObj, Boolean>, TableCell<ICFBamEnumDefObj, Boolean>>() { @Override public TableCell<ICFBamEnumDefObj, Boolean> call(TableColumn<ICFBamEnumDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamEnumDefObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamEnumDefObj, 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<ICFBamEnumDefObj, Boolean>, TableCell<ICFBamEnumDefObj, Boolean>>() { @Override public TableCell<ICFBamEnumDefObj, Boolean> call(TableColumn<ICFBamEnumDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamEnumDefObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamEnumDefObj, 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<ICFBamEnumDefObj, Boolean>, TableCell<ICFBamEnumDefObj, Boolean>>() { @Override public TableCell<ICFBamEnumDefObj, Boolean> call(TableColumn<ICFBamEnumDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamEnumDefObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamEnumDefObj, 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<ICFBamEnumDefObj, String>, TableCell<ICFBamEnumDefObj, String>>() { @Override public TableCell<ICFBamEnumDefObj, String> call(TableColumn<ICFBamEnumDefObj, String> arg) { return new CFStringTableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamEnumDefObj, Short>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamEnumDefObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamEnumDefObj, Short>, TableCell<ICFBamEnumDefObj, Short>>() { @Override public TableCell<ICFBamEnumDefObj, Short> call(TableColumn<ICFBamEnumDefObj, Short> arg) { return new CFInt16TableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamEnumDefObj, Short>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamEnumDefObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamEnumDefObj, Short>, TableCell<ICFBamEnumDefObj, Short>>() { @Override public TableCell<ICFBamEnumDefObj, Short> call(TableColumn<ICFBamEnumDefObj, Short> arg) { return new CFInt16TableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamEnumDefObj, Short>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamEnumDefObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalMinValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnMinValue.setCellFactory( new Callback<TableColumn<ICFBamEnumDefObj, Short>, TableCell<ICFBamEnumDefObj, Short>>() { @Override public TableCell<ICFBamEnumDefObj, Short> call(TableColumn<ICFBamEnumDefObj, Short> arg) { return new CFInt16TableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamEnumDefObj, Short>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamEnumDefObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalMaxValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnMaxValue.setCellFactory( new Callback<TableColumn<ICFBamEnumDefObj, Short>, TableCell<ICFBamEnumDefObj, Short>>() { @Override public TableCell<ICFBamEnumDefObj, Short> call(TableColumn<ICFBamEnumDefObj, Short> arg) { return new CFInt16TableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamEnumDefObj, Short>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamEnumDefObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamEnumDefObj, Short>, TableCell<ICFBamEnumDefObj, Short>>() { @Override public TableCell<ICFBamEnumDefObj, Short> call(TableColumn<ICFBamEnumDefObj, Short> arg) { return new CFInt16TableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamEnumDefObj, Short>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamEnumDefObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamEnumDefObj, Short>, TableCell<ICFBamEnumDefObj, Short>>() { @Override public TableCell<ICFBamEnumDefObj, Short> call(TableColumn<ICFBamEnumDefObj, Short> arg) { return new CFInt16TableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamEnumDefObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamEnumDefObj, ICFBamSchemaDefObj> p) { ICFBamEnumDefObj 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<ICFBamEnumDefObj, ICFBamSchemaDefObj>, TableCell<ICFBamEnumDefObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamEnumDefObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamEnumDefObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamEnumDefObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamEnumDefObj>() { @Override public void changed(ObservableValue<? extends ICFBamEnumDefObj> observable, ICFBamEnumDefObj oldValue, ICFBamEnumDefObj 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 (observableListOfEnumDef != null) { dataTable.setItems(observableListOfEnumDef); } adjustListButtons(); }