List of usage examples for javafx.scene.control TableColumn TableColumn
public TableColumn(String text)
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXUuidColPickerPane.java
public CFBamJavaFXUuidColPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamUuidColObj argFocus, ICFBamTableObj argContainer, Collection<ICFBamUuidColObj> argDataCollection, ICFBamJavaFXUuidColChosen whenChosen) { super();//from w ww .ja va 2 s .c o m final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } if (whenChosen == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6, "whenChosen"); } invokeWhenChosen = whenChosen; // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamUuidColObj>(); tableColumnId = new TableColumn<ICFBamUuidColObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, Long>, TableCell<ICFBamUuidColObj, Long>>() { @Override public TableCell<ICFBamUuidColObj, Long> call(TableColumn<ICFBamUuidColObj, Long> arg) { return new CFInt64TableCell<ICFBamUuidColObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamUuidColObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, String>, TableCell<ICFBamUuidColObj, String>>() { @Override public TableCell<ICFBamUuidColObj, String> call(TableColumn<ICFBamUuidColObj, String> arg) { return new CFStringTableCell<ICFBamUuidColObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamUuidColObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, String>, TableCell<ICFBamUuidColObj, String>>() { @Override public TableCell<ICFBamUuidColObj, String> call(TableColumn<ICFBamUuidColObj, String> arg) { return new CFStringTableCell<ICFBamUuidColObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamUuidColObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, String>, TableCell<ICFBamUuidColObj, String>>() { @Override public TableCell<ICFBamUuidColObj, String> call(TableColumn<ICFBamUuidColObj, String> arg) { return new CFStringTableCell<ICFBamUuidColObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamUuidColObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, String>, TableCell<ICFBamUuidColObj, String>>() { @Override public TableCell<ICFBamUuidColObj, String> call(TableColumn<ICFBamUuidColObj, String> arg) { return new CFStringTableCell<ICFBamUuidColObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamUuidColObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, String>, TableCell<ICFBamUuidColObj, String>>() { @Override public TableCell<ICFBamUuidColObj, String> call(TableColumn<ICFBamUuidColObj, String> arg) { return new CFStringTableCell<ICFBamUuidColObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamUuidColObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, Boolean>, TableCell<ICFBamUuidColObj, Boolean>>() { @Override public TableCell<ICFBamUuidColObj, Boolean> call(TableColumn<ICFBamUuidColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamUuidColObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamUuidColObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, Boolean>, TableCell<ICFBamUuidColObj, Boolean>>() { @Override public TableCell<ICFBamUuidColObj, Boolean> call(TableColumn<ICFBamUuidColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamUuidColObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamUuidColObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, Boolean>, TableCell<ICFBamUuidColObj, Boolean>>() { @Override public TableCell<ICFBamUuidColObj, Boolean> call(TableColumn<ICFBamUuidColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamUuidColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamUuidColObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, String>, TableCell<ICFBamUuidColObj, String>>() { @Override public TableCell<ICFBamUuidColObj, String> call(TableColumn<ICFBamUuidColObj, String> arg) { return new CFStringTableCell<ICFBamUuidColObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamUuidColObj, UUID>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidColObj, UUID>, ObservableValue<UUID>>() { public ObservableValue<UUID> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, UUID>, TableCell<ICFBamUuidColObj, UUID>>() { @Override public TableCell<ICFBamUuidColObj, UUID> call(TableColumn<ICFBamUuidColObj, UUID> arg) { return new CFUuidTableCell<ICFBamUuidColObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamUuidColObj, UUID>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidColObj, UUID>, ObservableValue<UUID>>() { public ObservableValue<UUID> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, UUID>, TableCell<ICFBamUuidColObj, UUID>>() { @Override public TableCell<ICFBamUuidColObj, UUID> call(TableColumn<ICFBamUuidColObj, UUID> arg) { return new CFUuidTableCell<ICFBamUuidColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnNullValue = new TableColumn<ICFBamUuidColObj, UUID>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidColObj, UUID>, ObservableValue<UUID>>() { public ObservableValue<UUID> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, UUID>, TableCell<ICFBamUuidColObj, UUID>>() { @Override public TableCell<ICFBamUuidColObj, UUID> call(TableColumn<ICFBamUuidColObj, UUID> arg) { return new CFUuidTableCell<ICFBamUuidColObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamUuidColObj, UUID>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidColObj, UUID>, ObservableValue<UUID>>() { public ObservableValue<UUID> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, UUID>, TableCell<ICFBamUuidColObj, UUID>>() { @Override public TableCell<ICFBamUuidColObj, UUID> call(TableColumn<ICFBamUuidColObj, UUID> arg) { return new CFUuidTableCell<ICFBamUuidColObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamUuidColObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamUuidColObj, ICFBamSchemaDefObj> p) { ICFBamUuidColObj 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<ICFBamUuidColObj, ICFBamSchemaDefObj>, TableCell<ICFBamUuidColObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamUuidColObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamUuidColObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamUuidColObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamUuidColObj>() { @Override public void changed(ObservableValue<? extends ICFBamUuidColObj> observable, ICFBamUuidColObj oldValue, ICFBamUuidColObj newValue) { setJavaFXFocus(newValue); if (buttonChooseSelected != null) { if (newValue != null) { buttonChooseSelected.setDisable(false); } else { buttonChooseSelected.setDisable(true); } } } }); hboxMenu = new CFHBox(10); buttonCancel = new CFButton(); buttonCancel.setMinWidth(200); buttonCancel.setText("Cancel"); buttonCancel.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { cfFormManager.closeCurrentForm(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonCancel); buttonChooseNone = new CFButton(); buttonChooseNone.setMinWidth(200); buttonChooseNone.setText("ChooseNone"); buttonChooseNone.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); if (schemaObj == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "schemaObj"); } invokeWhenChosen.choseUuidCol(null); cfFormManager.closeCurrentForm(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonChooseNone); buttonChooseSelected = new CFButton(); buttonChooseSelected.setMinWidth(200); buttonChooseSelected.setText("ChooseSelected"); buttonChooseSelected.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); if (schemaObj == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "schemaObj"); } ICFBamUuidColObj selectedInstance = getJavaFXFocusAsUuidCol(); invokeWhenChosen.choseUuidCol(selectedInstance); cfFormManager.closeCurrentForm(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonChooseSelected); if (argFocus != null) { dataTable.getSelectionModel().select(argFocus); } setTop(hboxMenu); setCenter(dataTable); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXTimeColPickerPane.java
public CFBamJavaFXTimeColPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamTimeColObj argFocus, ICFBamTableObj argContainer, Collection<ICFBamTimeColObj> argDataCollection, ICFBamJavaFXTimeColChosen whenChosen) { super();/*from ww w .j av 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"); } if (whenChosen == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6, "whenChosen"); } invokeWhenChosen = whenChosen; // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamTimeColObj>(); tableColumnId = new TableColumn<ICFBamTimeColObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimeColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamTimeColObj, 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<ICFBamTimeColObj, Long>, TableCell<ICFBamTimeColObj, Long>>() { @Override public TableCell<ICFBamTimeColObj, Long> call(TableColumn<ICFBamTimeColObj, Long> arg) { return new CFInt64TableCell<ICFBamTimeColObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamTimeColObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimeColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimeColObj, 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<ICFBamTimeColObj, String>, TableCell<ICFBamTimeColObj, String>>() { @Override public TableCell<ICFBamTimeColObj, String> call(TableColumn<ICFBamTimeColObj, String> arg) { return new CFStringTableCell<ICFBamTimeColObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamTimeColObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimeColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimeColObj, 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<ICFBamTimeColObj, String>, TableCell<ICFBamTimeColObj, String>>() { @Override public TableCell<ICFBamTimeColObj, String> call(TableColumn<ICFBamTimeColObj, String> arg) { return new CFStringTableCell<ICFBamTimeColObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamTimeColObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimeColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimeColObj, 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<ICFBamTimeColObj, String>, TableCell<ICFBamTimeColObj, String>>() { @Override public TableCell<ICFBamTimeColObj, String> call(TableColumn<ICFBamTimeColObj, String> arg) { return new CFStringTableCell<ICFBamTimeColObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamTimeColObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimeColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimeColObj, 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<ICFBamTimeColObj, String>, TableCell<ICFBamTimeColObj, String>>() { @Override public TableCell<ICFBamTimeColObj, String> call(TableColumn<ICFBamTimeColObj, String> arg) { return new CFStringTableCell<ICFBamTimeColObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamTimeColObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimeColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimeColObj, 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<ICFBamTimeColObj, String>, TableCell<ICFBamTimeColObj, String>>() { @Override public TableCell<ICFBamTimeColObj, String> call(TableColumn<ICFBamTimeColObj, String> arg) { return new CFStringTableCell<ICFBamTimeColObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamTimeColObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimeColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimeColObj, 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<ICFBamTimeColObj, Boolean>, TableCell<ICFBamTimeColObj, Boolean>>() { @Override public TableCell<ICFBamTimeColObj, Boolean> call(TableColumn<ICFBamTimeColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTimeColObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamTimeColObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimeColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimeColObj, 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<ICFBamTimeColObj, Boolean>, TableCell<ICFBamTimeColObj, Boolean>>() { @Override public TableCell<ICFBamTimeColObj, Boolean> call(TableColumn<ICFBamTimeColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTimeColObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamTimeColObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimeColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimeColObj, 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<ICFBamTimeColObj, Boolean>, TableCell<ICFBamTimeColObj, Boolean>>() { @Override public TableCell<ICFBamTimeColObj, Boolean> call(TableColumn<ICFBamTimeColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTimeColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamTimeColObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimeColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimeColObj, 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<ICFBamTimeColObj, String>, TableCell<ICFBamTimeColObj, String>>() { @Override public TableCell<ICFBamTimeColObj, String> call(TableColumn<ICFBamTimeColObj, String> arg) { return new CFStringTableCell<ICFBamTimeColObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamTimeColObj, Calendar>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimeColObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimeColObj, Calendar> p) { ICFBamTimeDefObj 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<ICFBamTimeColObj, Calendar>, TableCell<ICFBamTimeColObj, Calendar>>() { @Override public TableCell<ICFBamTimeColObj, Calendar> call(TableColumn<ICFBamTimeColObj, Calendar> arg) { return new CFTimeTableCell<ICFBamTimeColObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamTimeColObj, Calendar>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimeColObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimeColObj, Calendar> p) { ICFBamTimeDefObj 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<ICFBamTimeColObj, Calendar>, TableCell<ICFBamTimeColObj, Calendar>>() { @Override public TableCell<ICFBamTimeColObj, Calendar> call(TableColumn<ICFBamTimeColObj, Calendar> arg) { return new CFTimeTableCell<ICFBamTimeColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnNullValue = new TableColumn<ICFBamTimeColObj, Calendar>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimeColObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimeColObj, Calendar> p) { ICFBamTimeDefObj 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<ICFBamTimeColObj, Calendar>, TableCell<ICFBamTimeColObj, Calendar>>() { @Override public TableCell<ICFBamTimeColObj, Calendar> call(TableColumn<ICFBamTimeColObj, Calendar> arg) { return new CFTimeTableCell<ICFBamTimeColObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamTimeColObj, Calendar>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimeColObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimeColObj, Calendar> p) { ICFBamTimeDefObj 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<ICFBamTimeColObj, Calendar>, TableCell<ICFBamTimeColObj, Calendar>>() { @Override public TableCell<ICFBamTimeColObj, Calendar> call(TableColumn<ICFBamTimeColObj, Calendar> arg) { return new CFTimeTableCell<ICFBamTimeColObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamTimeColObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimeColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamTimeColObj, ICFBamSchemaDefObj> p) { ICFBamTimeColObj 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<ICFBamTimeColObj, ICFBamSchemaDefObj>, TableCell<ICFBamTimeColObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamTimeColObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamTimeColObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamTimeColObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamTimeColObj>() { @Override public void changed(ObservableValue<? extends ICFBamTimeColObj> observable, ICFBamTimeColObj oldValue, ICFBamTimeColObj newValue) { setJavaFXFocus(newValue); if (buttonChooseSelected != null) { if (newValue != null) { buttonChooseSelected.setDisable(false); } else { buttonChooseSelected.setDisable(true); } } } }); hboxMenu = new CFHBox(10); buttonCancel = new CFButton(); buttonCancel.setMinWidth(200); buttonCancel.setText("Cancel"); buttonCancel.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { cfFormManager.closeCurrentForm(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonCancel); buttonChooseNone = new CFButton(); buttonChooseNone.setMinWidth(200); buttonChooseNone.setText("ChooseNone"); buttonChooseNone.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); if (schemaObj == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "schemaObj"); } invokeWhenChosen.choseTimeCol(null); cfFormManager.closeCurrentForm(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonChooseNone); buttonChooseSelected = new CFButton(); buttonChooseSelected.setMinWidth(200); buttonChooseSelected.setText("ChooseSelected"); buttonChooseSelected.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); if (schemaObj == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "schemaObj"); } ICFBamTimeColObj selectedInstance = getJavaFXFocusAsTimeCol(); invokeWhenChosen.choseTimeCol(selectedInstance); cfFormManager.closeCurrentForm(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonChooseSelected); if (argFocus != null) { dataTable.getSelectionModel().select(argFocus); } setTop(hboxMenu); setCenter(dataTable); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXTimeTypePickerPane.java
public CFBamJavaFXTimeTypePickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamTimeTypeObj argFocus, ICFBamSchemaDefObj argContainer, Collection<ICFBamTimeTypeObj> argDataCollection, ICFBamJavaFXTimeTypeChosen whenChosen) { super();//from w ww .j a v a 2 s.c o m final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } if (whenChosen == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6, "whenChosen"); } invokeWhenChosen = whenChosen; // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamTimeTypeObj>(); tableColumnId = new TableColumn<ICFBamTimeTypeObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimeTypeObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamTimeTypeObj, 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<ICFBamTimeTypeObj, Long>, TableCell<ICFBamTimeTypeObj, Long>>() { @Override public TableCell<ICFBamTimeTypeObj, Long> call(TableColumn<ICFBamTimeTypeObj, Long> arg) { return new CFInt64TableCell<ICFBamTimeTypeObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamTimeTypeObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimeTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimeTypeObj, 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<ICFBamTimeTypeObj, String>, TableCell<ICFBamTimeTypeObj, String>>() { @Override public TableCell<ICFBamTimeTypeObj, String> call(TableColumn<ICFBamTimeTypeObj, String> arg) { return new CFStringTableCell<ICFBamTimeTypeObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamTimeTypeObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimeTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimeTypeObj, 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<ICFBamTimeTypeObj, String>, TableCell<ICFBamTimeTypeObj, String>>() { @Override public TableCell<ICFBamTimeTypeObj, String> call(TableColumn<ICFBamTimeTypeObj, String> arg) { return new CFStringTableCell<ICFBamTimeTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamTimeTypeObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimeTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimeTypeObj, 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<ICFBamTimeTypeObj, String>, TableCell<ICFBamTimeTypeObj, String>>() { @Override public TableCell<ICFBamTimeTypeObj, String> call(TableColumn<ICFBamTimeTypeObj, String> arg) { return new CFStringTableCell<ICFBamTimeTypeObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamTimeTypeObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimeTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimeTypeObj, 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<ICFBamTimeTypeObj, String>, TableCell<ICFBamTimeTypeObj, String>>() { @Override public TableCell<ICFBamTimeTypeObj, String> call(TableColumn<ICFBamTimeTypeObj, String> arg) { return new CFStringTableCell<ICFBamTimeTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamTimeTypeObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimeTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimeTypeObj, 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<ICFBamTimeTypeObj, String>, TableCell<ICFBamTimeTypeObj, String>>() { @Override public TableCell<ICFBamTimeTypeObj, String> call(TableColumn<ICFBamTimeTypeObj, String> arg) { return new CFStringTableCell<ICFBamTimeTypeObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamTimeTypeObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimeTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimeTypeObj, 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<ICFBamTimeTypeObj, Boolean>, TableCell<ICFBamTimeTypeObj, Boolean>>() { @Override public TableCell<ICFBamTimeTypeObj, Boolean> call(TableColumn<ICFBamTimeTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTimeTypeObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamTimeTypeObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimeTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimeTypeObj, 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<ICFBamTimeTypeObj, Boolean>, TableCell<ICFBamTimeTypeObj, Boolean>>() { @Override public TableCell<ICFBamTimeTypeObj, Boolean> call(TableColumn<ICFBamTimeTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTimeTypeObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamTimeTypeObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimeTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimeTypeObj, 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<ICFBamTimeTypeObj, Boolean>, TableCell<ICFBamTimeTypeObj, Boolean>>() { @Override public TableCell<ICFBamTimeTypeObj, Boolean> call(TableColumn<ICFBamTimeTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTimeTypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamTimeTypeObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimeTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimeTypeObj, 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<ICFBamTimeTypeObj, String>, TableCell<ICFBamTimeTypeObj, String>>() { @Override public TableCell<ICFBamTimeTypeObj, String> call(TableColumn<ICFBamTimeTypeObj, String> arg) { return new CFStringTableCell<ICFBamTimeTypeObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamTimeTypeObj, Calendar>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimeTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimeTypeObj, Calendar> p) { ICFBamTimeDefObj 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<ICFBamTimeTypeObj, Calendar>, TableCell<ICFBamTimeTypeObj, Calendar>>() { @Override public TableCell<ICFBamTimeTypeObj, Calendar> call( TableColumn<ICFBamTimeTypeObj, Calendar> arg) { return new CFTimeTableCell<ICFBamTimeTypeObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamTimeTypeObj, Calendar>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimeTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimeTypeObj, Calendar> p) { ICFBamTimeDefObj 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<ICFBamTimeTypeObj, Calendar>, TableCell<ICFBamTimeTypeObj, Calendar>>() { @Override public TableCell<ICFBamTimeTypeObj, Calendar> call( TableColumn<ICFBamTimeTypeObj, Calendar> arg) { return new CFTimeTableCell<ICFBamTimeTypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnNullValue = new TableColumn<ICFBamTimeTypeObj, Calendar>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimeTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimeTypeObj, Calendar> p) { ICFBamTimeDefObj 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<ICFBamTimeTypeObj, Calendar>, TableCell<ICFBamTimeTypeObj, Calendar>>() { @Override public TableCell<ICFBamTimeTypeObj, Calendar> call( TableColumn<ICFBamTimeTypeObj, Calendar> arg) { return new CFTimeTableCell<ICFBamTimeTypeObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamTimeTypeObj, Calendar>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimeTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimeTypeObj, Calendar> p) { ICFBamTimeDefObj 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<ICFBamTimeTypeObj, Calendar>, TableCell<ICFBamTimeTypeObj, Calendar>>() { @Override public TableCell<ICFBamTimeTypeObj, Calendar> call( TableColumn<ICFBamTimeTypeObj, Calendar> arg) { return new CFTimeTableCell<ICFBamTimeTypeObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamTimeTypeObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimeTypeObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamTimeTypeObj, ICFBamSchemaDefObj> p) { ICFBamTimeTypeObj 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<ICFBamTimeTypeObj, ICFBamSchemaDefObj>, TableCell<ICFBamTimeTypeObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamTimeTypeObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamTimeTypeObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamTimeTypeObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamTimeTypeObj>() { @Override public void changed(ObservableValue<? extends ICFBamTimeTypeObj> observable, ICFBamTimeTypeObj oldValue, ICFBamTimeTypeObj newValue) { setJavaFXFocus(newValue); if (buttonChooseSelected != null) { if (newValue != null) { buttonChooseSelected.setDisable(false); } else { buttonChooseSelected.setDisable(true); } } } }); hboxMenu = new CFHBox(10); buttonCancel = new CFButton(); buttonCancel.setMinWidth(200); buttonCancel.setText("Cancel"); buttonCancel.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { cfFormManager.closeCurrentForm(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonCancel); buttonChooseNone = new CFButton(); buttonChooseNone.setMinWidth(200); buttonChooseNone.setText("ChooseNone"); buttonChooseNone.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); if (schemaObj == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "schemaObj"); } invokeWhenChosen.choseTimeType(null); cfFormManager.closeCurrentForm(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonChooseNone); buttonChooseSelected = new CFButton(); buttonChooseSelected.setMinWidth(200); buttonChooseSelected.setText("ChooseSelected"); buttonChooseSelected.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); if (schemaObj == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "schemaObj"); } ICFBamTimeTypeObj selectedInstance = getJavaFXFocusAsTimeType(); invokeWhenChosen.choseTimeType(selectedInstance); cfFormManager.closeCurrentForm(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonChooseSelected); if (argFocus != null) { dataTable.getSelectionModel().select(argFocus); } setTop(hboxMenu); setCenter(dataTable); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXPopTopDepListPane.java
public CFBamJavaFXPopTopDepListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamRelationObj argContainer, ICFBamPopTopDepObj argFocus, Collection<ICFBamPopTopDepObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();/* ww w .java2 s .c om*/ final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamPopTopDepObj>(); tableColumnId = new TableColumn<ICFBamPopTopDepObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamPopTopDepObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamPopTopDepObj, 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<ICFBamPopTopDepObj, Long>, TableCell<ICFBamPopTopDepObj, Long>>() { @Override public TableCell<ICFBamPopTopDepObj, Long> call(TableColumn<ICFBamPopTopDepObj, Long> arg) { return new CFInt64TableCell<ICFBamPopTopDepObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamPopTopDepObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamPopTopDepObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamPopTopDepObj, String> p) { ICFBamPopTopDepObj 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<ICFBamPopTopDepObj, String>, TableCell<ICFBamPopTopDepObj, String>>() { @Override public TableCell<ICFBamPopTopDepObj, String> call(TableColumn<ICFBamPopTopDepObj, String> arg) { return new CFStringTableCell<ICFBamPopTopDepObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnLookupRelation = new TableColumn<ICFBamPopTopDepObj, ICFBamRelationObj>("Relation"); tableColumnLookupRelation.setCellValueFactory( new Callback<CellDataFeatures<ICFBamPopTopDepObj, ICFBamRelationObj>, ObservableValue<ICFBamRelationObj>>() { public ObservableValue<ICFBamRelationObj> call( CellDataFeatures<ICFBamPopTopDepObj, ICFBamRelationObj> p) { ICFBamPopTopDepObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamRelationObj ref = obj.getRequiredLookupRelation(); ReadOnlyObjectWrapper<ICFBamRelationObj> observable = new ReadOnlyObjectWrapper<ICFBamRelationObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupRelation.setCellFactory( new Callback<TableColumn<ICFBamPopTopDepObj, ICFBamRelationObj>, TableCell<ICFBamPopTopDepObj, ICFBamRelationObj>>() { @Override public TableCell<ICFBamPopTopDepObj, ICFBamRelationObj> call( TableColumn<ICFBamPopTopDepObj, ICFBamRelationObj> arg) { return new CFReferenceTableCell<ICFBamPopTopDepObj, ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnLookupRelation); tableColumnLookupDefSchema = new TableColumn<ICFBamPopTopDepObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamPopTopDepObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamPopTopDepObj, ICFBamSchemaDefObj> p) { ICFBamPopTopDepObj 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<ICFBamPopTopDepObj, ICFBamSchemaDefObj>, TableCell<ICFBamPopTopDepObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamPopTopDepObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamPopTopDepObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamPopTopDepObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamPopTopDepObj>() { @Override public void changed(ObservableValue<? extends ICFBamPopTopDepObj> observable, ICFBamPopTopDepObj oldValue, ICFBamPopTopDepObj 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 (observableListOfPopTopDep != null) { dataTable.setItems(observableListOfPopTopDep); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXTZTimeColPickerPane.java
public CFBamJavaFXTZTimeColPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamTZTimeColObj argFocus, ICFBamTableObj argContainer, Collection<ICFBamTZTimeColObj> argDataCollection, ICFBamJavaFXTZTimeColChosen whenChosen) { super();//from w w w. j a va2s. 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"); } if (whenChosen == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6, "whenChosen"); } invokeWhenChosen = whenChosen; // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamTZTimeColObj>(); tableColumnId = new TableColumn<ICFBamTZTimeColObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamTZTimeColObj, 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<ICFBamTZTimeColObj, Long>, TableCell<ICFBamTZTimeColObj, Long>>() { @Override public TableCell<ICFBamTZTimeColObj, Long> call(TableColumn<ICFBamTZTimeColObj, Long> arg) { return new CFInt64TableCell<ICFBamTZTimeColObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamTZTimeColObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeColObj, 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<ICFBamTZTimeColObj, String>, TableCell<ICFBamTZTimeColObj, String>>() { @Override public TableCell<ICFBamTZTimeColObj, String> call(TableColumn<ICFBamTZTimeColObj, String> arg) { return new CFStringTableCell<ICFBamTZTimeColObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamTZTimeColObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeColObj, 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<ICFBamTZTimeColObj, String>, TableCell<ICFBamTZTimeColObj, String>>() { @Override public TableCell<ICFBamTZTimeColObj, String> call(TableColumn<ICFBamTZTimeColObj, String> arg) { return new CFStringTableCell<ICFBamTZTimeColObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamTZTimeColObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeColObj, 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<ICFBamTZTimeColObj, String>, TableCell<ICFBamTZTimeColObj, String>>() { @Override public TableCell<ICFBamTZTimeColObj, String> call(TableColumn<ICFBamTZTimeColObj, String> arg) { return new CFStringTableCell<ICFBamTZTimeColObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamTZTimeColObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeColObj, 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<ICFBamTZTimeColObj, String>, TableCell<ICFBamTZTimeColObj, String>>() { @Override public TableCell<ICFBamTZTimeColObj, String> call(TableColumn<ICFBamTZTimeColObj, String> arg) { return new CFStringTableCell<ICFBamTZTimeColObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamTZTimeColObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeColObj, 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<ICFBamTZTimeColObj, String>, TableCell<ICFBamTZTimeColObj, String>>() { @Override public TableCell<ICFBamTZTimeColObj, String> call(TableColumn<ICFBamTZTimeColObj, String> arg) { return new CFStringTableCell<ICFBamTZTimeColObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamTZTimeColObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimeColObj, 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<ICFBamTZTimeColObj, Boolean>, TableCell<ICFBamTZTimeColObj, Boolean>>() { @Override public TableCell<ICFBamTZTimeColObj, Boolean> call( TableColumn<ICFBamTZTimeColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZTimeColObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamTZTimeColObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimeColObj, 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<ICFBamTZTimeColObj, Boolean>, TableCell<ICFBamTZTimeColObj, Boolean>>() { @Override public TableCell<ICFBamTZTimeColObj, Boolean> call( TableColumn<ICFBamTZTimeColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZTimeColObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamTZTimeColObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimeColObj, 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<ICFBamTZTimeColObj, Boolean>, TableCell<ICFBamTZTimeColObj, Boolean>>() { @Override public TableCell<ICFBamTZTimeColObj, Boolean> call( TableColumn<ICFBamTZTimeColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZTimeColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamTZTimeColObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeColObj, 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<ICFBamTZTimeColObj, String>, TableCell<ICFBamTZTimeColObj, String>>() { @Override public TableCell<ICFBamTZTimeColObj, String> call(TableColumn<ICFBamTZTimeColObj, String> arg) { return new CFStringTableCell<ICFBamTZTimeColObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamTZTimeColObj, Calendar>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeColObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimeColObj, 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<ICFBamTZTimeColObj, Calendar>, TableCell<ICFBamTZTimeColObj, Calendar>>() { @Override public TableCell<ICFBamTZTimeColObj, Calendar> call( TableColumn<ICFBamTZTimeColObj, Calendar> arg) { return new CFTZTimeTableCell<ICFBamTZTimeColObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamTZTimeColObj, Calendar>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeColObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimeColObj, 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<ICFBamTZTimeColObj, Calendar>, TableCell<ICFBamTZTimeColObj, Calendar>>() { @Override public TableCell<ICFBamTZTimeColObj, Calendar> call( TableColumn<ICFBamTZTimeColObj, Calendar> arg) { return new CFTZTimeTableCell<ICFBamTZTimeColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnNullValue = new TableColumn<ICFBamTZTimeColObj, Calendar>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeColObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimeColObj, 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<ICFBamTZTimeColObj, Calendar>, TableCell<ICFBamTZTimeColObj, Calendar>>() { @Override public TableCell<ICFBamTZTimeColObj, Calendar> call( TableColumn<ICFBamTZTimeColObj, Calendar> arg) { return new CFTZTimeTableCell<ICFBamTZTimeColObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamTZTimeColObj, Calendar>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeColObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimeColObj, 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<ICFBamTZTimeColObj, Calendar>, TableCell<ICFBamTZTimeColObj, Calendar>>() { @Override public TableCell<ICFBamTZTimeColObj, Calendar> call( TableColumn<ICFBamTZTimeColObj, Calendar> arg) { return new CFTZTimeTableCell<ICFBamTZTimeColObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamTZTimeColObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamTZTimeColObj, ICFBamSchemaDefObj> p) { ICFBamTZTimeColObj 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<ICFBamTZTimeColObj, ICFBamSchemaDefObj>, TableCell<ICFBamTZTimeColObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamTZTimeColObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamTZTimeColObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamTZTimeColObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamTZTimeColObj>() { @Override public void changed(ObservableValue<? extends ICFBamTZTimeColObj> observable, ICFBamTZTimeColObj oldValue, ICFBamTZTimeColObj newValue) { setJavaFXFocus(newValue); if (buttonChooseSelected != null) { if (newValue != null) { buttonChooseSelected.setDisable(false); } else { buttonChooseSelected.setDisable(true); } } } }); hboxMenu = new CFHBox(10); buttonCancel = new CFButton(); buttonCancel.setMinWidth(200); buttonCancel.setText("Cancel"); buttonCancel.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { cfFormManager.closeCurrentForm(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonCancel); buttonChooseNone = new CFButton(); buttonChooseNone.setMinWidth(200); buttonChooseNone.setText("ChooseNone"); buttonChooseNone.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); if (schemaObj == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "schemaObj"); } invokeWhenChosen.choseTZTimeCol(null); cfFormManager.closeCurrentForm(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonChooseNone); buttonChooseSelected = new CFButton(); buttonChooseSelected.setMinWidth(200); buttonChooseSelected.setText("ChooseSelected"); buttonChooseSelected.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); if (schemaObj == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "schemaObj"); } ICFBamTZTimeColObj selectedInstance = getJavaFXFocusAsTZTimeCol(); invokeWhenChosen.choseTZTimeCol(selectedInstance); cfFormManager.closeCurrentForm(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonChooseSelected); if (argFocus != null) { dataTable.getSelectionModel().select(argFocus); } setTop(hboxMenu); setCenter(dataTable); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXDelSubDep1ListPane.java
public CFBamJavaFXDelSubDep1ListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamDelTopDepObj argContainer, ICFBamDelSubDep1Obj argFocus, Collection<ICFBamDelSubDep1Obj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();//from www . j a va 2 s . c om final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamDelSubDep1Obj>(); tableColumnId = new TableColumn<ICFBamDelSubDep1Obj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDelSubDep1Obj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamDelSubDep1Obj, 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<ICFBamDelSubDep1Obj, Long>, TableCell<ICFBamDelSubDep1Obj, Long>>() { @Override public TableCell<ICFBamDelSubDep1Obj, Long> call(TableColumn<ICFBamDelSubDep1Obj, Long> arg) { return new CFInt64TableCell<ICFBamDelSubDep1Obj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamDelSubDep1Obj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDelSubDep1Obj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamDelSubDep1Obj, String> p) { ICFBamDelSubDep1Obj 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<ICFBamDelSubDep1Obj, String>, TableCell<ICFBamDelSubDep1Obj, String>>() { @Override public TableCell<ICFBamDelSubDep1Obj, String> call( TableColumn<ICFBamDelSubDep1Obj, String> arg) { return new CFStringTableCell<ICFBamDelSubDep1Obj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnLookupRelation = new TableColumn<ICFBamDelSubDep1Obj, ICFBamRelationObj>("Relation"); tableColumnLookupRelation.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDelSubDep1Obj, ICFBamRelationObj>, ObservableValue<ICFBamRelationObj>>() { public ObservableValue<ICFBamRelationObj> call( CellDataFeatures<ICFBamDelSubDep1Obj, ICFBamRelationObj> p) { ICFBamDelSubDep1Obj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamRelationObj ref = obj.getRequiredLookupRelation(); ReadOnlyObjectWrapper<ICFBamRelationObj> observable = new ReadOnlyObjectWrapper<ICFBamRelationObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupRelation.setCellFactory( new Callback<TableColumn<ICFBamDelSubDep1Obj, ICFBamRelationObj>, TableCell<ICFBamDelSubDep1Obj, ICFBamRelationObj>>() { @Override public TableCell<ICFBamDelSubDep1Obj, ICFBamRelationObj> call( TableColumn<ICFBamDelSubDep1Obj, ICFBamRelationObj> arg) { return new CFReferenceTableCell<ICFBamDelSubDep1Obj, ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnLookupRelation); tableColumnLookupDefSchema = new TableColumn<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj> p) { ICFBamDelSubDep1Obj 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<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj>, TableCell<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj> call( TableColumn<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamDelSubDep1Obj>() { @Override public void changed(ObservableValue<? extends ICFBamDelSubDep1Obj> observable, ICFBamDelSubDep1Obj oldValue, ICFBamDelSubDep1Obj 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 (observableListOfDelSubDep1 != null) { dataTable.setItems(observableListOfDelSubDep1); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXPopSubDep1ListPane.java
public CFBamJavaFXPopSubDep1ListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamPopTopDepObj argContainer, ICFBamPopSubDep1Obj argFocus, Collection<ICFBamPopSubDep1Obj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();/* w ww . j av a 2 s.c o m*/ final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamPopSubDep1Obj>(); tableColumnId = new TableColumn<ICFBamPopSubDep1Obj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamPopSubDep1Obj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamPopSubDep1Obj, 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<ICFBamPopSubDep1Obj, Long>, TableCell<ICFBamPopSubDep1Obj, Long>>() { @Override public TableCell<ICFBamPopSubDep1Obj, Long> call(TableColumn<ICFBamPopSubDep1Obj, Long> arg) { return new CFInt64TableCell<ICFBamPopSubDep1Obj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamPopSubDep1Obj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamPopSubDep1Obj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamPopSubDep1Obj, String> p) { ICFBamPopSubDep1Obj 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<ICFBamPopSubDep1Obj, String>, TableCell<ICFBamPopSubDep1Obj, String>>() { @Override public TableCell<ICFBamPopSubDep1Obj, String> call( TableColumn<ICFBamPopSubDep1Obj, String> arg) { return new CFStringTableCell<ICFBamPopSubDep1Obj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnLookupRelation = new TableColumn<ICFBamPopSubDep1Obj, ICFBamRelationObj>("Relation"); tableColumnLookupRelation.setCellValueFactory( new Callback<CellDataFeatures<ICFBamPopSubDep1Obj, ICFBamRelationObj>, ObservableValue<ICFBamRelationObj>>() { public ObservableValue<ICFBamRelationObj> call( CellDataFeatures<ICFBamPopSubDep1Obj, ICFBamRelationObj> p) { ICFBamPopSubDep1Obj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamRelationObj ref = obj.getRequiredLookupRelation(); ReadOnlyObjectWrapper<ICFBamRelationObj> observable = new ReadOnlyObjectWrapper<ICFBamRelationObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupRelation.setCellFactory( new Callback<TableColumn<ICFBamPopSubDep1Obj, ICFBamRelationObj>, TableCell<ICFBamPopSubDep1Obj, ICFBamRelationObj>>() { @Override public TableCell<ICFBamPopSubDep1Obj, ICFBamRelationObj> call( TableColumn<ICFBamPopSubDep1Obj, ICFBamRelationObj> arg) { return new CFReferenceTableCell<ICFBamPopSubDep1Obj, ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnLookupRelation); tableColumnLookupDefSchema = new TableColumn<ICFBamPopSubDep1Obj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamPopSubDep1Obj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamPopSubDep1Obj, ICFBamSchemaDefObj> p) { ICFBamPopSubDep1Obj 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<ICFBamPopSubDep1Obj, ICFBamSchemaDefObj>, TableCell<ICFBamPopSubDep1Obj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamPopSubDep1Obj, ICFBamSchemaDefObj> call( TableColumn<ICFBamPopSubDep1Obj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamPopSubDep1Obj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamPopSubDep1Obj>() { @Override public void changed(ObservableValue<? extends ICFBamPopSubDep1Obj> observable, ICFBamPopSubDep1Obj oldValue, ICFBamPopSubDep1Obj 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 (observableListOfPopSubDep1 != null) { dataTable.setItems(observableListOfPopSubDep1); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXDelSubDep2ListPane.java
public CFBamJavaFXDelSubDep2ListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamDelSubDep1Obj argContainer, ICFBamDelSubDep2Obj argFocus, Collection<ICFBamDelSubDep2Obj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();/*from w w w . j a v a 2s. co m*/ final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamDelSubDep2Obj>(); tableColumnId = new TableColumn<ICFBamDelSubDep2Obj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDelSubDep2Obj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamDelSubDep2Obj, 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<ICFBamDelSubDep2Obj, Long>, TableCell<ICFBamDelSubDep2Obj, Long>>() { @Override public TableCell<ICFBamDelSubDep2Obj, Long> call(TableColumn<ICFBamDelSubDep2Obj, Long> arg) { return new CFInt64TableCell<ICFBamDelSubDep2Obj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamDelSubDep2Obj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDelSubDep2Obj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamDelSubDep2Obj, String> p) { ICFBamDelSubDep2Obj 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<ICFBamDelSubDep2Obj, String>, TableCell<ICFBamDelSubDep2Obj, String>>() { @Override public TableCell<ICFBamDelSubDep2Obj, String> call( TableColumn<ICFBamDelSubDep2Obj, String> arg) { return new CFStringTableCell<ICFBamDelSubDep2Obj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnLookupRelation = new TableColumn<ICFBamDelSubDep2Obj, ICFBamRelationObj>("Relation"); tableColumnLookupRelation.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDelSubDep2Obj, ICFBamRelationObj>, ObservableValue<ICFBamRelationObj>>() { public ObservableValue<ICFBamRelationObj> call( CellDataFeatures<ICFBamDelSubDep2Obj, ICFBamRelationObj> p) { ICFBamDelSubDep2Obj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamRelationObj ref = obj.getRequiredLookupRelation(); ReadOnlyObjectWrapper<ICFBamRelationObj> observable = new ReadOnlyObjectWrapper<ICFBamRelationObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupRelation.setCellFactory( new Callback<TableColumn<ICFBamDelSubDep2Obj, ICFBamRelationObj>, TableCell<ICFBamDelSubDep2Obj, ICFBamRelationObj>>() { @Override public TableCell<ICFBamDelSubDep2Obj, ICFBamRelationObj> call( TableColumn<ICFBamDelSubDep2Obj, ICFBamRelationObj> arg) { return new CFReferenceTableCell<ICFBamDelSubDep2Obj, ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnLookupRelation); tableColumnLookupDefSchema = new TableColumn<ICFBamDelSubDep2Obj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDelSubDep2Obj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamDelSubDep2Obj, ICFBamSchemaDefObj> p) { ICFBamDelSubDep2Obj 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<ICFBamDelSubDep2Obj, ICFBamSchemaDefObj>, TableCell<ICFBamDelSubDep2Obj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamDelSubDep2Obj, ICFBamSchemaDefObj> call( TableColumn<ICFBamDelSubDep2Obj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamDelSubDep2Obj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamDelSubDep2Obj>() { @Override public void changed(ObservableValue<? extends ICFBamDelSubDep2Obj> observable, ICFBamDelSubDep2Obj oldValue, ICFBamDelSubDep2Obj 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 (observableListOfDelSubDep2 != null) { dataTable.setItems(observableListOfDelSubDep2); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXDelSubDep3ListPane.java
public CFBamJavaFXDelSubDep3ListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamDelSubDep2Obj argContainer, ICFBamDelSubDep3Obj argFocus, Collection<ICFBamDelSubDep3Obj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();/*from w w w. ja va 2 s .c om*/ final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamDelSubDep3Obj>(); tableColumnId = new TableColumn<ICFBamDelSubDep3Obj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDelSubDep3Obj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamDelSubDep3Obj, 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<ICFBamDelSubDep3Obj, Long>, TableCell<ICFBamDelSubDep3Obj, Long>>() { @Override public TableCell<ICFBamDelSubDep3Obj, Long> call(TableColumn<ICFBamDelSubDep3Obj, Long> arg) { return new CFInt64TableCell<ICFBamDelSubDep3Obj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamDelSubDep3Obj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDelSubDep3Obj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamDelSubDep3Obj, String> p) { ICFBamDelSubDep3Obj 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<ICFBamDelSubDep3Obj, String>, TableCell<ICFBamDelSubDep3Obj, String>>() { @Override public TableCell<ICFBamDelSubDep3Obj, String> call( TableColumn<ICFBamDelSubDep3Obj, String> arg) { return new CFStringTableCell<ICFBamDelSubDep3Obj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnLookupRelation = new TableColumn<ICFBamDelSubDep3Obj, ICFBamRelationObj>("Relation"); tableColumnLookupRelation.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDelSubDep3Obj, ICFBamRelationObj>, ObservableValue<ICFBamRelationObj>>() { public ObservableValue<ICFBamRelationObj> call( CellDataFeatures<ICFBamDelSubDep3Obj, ICFBamRelationObj> p) { ICFBamDelSubDep3Obj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamRelationObj ref = obj.getRequiredLookupRelation(); ReadOnlyObjectWrapper<ICFBamRelationObj> observable = new ReadOnlyObjectWrapper<ICFBamRelationObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupRelation.setCellFactory( new Callback<TableColumn<ICFBamDelSubDep3Obj, ICFBamRelationObj>, TableCell<ICFBamDelSubDep3Obj, ICFBamRelationObj>>() { @Override public TableCell<ICFBamDelSubDep3Obj, ICFBamRelationObj> call( TableColumn<ICFBamDelSubDep3Obj, ICFBamRelationObj> arg) { return new CFReferenceTableCell<ICFBamDelSubDep3Obj, ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnLookupRelation); tableColumnLookupDefSchema = new TableColumn<ICFBamDelSubDep3Obj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDelSubDep3Obj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamDelSubDep3Obj, ICFBamSchemaDefObj> p) { ICFBamDelSubDep3Obj 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<ICFBamDelSubDep3Obj, ICFBamSchemaDefObj>, TableCell<ICFBamDelSubDep3Obj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamDelSubDep3Obj, ICFBamSchemaDefObj> call( TableColumn<ICFBamDelSubDep3Obj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamDelSubDep3Obj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamDelSubDep3Obj>() { @Override public void changed(ObservableValue<? extends ICFBamDelSubDep3Obj> observable, ICFBamDelSubDep3Obj oldValue, ICFBamDelSubDep3Obj 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 (observableListOfDelSubDep3 != null) { dataTable.setItems(observableListOfDelSubDep3); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXPopSubDep2ListPane.java
public CFBamJavaFXPopSubDep2ListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamPopSubDep1Obj argContainer, ICFBamPopSubDep2Obj argFocus, Collection<ICFBamPopSubDep2Obj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();/*from w ww . j a v a2 s . co m*/ final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamPopSubDep2Obj>(); tableColumnId = new TableColumn<ICFBamPopSubDep2Obj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamPopSubDep2Obj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamPopSubDep2Obj, 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<ICFBamPopSubDep2Obj, Long>, TableCell<ICFBamPopSubDep2Obj, Long>>() { @Override public TableCell<ICFBamPopSubDep2Obj, Long> call(TableColumn<ICFBamPopSubDep2Obj, Long> arg) { return new CFInt64TableCell<ICFBamPopSubDep2Obj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamPopSubDep2Obj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamPopSubDep2Obj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamPopSubDep2Obj, String> p) { ICFBamPopSubDep2Obj 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<ICFBamPopSubDep2Obj, String>, TableCell<ICFBamPopSubDep2Obj, String>>() { @Override public TableCell<ICFBamPopSubDep2Obj, String> call( TableColumn<ICFBamPopSubDep2Obj, String> arg) { return new CFStringTableCell<ICFBamPopSubDep2Obj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnLookupRelation = new TableColumn<ICFBamPopSubDep2Obj, ICFBamRelationObj>("Relation"); tableColumnLookupRelation.setCellValueFactory( new Callback<CellDataFeatures<ICFBamPopSubDep2Obj, ICFBamRelationObj>, ObservableValue<ICFBamRelationObj>>() { public ObservableValue<ICFBamRelationObj> call( CellDataFeatures<ICFBamPopSubDep2Obj, ICFBamRelationObj> p) { ICFBamPopSubDep2Obj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamRelationObj ref = obj.getRequiredLookupRelation(); ReadOnlyObjectWrapper<ICFBamRelationObj> observable = new ReadOnlyObjectWrapper<ICFBamRelationObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupRelation.setCellFactory( new Callback<TableColumn<ICFBamPopSubDep2Obj, ICFBamRelationObj>, TableCell<ICFBamPopSubDep2Obj, ICFBamRelationObj>>() { @Override public TableCell<ICFBamPopSubDep2Obj, ICFBamRelationObj> call( TableColumn<ICFBamPopSubDep2Obj, ICFBamRelationObj> arg) { return new CFReferenceTableCell<ICFBamPopSubDep2Obj, ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnLookupRelation); tableColumnLookupDefSchema = new TableColumn<ICFBamPopSubDep2Obj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamPopSubDep2Obj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamPopSubDep2Obj, ICFBamSchemaDefObj> p) { ICFBamPopSubDep2Obj 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<ICFBamPopSubDep2Obj, ICFBamSchemaDefObj>, TableCell<ICFBamPopSubDep2Obj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamPopSubDep2Obj, ICFBamSchemaDefObj> call( TableColumn<ICFBamPopSubDep2Obj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamPopSubDep2Obj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamPopSubDep2Obj>() { @Override public void changed(ObservableValue<? extends ICFBamPopSubDep2Obj> observable, ICFBamPopSubDep2Obj oldValue, ICFBamPopSubDep2Obj 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 (observableListOfPopSubDep2 != null) { dataTable.setItems(observableListOfPopSubDep2); } adjustListButtons(); }