List of usage examples for javafx.scene.control TableView TableView
public TableView()
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXTimestampTypePickerPane.java
public CFBamJavaFXTimestampTypePickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamTimestampTypeObj argFocus, ICFBamSchemaDefObj argContainer, Collection<ICFBamTimestampTypeObj> argDataCollection, ICFBamJavaFXTimestampTypeChosen whenChosen) { super();//from ww w . java 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<ICFBamTimestampTypeObj>(); tableColumnId = new TableColumn<ICFBamTimestampTypeObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamTimestampTypeObj, Long> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { long value = obj.getRequiredId(); Long wrapped = new Long(value); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(wrapped); return (observable); } } }); tableColumnId.setCellFactory( new Callback<TableColumn<ICFBamTimestampTypeObj, Long>, TableCell<ICFBamTimestampTypeObj, Long>>() { @Override public TableCell<ICFBamTimestampTypeObj, Long> call( TableColumn<ICFBamTimestampTypeObj, Long> arg) { return new CFInt64TableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamTimestampTypeObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampTypeObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getRequiredName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnName.setCellFactory( new Callback<TableColumn<ICFBamTimestampTypeObj, String>, TableCell<ICFBamTimestampTypeObj, String>>() { @Override public TableCell<ICFBamTimestampTypeObj, String> call( TableColumn<ICFBamTimestampTypeObj, String> arg) { return new CFStringTableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamTimestampTypeObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampTypeObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortName.setCellFactory( new Callback<TableColumn<ICFBamTimestampTypeObj, String>, TableCell<ICFBamTimestampTypeObj, String>>() { @Override public TableCell<ICFBamTimestampTypeObj, String> call( TableColumn<ICFBamTimestampTypeObj, String> arg) { return new CFStringTableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamTimestampTypeObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampTypeObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalLabel(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnLabel.setCellFactory( new Callback<TableColumn<ICFBamTimestampTypeObj, String>, TableCell<ICFBamTimestampTypeObj, String>>() { @Override public TableCell<ICFBamTimestampTypeObj, String> call( TableColumn<ICFBamTimestampTypeObj, String> arg) { return new CFStringTableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamTimestampTypeObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampTypeObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortDescription.setCellFactory( new Callback<TableColumn<ICFBamTimestampTypeObj, String>, TableCell<ICFBamTimestampTypeObj, String>>() { @Override public TableCell<ICFBamTimestampTypeObj, String> call( TableColumn<ICFBamTimestampTypeObj, String> arg) { return new CFStringTableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamTimestampTypeObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampTypeObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDescription.setCellFactory( new Callback<TableColumn<ICFBamTimestampTypeObj, String>, TableCell<ICFBamTimestampTypeObj, String>>() { @Override public TableCell<ICFBamTimestampTypeObj, String> call( TableColumn<ICFBamTimestampTypeObj, String> arg) { return new CFStringTableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamTimestampTypeObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimestampTypeObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredIsNullable(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnIsNullable.setCellFactory( new Callback<TableColumn<ICFBamTimestampTypeObj, Boolean>, TableCell<ICFBamTimestampTypeObj, Boolean>>() { @Override public TableCell<ICFBamTimestampTypeObj, Boolean> call( TableColumn<ICFBamTimestampTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamTimestampTypeObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimestampTypeObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { Boolean value = obj.getOptionalGenerateId(); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(value); return (observable); } } }); tableColumnGenerateId.setCellFactory( new Callback<TableColumn<ICFBamTimestampTypeObj, Boolean>, TableCell<ICFBamTimestampTypeObj, Boolean>>() { @Override public TableCell<ICFBamTimestampTypeObj, Boolean> call( TableColumn<ICFBamTimestampTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamTimestampTypeObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimestampTypeObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredDefaultVisibility(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnDefaultVisibility.setCellFactory( new Callback<TableColumn<ICFBamTimestampTypeObj, Boolean>, TableCell<ICFBamTimestampTypeObj, Boolean>>() { @Override public TableCell<ICFBamTimestampTypeObj, Boolean> call( TableColumn<ICFBamTimestampTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamTimestampTypeObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampTypeObj, String> p) { ICFBamAtomObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDbName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDbName.setCellFactory( new Callback<TableColumn<ICFBamTimestampTypeObj, String>, TableCell<ICFBamTimestampTypeObj, String>>() { @Override public TableCell<ICFBamTimestampTypeObj, String> call( TableColumn<ICFBamTimestampTypeObj, String> arg) { return new CFStringTableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamTimestampTypeObj, Calendar>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampTypeObj, Calendar> p) { ICFBamTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamTimestampTypeObj, Calendar>, TableCell<ICFBamTimestampTypeObj, Calendar>>() { @Override public TableCell<ICFBamTimestampTypeObj, Calendar> call( TableColumn<ICFBamTimestampTypeObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamTimestampTypeObj, Calendar>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampTypeObj, Calendar> p) { ICFBamTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamTimestampTypeObj, Calendar>, TableCell<ICFBamTimestampTypeObj, Calendar>>() { @Override public TableCell<ICFBamTimestampTypeObj, Calendar> call( TableColumn<ICFBamTimestampTypeObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamTimestampTypeObj, Calendar>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampTypeObj, Calendar> p) { ICFBamTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalMinValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnMinValue.setCellFactory( new Callback<TableColumn<ICFBamTimestampTypeObj, Calendar>, TableCell<ICFBamTimestampTypeObj, Calendar>>() { @Override public TableCell<ICFBamTimestampTypeObj, Calendar> call( TableColumn<ICFBamTimestampTypeObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamTimestampTypeObj, Calendar>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampTypeObj, Calendar> p) { ICFBamTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalMaxValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnMaxValue.setCellFactory( new Callback<TableColumn<ICFBamTimestampTypeObj, Calendar>, TableCell<ICFBamTimestampTypeObj, Calendar>>() { @Override public TableCell<ICFBamTimestampTypeObj, Calendar> call( TableColumn<ICFBamTimestampTypeObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamTimestampTypeObj, Calendar>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampTypeObj, Calendar> p) { ICFBamTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamTimestampTypeObj, Calendar>, TableCell<ICFBamTimestampTypeObj, Calendar>>() { @Override public TableCell<ICFBamTimestampTypeObj, Calendar> call( TableColumn<ICFBamTimestampTypeObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamTimestampTypeObj, Calendar>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampTypeObj, Calendar> p) { ICFBamTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamTimestampTypeObj, Calendar>, TableCell<ICFBamTimestampTypeObj, Calendar>>() { @Override public TableCell<ICFBamTimestampTypeObj, Calendar> call( TableColumn<ICFBamTimestampTypeObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamTimestampTypeObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampTypeObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamTimestampTypeObj, ICFBamSchemaDefObj> p) { ICFBamTimestampTypeObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema(); ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupDefSchema.setCellFactory( new Callback<TableColumn<ICFBamTimestampTypeObj, ICFBamSchemaDefObj>, TableCell<ICFBamTimestampTypeObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamTimestampTypeObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamTimestampTypeObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamTimestampTypeObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty() .addListener(new ChangeListener<ICFBamTimestampTypeObj>() { @Override public void changed(ObservableValue<? extends ICFBamTimestampTypeObj> observable, ICFBamTimestampTypeObj oldValue, ICFBamTimestampTypeObj newValue) { setJavaFXFocus(newValue); 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.choseTimestampType(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"); } ICFBamTimestampTypeObj selectedInstance = getJavaFXFocusAsTimestampType(); invokeWhenChosen.choseTimestampType(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.CFBamJavaFXNmTokenDefPickerPane.java
public CFBamJavaFXNmTokenDefPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamNmTokenDefObj argFocus, ICFBamScopeObj argContainer, Collection<ICFBamNmTokenDefObj> argDataCollection, ICFBamJavaFXNmTokenDefChosen whenChosen) { super();//w ww .j a v a 2s . c om final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } 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<ICFBamNmTokenDefObj>(); tableColumnObjKind = new TableColumn<ICFBamNmTokenDefObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamNmTokenDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String classCode = obj.getClassCode(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(classCode); return (observable); } } }); tableColumnObjKind.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamNmTokenDefObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamNmTokenDefObj, Long> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { long value = obj.getRequiredId(); Long wrapped = new Long(value); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(wrapped); return (observable); } } }); tableColumnId.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, Long>, TableCell<ICFBamNmTokenDefObj, Long>>() { @Override public TableCell<ICFBamNmTokenDefObj, Long> call(TableColumn<ICFBamNmTokenDefObj, Long> arg) { return new CFInt64TableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamNmTokenDefObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getRequiredName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnName.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamNmTokenDefObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortName.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamNmTokenDefObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalLabel(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnLabel.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamNmTokenDefObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortDescription.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamNmTokenDefObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDescription.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamNmTokenDefObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokenDefObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredIsNullable(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnIsNullable.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, Boolean>, TableCell<ICFBamNmTokenDefObj, Boolean>>() { @Override public TableCell<ICFBamNmTokenDefObj, Boolean> call( TableColumn<ICFBamNmTokenDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamNmTokenDefObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokenDefObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { Boolean value = obj.getOptionalGenerateId(); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(value); return (observable); } } }); tableColumnGenerateId.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, Boolean>, TableCell<ICFBamNmTokenDefObj, Boolean>>() { @Override public TableCell<ICFBamNmTokenDefObj, Boolean> call( TableColumn<ICFBamNmTokenDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamNmTokenDefObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokenDefObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredDefaultVisibility(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnDefaultVisibility.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, Boolean>, TableCell<ICFBamNmTokenDefObj, Boolean>>() { @Override public TableCell<ICFBamNmTokenDefObj, Boolean> call( TableColumn<ICFBamNmTokenDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamNmTokenDefObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamAtomObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDbName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDbName.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnMaxLen = new TableColumn<ICFBamNmTokenDefObj, Integer>("Max. Length"); tableColumnMaxLen.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamNmTokenDefObj, Integer> p) { ICFBamNmTokenDefObj obj = p.getValue(); if (obj == null) { return (null); } else { int value = obj.getRequiredMaxLen(); Integer wrapped = new Integer(value); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(wrapped); return (observable); } } }); tableColumnMaxLen.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, Integer>, TableCell<ICFBamNmTokenDefObj, Integer>>() { @Override public TableCell<ICFBamNmTokenDefObj, Integer> call( TableColumn<ICFBamNmTokenDefObj, Integer> arg) { return new CFInt32TableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnMaxLen); tableColumnInitValue = new TableColumn<ICFBamNmTokenDefObj, String>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamNmTokenDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFNmTokenTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamNmTokenDefObj, String>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamNmTokenDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFNmTokenTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnNullValue = new TableColumn<ICFBamNmTokenDefObj, String>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamNmTokenDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFNmTokenTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamNmTokenDefObj, String>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenDefObj, String> p) { ICFBamNmTokenDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, String>, TableCell<ICFBamNmTokenDefObj, String>>() { @Override public TableCell<ICFBamNmTokenDefObj, String> call( TableColumn<ICFBamNmTokenDefObj, String> arg) { return new CFNmTokenTableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnShowLines = new TableColumn<ICFBamNmTokenDefObj, Short>("Show Lines"); tableColumnShowLines.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamNmTokenDefObj, Short> p) { ICFBamNmTokenDefObj obj = p.getValue(); if (obj == null) { return (null); } else { short value = obj.getRequiredShowLines(); Short wrapped = new Short(value); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(wrapped); return (observable); } } }); tableColumnShowLines.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, Short>, TableCell<ICFBamNmTokenDefObj, Short>>() { @Override public TableCell<ICFBamNmTokenDefObj, Short> call(TableColumn<ICFBamNmTokenDefObj, Short> arg) { return new CFInt16TableCell<ICFBamNmTokenDefObj>(); } }); dataTable.getColumns().add(tableColumnShowLines); tableColumnLookupDefSchema = new TableColumn<ICFBamNmTokenDefObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenDefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamNmTokenDefObj, ICFBamSchemaDefObj> p) { ICFBamNmTokenDefObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema(); ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupDefSchema.setCellFactory( new Callback<TableColumn<ICFBamNmTokenDefObj, ICFBamSchemaDefObj>, TableCell<ICFBamNmTokenDefObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamNmTokenDefObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamNmTokenDefObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamNmTokenDefObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamNmTokenDefObj>() { @Override public void changed(ObservableValue<? extends ICFBamNmTokenDefObj> observable, ICFBamNmTokenDefObj oldValue, ICFBamNmTokenDefObj newValue) { setJavaFXFocus(newValue); 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.choseNmTokenDef(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"); } ICFBamNmTokenDefObj selectedInstance = getJavaFXFocusAsNmTokenDef(); invokeWhenChosen.choseNmTokenDef(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.CFBamJavaFXRelationPickerPane.java
public CFBamJavaFXRelationPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamRelationObj argFocus, ICFBamTableObj argContainer, Collection<ICFBamRelationObj> argDataCollection, ICFBamJavaFXRelationChosen whenChosen) { super();/* w w w .j a 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<ICFBamRelationObj>(); tableColumnId = new TableColumn<ICFBamRelationObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamRelationObj, Long> p) { ICFBamScopeObj obj = p.getValue(); if (obj == null) { return (null); } else { long value = obj.getRequiredId(); Long wrapped = new Long(value); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(wrapped); return (observable); } } }); tableColumnId.setCellFactory( new Callback<TableColumn<ICFBamRelationObj, Long>, TableCell<ICFBamRelationObj, Long>>() { @Override public TableCell<ICFBamRelationObj, Long> call(TableColumn<ICFBamRelationObj, Long> arg) { return new CFInt64TableCell<ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamRelationObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamRelationObj, String> p) { ICFBamRelationObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getRequiredName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnName.setCellFactory( new Callback<TableColumn<ICFBamRelationObj, String>, TableCell<ICFBamRelationObj, String>>() { @Override public TableCell<ICFBamRelationObj, String> call(TableColumn<ICFBamRelationObj, String> arg) { return new CFStringTableCell<ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamRelationObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamRelationObj, String> p) { ICFBamRelationObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortName.setCellFactory( new Callback<TableColumn<ICFBamRelationObj, String>, TableCell<ICFBamRelationObj, String>>() { @Override public TableCell<ICFBamRelationObj, String> call(TableColumn<ICFBamRelationObj, String> arg) { return new CFStringTableCell<ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamRelationObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamRelationObj, String> p) { ICFBamRelationObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalLabel(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnLabel.setCellFactory( new Callback<TableColumn<ICFBamRelationObj, String>, TableCell<ICFBamRelationObj, String>>() { @Override public TableCell<ICFBamRelationObj, String> call(TableColumn<ICFBamRelationObj, String> arg) { return new CFStringTableCell<ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamRelationObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamRelationObj, String> p) { ICFBamRelationObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortDescription.setCellFactory( new Callback<TableColumn<ICFBamRelationObj, String>, TableCell<ICFBamRelationObj, String>>() { @Override public TableCell<ICFBamRelationObj, String> call(TableColumn<ICFBamRelationObj, String> arg) { return new CFStringTableCell<ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamRelationObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamRelationObj, String> p) { ICFBamRelationObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDescription.setCellFactory( new Callback<TableColumn<ICFBamRelationObj, String>, TableCell<ICFBamRelationObj, String>>() { @Override public TableCell<ICFBamRelationObj, String> call(TableColumn<ICFBamRelationObj, String> arg) { return new CFStringTableCell<ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnRelationType = new TableColumn<ICFBamRelationObj, ICFBamSchema.RelationTypeEnum>("RelationType"); tableColumnRelationType.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, ICFBamSchema.RelationTypeEnum>, ObservableValue<ICFBamSchema.RelationTypeEnum>>() { public ObservableValue<ICFBamSchema.RelationTypeEnum> call( CellDataFeatures<ICFBamRelationObj, ICFBamSchema.RelationTypeEnum> p) { ICFBamRelationObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchema.RelationTypeEnum value = obj.getRequiredRelationType(); ReadOnlyObjectWrapper<ICFBamSchema.RelationTypeEnum> observable = new ReadOnlyObjectWrapper<ICFBamSchema.RelationTypeEnum>(); observable.setValue(value); return (observable); } } }); tableColumnRelationType.setCellFactory( new Callback<TableColumn<ICFBamRelationObj, ICFBamSchema.RelationTypeEnum>, TableCell<ICFBamRelationObj, ICFBamSchema.RelationTypeEnum>>() { @Override public TableCell<ICFBamRelationObj, ICFBamSchema.RelationTypeEnum> call( TableColumn<ICFBamRelationObj, ICFBamSchema.RelationTypeEnum> arg) { return new CFEnumTableCell<ICFBamRelationObj, ICFBamSchema.RelationTypeEnum>(); } }); dataTable.getColumns().add(tableColumnRelationType); tableColumnDbName = new TableColumn<ICFBamRelationObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamRelationObj, String> p) { ICFBamRelationObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDbName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDbName.setCellFactory( new Callback<TableColumn<ICFBamRelationObj, String>, TableCell<ICFBamRelationObj, String>>() { @Override public TableCell<ICFBamRelationObj, String> call(TableColumn<ICFBamRelationObj, String> arg) { return new CFStringTableCell<ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnSuffix = new TableColumn<ICFBamRelationObj, String>("Suffix"); tableColumnSuffix.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamRelationObj, String> p) { ICFBamRelationObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalSuffix(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnSuffix.setCellFactory( new Callback<TableColumn<ICFBamRelationObj, String>, TableCell<ICFBamRelationObj, String>>() { @Override public TableCell<ICFBamRelationObj, String> call(TableColumn<ICFBamRelationObj, String> arg) { return new CFStringTableCell<ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnSuffix); tableColumnIsRequired = new TableColumn<ICFBamRelationObj, Boolean>("Is Required"); tableColumnIsRequired.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamRelationObj, Boolean> p) { ICFBamRelationObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredIsRequired(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnIsRequired.setCellFactory( new Callback<TableColumn<ICFBamRelationObj, Boolean>, TableCell<ICFBamRelationObj, Boolean>>() { @Override public TableCell<ICFBamRelationObj, Boolean> call(TableColumn<ICFBamRelationObj, Boolean> arg) { return new CFBoolTableCell<ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnIsRequired); tableColumnIsAbstract = new TableColumn<ICFBamRelationObj, Boolean>("Is Abstract"); tableColumnIsAbstract.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamRelationObj, Boolean> p) { ICFBamRelationObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredIsAbstract(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnIsAbstract.setCellFactory( new Callback<TableColumn<ICFBamRelationObj, Boolean>, TableCell<ICFBamRelationObj, Boolean>>() { @Override public TableCell<ICFBamRelationObj, Boolean> call(TableColumn<ICFBamRelationObj, Boolean> arg) { return new CFBoolTableCell<ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnIsAbstract); tableColumnIsXsdContainer = new TableColumn<ICFBamRelationObj, Boolean>("Is XSD Container"); tableColumnIsXsdContainer.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamRelationObj, Boolean> p) { ICFBamRelationObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredIsXsdContainer(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnIsXsdContainer.setCellFactory( new Callback<TableColumn<ICFBamRelationObj, Boolean>, TableCell<ICFBamRelationObj, Boolean>>() { @Override public TableCell<ICFBamRelationObj, Boolean> call(TableColumn<ICFBamRelationObj, Boolean> arg) { return new CFBoolTableCell<ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnIsXsdContainer); tableColumnDefaultVisibility = new TableColumn<ICFBamRelationObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamRelationObj, Boolean> p) { ICFBamRelationObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredDefaultVisibility(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnDefaultVisibility.setCellFactory( new Callback<TableColumn<ICFBamRelationObj, Boolean>, TableCell<ICFBamRelationObj, Boolean>>() { @Override public TableCell<ICFBamRelationObj, Boolean> call(TableColumn<ICFBamRelationObj, Boolean> arg) { return new CFBoolTableCell<ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnLookupDefSchema = new TableColumn<ICFBamRelationObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamRelationObj, ICFBamSchemaDefObj> p) { ICFBamRelationObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema(); ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupDefSchema.setCellFactory( new Callback<TableColumn<ICFBamRelationObj, ICFBamSchemaDefObj>, TableCell<ICFBamRelationObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamRelationObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamRelationObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamRelationObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); tableColumnLookupFromIndex = new TableColumn<ICFBamRelationObj, ICFBamIndexObj>("From Index"); tableColumnLookupFromIndex.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, ICFBamIndexObj>, ObservableValue<ICFBamIndexObj>>() { public ObservableValue<ICFBamIndexObj> call( CellDataFeatures<ICFBamRelationObj, ICFBamIndexObj> p) { ICFBamRelationObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamIndexObj ref = obj.getRequiredLookupFromIndex(); ReadOnlyObjectWrapper<ICFBamIndexObj> observable = new ReadOnlyObjectWrapper<ICFBamIndexObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupFromIndex.setCellFactory( new Callback<TableColumn<ICFBamRelationObj, ICFBamIndexObj>, TableCell<ICFBamRelationObj, ICFBamIndexObj>>() { @Override public TableCell<ICFBamRelationObj, ICFBamIndexObj> call( TableColumn<ICFBamRelationObj, ICFBamIndexObj> arg) { return new CFReferenceTableCell<ICFBamRelationObj, ICFBamIndexObj>(); } }); dataTable.getColumns().add(tableColumnLookupFromIndex); tableColumnLookupToTable = new TableColumn<ICFBamRelationObj, ICFBamTableObj>("To Table"); tableColumnLookupToTable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, ICFBamTableObj>, ObservableValue<ICFBamTableObj>>() { public ObservableValue<ICFBamTableObj> call( CellDataFeatures<ICFBamRelationObj, ICFBamTableObj> p) { ICFBamRelationObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamTableObj ref = obj.getRequiredLookupToTable(); ReadOnlyObjectWrapper<ICFBamTableObj> observable = new ReadOnlyObjectWrapper<ICFBamTableObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupToTable.setCellFactory( new Callback<TableColumn<ICFBamRelationObj, ICFBamTableObj>, TableCell<ICFBamRelationObj, ICFBamTableObj>>() { @Override public TableCell<ICFBamRelationObj, ICFBamTableObj> call( TableColumn<ICFBamRelationObj, ICFBamTableObj> arg) { return new CFReferenceTableCell<ICFBamRelationObj, ICFBamTableObj>(); } }); dataTable.getColumns().add(tableColumnLookupToTable); tableColumnLookupToIndex = new TableColumn<ICFBamRelationObj, ICFBamIndexObj>("To Index"); tableColumnLookupToIndex.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, ICFBamIndexObj>, ObservableValue<ICFBamIndexObj>>() { public ObservableValue<ICFBamIndexObj> call( CellDataFeatures<ICFBamRelationObj, ICFBamIndexObj> p) { ICFBamRelationObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamIndexObj ref = obj.getRequiredLookupToIndex(); ReadOnlyObjectWrapper<ICFBamIndexObj> observable = new ReadOnlyObjectWrapper<ICFBamIndexObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupToIndex.setCellFactory( new Callback<TableColumn<ICFBamRelationObj, ICFBamIndexObj>, TableCell<ICFBamRelationObj, ICFBamIndexObj>>() { @Override public TableCell<ICFBamRelationObj, ICFBamIndexObj> call( TableColumn<ICFBamRelationObj, ICFBamIndexObj> arg) { return new CFReferenceTableCell<ICFBamRelationObj, ICFBamIndexObj>(); } }); dataTable.getColumns().add(tableColumnLookupToIndex); tableColumnLookupNarrowed = new TableColumn<ICFBamRelationObj, ICFBamRelationObj>("Narrowed Relation"); tableColumnLookupNarrowed.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationObj, ICFBamRelationObj>, ObservableValue<ICFBamRelationObj>>() { public ObservableValue<ICFBamRelationObj> call( CellDataFeatures<ICFBamRelationObj, ICFBamRelationObj> p) { ICFBamRelationObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamRelationObj ref = obj.getOptionalLookupNarrowed(); ReadOnlyObjectWrapper<ICFBamRelationObj> observable = new ReadOnlyObjectWrapper<ICFBamRelationObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupNarrowed.setCellFactory( new Callback<TableColumn<ICFBamRelationObj, ICFBamRelationObj>, TableCell<ICFBamRelationObj, ICFBamRelationObj>>() { @Override public TableCell<ICFBamRelationObj, ICFBamRelationObj> call( TableColumn<ICFBamRelationObj, ICFBamRelationObj> arg) { return new CFReferenceTableCell<ICFBamRelationObj, ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnLookupNarrowed); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamRelationObj>() { @Override public void changed(ObservableValue<? extends ICFBamRelationObj> observable, ICFBamRelationObj oldValue, ICFBamRelationObj newValue) { setJavaFXFocus(newValue); 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.choseRelation(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"); } ICFBamRelationObj selectedInstance = getJavaFXFocusAsRelation(); invokeWhenChosen.choseRelation(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.CFBamJavaFXTZTimestampColPickerPane.java
public CFBamJavaFXTZTimestampColPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamTZTimestampColObj argFocus, ICFBamTableObj argContainer, Collection<ICFBamTZTimestampColObj> argDataCollection, ICFBamJavaFXTZTimestampColChosen whenChosen) { super();/*from w w w .j ava 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"); } 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<ICFBamTZTimestampColObj>(); tableColumnId = new TableColumn<ICFBamTZTimestampColObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamTZTimestampColObj, Long> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { long value = obj.getRequiredId(); Long wrapped = new Long(value); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(wrapped); return (observable); } } }); tableColumnId.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampColObj, Long>, TableCell<ICFBamTZTimestampColObj, Long>>() { @Override public TableCell<ICFBamTZTimestampColObj, Long> call( TableColumn<ICFBamTZTimestampColObj, Long> arg) { return new CFInt64TableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamTZTimestampColObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getRequiredName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnName.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampColObj, String>, TableCell<ICFBamTZTimestampColObj, String>>() { @Override public TableCell<ICFBamTZTimestampColObj, String> call( TableColumn<ICFBamTZTimestampColObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamTZTimestampColObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortName.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampColObj, String>, TableCell<ICFBamTZTimestampColObj, String>>() { @Override public TableCell<ICFBamTZTimestampColObj, String> call( TableColumn<ICFBamTZTimestampColObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamTZTimestampColObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalLabel(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnLabel.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampColObj, String>, TableCell<ICFBamTZTimestampColObj, String>>() { @Override public TableCell<ICFBamTZTimestampColObj, String> call( TableColumn<ICFBamTZTimestampColObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamTZTimestampColObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortDescription.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampColObj, String>, TableCell<ICFBamTZTimestampColObj, String>>() { @Override public TableCell<ICFBamTZTimestampColObj, String> call( TableColumn<ICFBamTZTimestampColObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamTZTimestampColObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDescription.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampColObj, String>, TableCell<ICFBamTZTimestampColObj, String>>() { @Override public TableCell<ICFBamTZTimestampColObj, String> call( TableColumn<ICFBamTZTimestampColObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamTZTimestampColObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimestampColObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredIsNullable(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnIsNullable.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampColObj, Boolean>, TableCell<ICFBamTZTimestampColObj, Boolean>>() { @Override public TableCell<ICFBamTZTimestampColObj, Boolean> call( TableColumn<ICFBamTZTimestampColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamTZTimestampColObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimestampColObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { Boolean value = obj.getOptionalGenerateId(); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(value); return (observable); } } }); tableColumnGenerateId.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampColObj, Boolean>, TableCell<ICFBamTZTimestampColObj, Boolean>>() { @Override public TableCell<ICFBamTZTimestampColObj, Boolean> call( TableColumn<ICFBamTZTimestampColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamTZTimestampColObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimestampColObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredDefaultVisibility(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnDefaultVisibility.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampColObj, Boolean>, TableCell<ICFBamTZTimestampColObj, Boolean>>() { @Override public TableCell<ICFBamTZTimestampColObj, Boolean> call( TableColumn<ICFBamTZTimestampColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamTZTimestampColObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampColObj, String> p) { ICFBamAtomObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDbName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDbName.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampColObj, String>, TableCell<ICFBamTZTimestampColObj, String>>() { @Override public TableCell<ICFBamTZTimestampColObj, String> call( TableColumn<ICFBamTZTimestampColObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamTZTimestampColObj, Calendar>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampColObj, Calendar> p) { ICFBamTZTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampColObj, Calendar>, TableCell<ICFBamTZTimestampColObj, Calendar>>() { @Override public TableCell<ICFBamTZTimestampColObj, Calendar> call( TableColumn<ICFBamTZTimestampColObj, Calendar> arg) { return new CFTZTimestampTableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamTZTimestampColObj, Calendar>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampColObj, Calendar> p) { ICFBamTZTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampColObj, Calendar>, TableCell<ICFBamTZTimestampColObj, Calendar>>() { @Override public TableCell<ICFBamTZTimestampColObj, Calendar> call( TableColumn<ICFBamTZTimestampColObj, Calendar> arg) { return new CFTZTimestampTableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamTZTimestampColObj, Calendar>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampColObj, Calendar> p) { ICFBamTZTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalMinValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnMinValue.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampColObj, Calendar>, TableCell<ICFBamTZTimestampColObj, Calendar>>() { @Override public TableCell<ICFBamTZTimestampColObj, Calendar> call( TableColumn<ICFBamTZTimestampColObj, Calendar> arg) { return new CFTZTimestampTableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamTZTimestampColObj, Calendar>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampColObj, Calendar> p) { ICFBamTZTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalMaxValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnMaxValue.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampColObj, Calendar>, TableCell<ICFBamTZTimestampColObj, Calendar>>() { @Override public TableCell<ICFBamTZTimestampColObj, Calendar> call( TableColumn<ICFBamTZTimestampColObj, Calendar> arg) { return new CFTZTimestampTableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamTZTimestampColObj, Calendar>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampColObj, Calendar> p) { ICFBamTZTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampColObj, Calendar>, TableCell<ICFBamTZTimestampColObj, Calendar>>() { @Override public TableCell<ICFBamTZTimestampColObj, Calendar> call( TableColumn<ICFBamTZTimestampColObj, Calendar> arg) { return new CFTZTimestampTableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamTZTimestampColObj, Calendar>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampColObj, Calendar> p) { ICFBamTZTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampColObj, Calendar>, TableCell<ICFBamTZTimestampColObj, Calendar>>() { @Override public TableCell<ICFBamTZTimestampColObj, Calendar> call( TableColumn<ICFBamTZTimestampColObj, Calendar> arg) { return new CFTZTimestampTableCell<ICFBamTZTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamTZTimestampColObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamTZTimestampColObj, ICFBamSchemaDefObj> p) { ICFBamTZTimestampColObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema(); ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupDefSchema.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampColObj, ICFBamSchemaDefObj>, TableCell<ICFBamTZTimestampColObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamTZTimestampColObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamTZTimestampColObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamTZTimestampColObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty() .addListener(new ChangeListener<ICFBamTZTimestampColObj>() { @Override public void changed(ObservableValue<? extends ICFBamTZTimestampColObj> observable, ICFBamTZTimestampColObj oldValue, ICFBamTZTimestampColObj newValue) { setJavaFXFocus(newValue); 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.choseTZTimestampCol(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"); } ICFBamTZTimestampColObj selectedInstance = getJavaFXFocusAsTZTimestampCol(); invokeWhenChosen.choseTZTimestampCol(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.CFBamJavaFXNmTokensDefPickerPane.java
public CFBamJavaFXNmTokensDefPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamNmTokensDefObj argFocus, ICFBamScopeObj argContainer, Collection<ICFBamNmTokensDefObj> argDataCollection, ICFBamJavaFXNmTokensDefChosen whenChosen) { super();/*from 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"); } 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<ICFBamNmTokensDefObj>(); tableColumnObjKind = new TableColumn<ICFBamNmTokensDefObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamNmTokensDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String classCode = obj.getClassCode(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(classCode); return (observable); } } }); tableColumnObjKind.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamNmTokensDefObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamNmTokensDefObj, Long> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { long value = obj.getRequiredId(); Long wrapped = new Long(value); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(wrapped); return (observable); } } }); tableColumnId.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, Long>, TableCell<ICFBamNmTokensDefObj, Long>>() { @Override public TableCell<ICFBamNmTokensDefObj, Long> call(TableColumn<ICFBamNmTokensDefObj, Long> arg) { return new CFInt64TableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamNmTokensDefObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getRequiredName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnName.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamNmTokensDefObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortName.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamNmTokensDefObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalLabel(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnLabel.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamNmTokensDefObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortDescription.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamNmTokensDefObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDescription.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamNmTokensDefObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokensDefObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredIsNullable(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnIsNullable.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, Boolean>, TableCell<ICFBamNmTokensDefObj, Boolean>>() { @Override public TableCell<ICFBamNmTokensDefObj, Boolean> call( TableColumn<ICFBamNmTokensDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamNmTokensDefObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokensDefObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { Boolean value = obj.getOptionalGenerateId(); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(value); return (observable); } } }); tableColumnGenerateId.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, Boolean>, TableCell<ICFBamNmTokensDefObj, Boolean>>() { @Override public TableCell<ICFBamNmTokensDefObj, Boolean> call( TableColumn<ICFBamNmTokensDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamNmTokensDefObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokensDefObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredDefaultVisibility(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnDefaultVisibility.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, Boolean>, TableCell<ICFBamNmTokensDefObj, Boolean>>() { @Override public TableCell<ICFBamNmTokensDefObj, Boolean> call( TableColumn<ICFBamNmTokensDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamNmTokensDefObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamAtomObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDbName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDbName.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnMaxLen = new TableColumn<ICFBamNmTokensDefObj, Integer>("Max. Length"); tableColumnMaxLen.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamNmTokensDefObj, Integer> p) { ICFBamNmTokensDefObj obj = p.getValue(); if (obj == null) { return (null); } else { int value = obj.getRequiredMaxLen(); Integer wrapped = new Integer(value); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(wrapped); return (observable); } } }); tableColumnMaxLen.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, Integer>, TableCell<ICFBamNmTokensDefObj, Integer>>() { @Override public TableCell<ICFBamNmTokensDefObj, Integer> call( TableColumn<ICFBamNmTokensDefObj, Integer> arg) { return new CFInt32TableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnMaxLen); tableColumnInitValue = new TableColumn<ICFBamNmTokensDefObj, String>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamNmTokensDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFNmTokensTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamNmTokensDefObj, String>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamNmTokensDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFNmTokensTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnNullValue = new TableColumn<ICFBamNmTokensDefObj, String>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamNmTokensDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFNmTokensTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamNmTokensDefObj, String>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) { ICFBamNmTokensDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() { @Override public TableCell<ICFBamNmTokensDefObj, String> call( TableColumn<ICFBamNmTokensDefObj, String> arg) { return new CFNmTokensTableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnShowLines = new TableColumn<ICFBamNmTokensDefObj, Short>("Show Lines"); tableColumnShowLines.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamNmTokensDefObj, Short> p) { ICFBamNmTokensDefObj obj = p.getValue(); if (obj == null) { return (null); } else { short value = obj.getRequiredShowLines(); Short wrapped = new Short(value); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(wrapped); return (observable); } } }); tableColumnShowLines.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, Short>, TableCell<ICFBamNmTokensDefObj, Short>>() { @Override public TableCell<ICFBamNmTokensDefObj, Short> call( TableColumn<ICFBamNmTokensDefObj, Short> arg) { return new CFInt16TableCell<ICFBamNmTokensDefObj>(); } }); dataTable.getColumns().add(tableColumnShowLines); tableColumnLookupDefSchema = new TableColumn<ICFBamNmTokensDefObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensDefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamNmTokensDefObj, ICFBamSchemaDefObj> p) { ICFBamNmTokensDefObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema(); ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupDefSchema.setCellFactory( new Callback<TableColumn<ICFBamNmTokensDefObj, ICFBamSchemaDefObj>, TableCell<ICFBamNmTokensDefObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamNmTokensDefObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamNmTokensDefObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamNmTokensDefObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty() .addListener(new ChangeListener<ICFBamNmTokensDefObj>() { @Override public void changed(ObservableValue<? extends ICFBamNmTokensDefObj> observable, ICFBamNmTokensDefObj oldValue, ICFBamNmTokensDefObj newValue) { setJavaFXFocus(newValue); 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.choseNmTokensDef(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"); } ICFBamNmTokensDefObj selectedInstance = getJavaFXFocusAsNmTokensDef(); invokeWhenChosen.choseNmTokensDef(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.CFBamJavaFXParamListPane.java
public CFBamJavaFXParamListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamServerMethodObj argContainer, ICFBamParamObj argFocus, Collection<ICFBamParamObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();// w w w. ja va2 s.c o m final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamParamObj>(); tableColumnId = new TableColumn<ICFBamParamObj, Long>("Id"); tableColumnId .setCellValueFactory(new Callback<CellDataFeatures<ICFBamParamObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamParamObj, Long> p) { ICFBamParamObj 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<ICFBamParamObj, Long>, TableCell<ICFBamParamObj, Long>>() { @Override public TableCell<ICFBamParamObj, Long> call(TableColumn<ICFBamParamObj, Long> arg) { return new CFInt64TableCell<ICFBamParamObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamParamObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamParamObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamParamObj, String> p) { ICFBamParamObj 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<ICFBamParamObj, String>, TableCell<ICFBamParamObj, String>>() { @Override public TableCell<ICFBamParamObj, String> call(TableColumn<ICFBamParamObj, String> arg) { return new CFStringTableCell<ICFBamParamObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortDescription = new TableColumn<ICFBamParamObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamParamObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamParamObj, String> p) { ICFBamParamObj 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<ICFBamParamObj, String>, TableCell<ICFBamParamObj, String>>() { @Override public TableCell<ICFBamParamObj, String> call(TableColumn<ICFBamParamObj, String> arg) { return new CFStringTableCell<ICFBamParamObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamParamObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamParamObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamParamObj, String> p) { ICFBamParamObj 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<ICFBamParamObj, String>, TableCell<ICFBamParamObj, String>>() { @Override public TableCell<ICFBamParamObj, String> call(TableColumn<ICFBamParamObj, String> arg) { return new CFStringTableCell<ICFBamParamObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamParamObj, Boolean>("IsNullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamParamObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamParamObj, Boolean> p) { ICFBamParamObj 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<ICFBamParamObj, Boolean>, TableCell<ICFBamParamObj, Boolean>>() { @Override public TableCell<ICFBamParamObj, Boolean> call(TableColumn<ICFBamParamObj, Boolean> arg) { return new CFBoolTableCell<ICFBamParamObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnLookupDefSchema = new TableColumn<ICFBamParamObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamParamObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamParamObj, ICFBamSchemaDefObj> p) { ICFBamParamObj 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<ICFBamParamObj, ICFBamSchemaDefObj>, TableCell<ICFBamParamObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamParamObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamParamObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamParamObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); tableColumnLookupType = new TableColumn<ICFBamParamObj, ICFBamValueObj>("Type Specification"); tableColumnLookupType.setCellValueFactory( new Callback<CellDataFeatures<ICFBamParamObj, ICFBamValueObj>, ObservableValue<ICFBamValueObj>>() { public ObservableValue<ICFBamValueObj> call( CellDataFeatures<ICFBamParamObj, ICFBamValueObj> p) { ICFBamParamObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamValueObj ref = obj.getRequiredLookupType(); ReadOnlyObjectWrapper<ICFBamValueObj> observable = new ReadOnlyObjectWrapper<ICFBamValueObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupType.setCellFactory( new Callback<TableColumn<ICFBamParamObj, ICFBamValueObj>, TableCell<ICFBamParamObj, ICFBamValueObj>>() { @Override public TableCell<ICFBamParamObj, ICFBamValueObj> call( TableColumn<ICFBamParamObj, ICFBamValueObj> arg) { return new CFReferenceTableCell<ICFBamParamObj, ICFBamValueObj>(); } }); dataTable.getColumns().add(tableColumnLookupType); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamParamObj>() { @Override public void changed(ObservableValue<? extends ICFBamParamObj> observable, ICFBamParamObj oldValue, ICFBamParamObj 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 (observableListOfParam != null) { dataTable.setItems(observableListOfParam); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXTZTimestampTypePickerPane.java
public CFBamJavaFXTZTimestampTypePickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamTZTimestampTypeObj argFocus, ICFBamSchemaDefObj argContainer, Collection<ICFBamTZTimestampTypeObj> argDataCollection, ICFBamJavaFXTZTimestampTypeChosen whenChosen) { super();/*from w w w.ja v a 2 s .c o m*/ final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } 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<ICFBamTZTimestampTypeObj>(); tableColumnId = new TableColumn<ICFBamTZTimestampTypeObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamTZTimestampTypeObj, Long> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { long value = obj.getRequiredId(); Long wrapped = new Long(value); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(wrapped); return (observable); } } }); tableColumnId.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampTypeObj, Long>, TableCell<ICFBamTZTimestampTypeObj, Long>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, Long> call( TableColumn<ICFBamTZTimestampTypeObj, Long> arg) { return new CFInt64TableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamTZTimestampTypeObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampTypeObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getRequiredName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnName.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampTypeObj, String>, TableCell<ICFBamTZTimestampTypeObj, String>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, String> call( TableColumn<ICFBamTZTimestampTypeObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamTZTimestampTypeObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampTypeObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortName.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampTypeObj, String>, TableCell<ICFBamTZTimestampTypeObj, String>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, String> call( TableColumn<ICFBamTZTimestampTypeObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamTZTimestampTypeObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampTypeObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalLabel(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnLabel.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampTypeObj, String>, TableCell<ICFBamTZTimestampTypeObj, String>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, String> call( TableColumn<ICFBamTZTimestampTypeObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamTZTimestampTypeObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampTypeObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortDescription.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampTypeObj, String>, TableCell<ICFBamTZTimestampTypeObj, String>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, String> call( TableColumn<ICFBamTZTimestampTypeObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamTZTimestampTypeObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampTypeObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDescription.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampTypeObj, String>, TableCell<ICFBamTZTimestampTypeObj, String>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, String> call( TableColumn<ICFBamTZTimestampTypeObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamTZTimestampTypeObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimestampTypeObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredIsNullable(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnIsNullable.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampTypeObj, Boolean>, TableCell<ICFBamTZTimestampTypeObj, Boolean>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, Boolean> call( TableColumn<ICFBamTZTimestampTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamTZTimestampTypeObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimestampTypeObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { Boolean value = obj.getOptionalGenerateId(); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(value); return (observable); } } }); tableColumnGenerateId.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampTypeObj, Boolean>, TableCell<ICFBamTZTimestampTypeObj, Boolean>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, Boolean> call( TableColumn<ICFBamTZTimestampTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamTZTimestampTypeObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimestampTypeObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredDefaultVisibility(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnDefaultVisibility.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampTypeObj, Boolean>, TableCell<ICFBamTZTimestampTypeObj, Boolean>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, Boolean> call( TableColumn<ICFBamTZTimestampTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamTZTimestampTypeObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampTypeObj, String> p) { ICFBamAtomObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDbName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDbName.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampTypeObj, String>, TableCell<ICFBamTZTimestampTypeObj, String>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, String> call( TableColumn<ICFBamTZTimestampTypeObj, String> arg) { return new CFStringTableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamTZTimestampTypeObj, Calendar>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampTypeObj, Calendar> p) { ICFBamTZTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampTypeObj, Calendar>, TableCell<ICFBamTZTimestampTypeObj, Calendar>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, Calendar> call( TableColumn<ICFBamTZTimestampTypeObj, Calendar> arg) { return new CFTZTimestampTableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamTZTimestampTypeObj, Calendar>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampTypeObj, Calendar> p) { ICFBamTZTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampTypeObj, Calendar>, TableCell<ICFBamTZTimestampTypeObj, Calendar>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, Calendar> call( TableColumn<ICFBamTZTimestampTypeObj, Calendar> arg) { return new CFTZTimestampTableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamTZTimestampTypeObj, Calendar>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampTypeObj, Calendar> p) { ICFBamTZTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalMinValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnMinValue.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampTypeObj, Calendar>, TableCell<ICFBamTZTimestampTypeObj, Calendar>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, Calendar> call( TableColumn<ICFBamTZTimestampTypeObj, Calendar> arg) { return new CFTZTimestampTableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamTZTimestampTypeObj, Calendar>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampTypeObj, Calendar> p) { ICFBamTZTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalMaxValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnMaxValue.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampTypeObj, Calendar>, TableCell<ICFBamTZTimestampTypeObj, Calendar>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, Calendar> call( TableColumn<ICFBamTZTimestampTypeObj, Calendar> arg) { return new CFTZTimestampTableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamTZTimestampTypeObj, Calendar>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampTypeObj, Calendar> p) { ICFBamTZTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampTypeObj, Calendar>, TableCell<ICFBamTZTimestampTypeObj, Calendar>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, Calendar> call( TableColumn<ICFBamTZTimestampTypeObj, Calendar> arg) { return new CFTZTimestampTableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamTZTimestampTypeObj, Calendar>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampTypeObj, Calendar> p) { ICFBamTZTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampTypeObj, Calendar>, TableCell<ICFBamTZTimestampTypeObj, Calendar>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, Calendar> call( TableColumn<ICFBamTZTimestampTypeObj, Calendar> arg) { return new CFTZTimestampTableCell<ICFBamTZTimestampTypeObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamTZTimestampTypeObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimestampTypeObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamTZTimestampTypeObj, ICFBamSchemaDefObj> p) { ICFBamTZTimestampTypeObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema(); ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupDefSchema.setCellFactory( new Callback<TableColumn<ICFBamTZTimestampTypeObj, ICFBamSchemaDefObj>, TableCell<ICFBamTZTimestampTypeObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamTZTimestampTypeObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamTZTimestampTypeObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamTZTimestampTypeObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty() .addListener(new ChangeListener<ICFBamTZTimestampTypeObj>() { @Override public void changed(ObservableValue<? extends ICFBamTZTimestampTypeObj> observable, ICFBamTZTimestampTypeObj oldValue, ICFBamTZTimestampTypeObj newValue) { setJavaFXFocus(newValue); 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.choseTZTimestampType(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"); } ICFBamTZTimestampTypeObj selectedInstance = getJavaFXFocusAsTZTimestampType(); invokeWhenChosen.choseTZTimestampType(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.CFBamJavaFXDelDepListPane.java
public CFBamJavaFXDelDepListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFLibAnyObj argContainer, ICFBamDelDepObj argFocus, Collection<ICFBamDelDepObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();//from ww w.ja v a2 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<ICFBamDelDepObj>(); tableColumnObjKind = new TableColumn<ICFBamDelDepObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDelDepObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamDelDepObj, String> p) { ICFBamDelDepObj obj = p.getValue(); if (obj == null) { return (null); } else { String classCode = obj.getClassCode(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(classCode); return (observable); } } }); tableColumnObjKind.setCellFactory( new Callback<TableColumn<ICFBamDelDepObj, String>, TableCell<ICFBamDelDepObj, String>>() { @Override public TableCell<ICFBamDelDepObj, String> call(TableColumn<ICFBamDelDepObj, String> arg) { return new CFStringTableCell<ICFBamDelDepObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamDelDepObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDelDepObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamDelDepObj, 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<ICFBamDelDepObj, Long>, TableCell<ICFBamDelDepObj, Long>>() { @Override public TableCell<ICFBamDelDepObj, Long> call(TableColumn<ICFBamDelDepObj, Long> arg) { return new CFInt64TableCell<ICFBamDelDepObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnLookupRelation = new TableColumn<ICFBamDelDepObj, ICFBamRelationObj>("Relation"); tableColumnLookupRelation.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDelDepObj, ICFBamRelationObj>, ObservableValue<ICFBamRelationObj>>() { public ObservableValue<ICFBamRelationObj> call( CellDataFeatures<ICFBamDelDepObj, ICFBamRelationObj> p) { ICFBamDelDepObj 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<ICFBamDelDepObj, ICFBamRelationObj>, TableCell<ICFBamDelDepObj, ICFBamRelationObj>>() { @Override public TableCell<ICFBamDelDepObj, ICFBamRelationObj> call( TableColumn<ICFBamDelDepObj, ICFBamRelationObj> arg) { return new CFReferenceTableCell<ICFBamDelDepObj, ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnLookupRelation); tableColumnLookupDefSchema = new TableColumn<ICFBamDelDepObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDelDepObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamDelDepObj, ICFBamSchemaDefObj> p) { ICFBamDelDepObj 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<ICFBamDelDepObj, ICFBamSchemaDefObj>, TableCell<ICFBamDelDepObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamDelDepObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamDelDepObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamDelDepObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamDelDepObj>() { @Override public void changed(ObservableValue<? extends ICFBamDelDepObj> observable, ICFBamDelDepObj oldValue, ICFBamDelDepObj 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 (observableListOfDelDep != null) { dataTable.setItems(observableListOfDelDep); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXPopDepListPane.java
public CFBamJavaFXPopDepListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFLibAnyObj argContainer, ICFBamPopDepObj argFocus, Collection<ICFBamPopDepObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();//w w w .j a v a 2 s .com final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamPopDepObj>(); tableColumnObjKind = new TableColumn<ICFBamPopDepObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamPopDepObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamPopDepObj, String> p) { ICFBamPopDepObj obj = p.getValue(); if (obj == null) { return (null); } else { String classCode = obj.getClassCode(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(classCode); return (observable); } } }); tableColumnObjKind.setCellFactory( new Callback<TableColumn<ICFBamPopDepObj, String>, TableCell<ICFBamPopDepObj, String>>() { @Override public TableCell<ICFBamPopDepObj, String> call(TableColumn<ICFBamPopDepObj, String> arg) { return new CFStringTableCell<ICFBamPopDepObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamPopDepObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamPopDepObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamPopDepObj, 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<ICFBamPopDepObj, Long>, TableCell<ICFBamPopDepObj, Long>>() { @Override public TableCell<ICFBamPopDepObj, Long> call(TableColumn<ICFBamPopDepObj, Long> arg) { return new CFInt64TableCell<ICFBamPopDepObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnLookupRelation = new TableColumn<ICFBamPopDepObj, ICFBamRelationObj>("Relation"); tableColumnLookupRelation.setCellValueFactory( new Callback<CellDataFeatures<ICFBamPopDepObj, ICFBamRelationObj>, ObservableValue<ICFBamRelationObj>>() { public ObservableValue<ICFBamRelationObj> call( CellDataFeatures<ICFBamPopDepObj, ICFBamRelationObj> p) { ICFBamPopDepObj 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<ICFBamPopDepObj, ICFBamRelationObj>, TableCell<ICFBamPopDepObj, ICFBamRelationObj>>() { @Override public TableCell<ICFBamPopDepObj, ICFBamRelationObj> call( TableColumn<ICFBamPopDepObj, ICFBamRelationObj> arg) { return new CFReferenceTableCell<ICFBamPopDepObj, ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnLookupRelation); tableColumnLookupDefSchema = new TableColumn<ICFBamPopDepObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamPopDepObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamPopDepObj, ICFBamSchemaDefObj> p) { ICFBamPopDepObj 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<ICFBamPopDepObj, ICFBamSchemaDefObj>, TableCell<ICFBamPopDepObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamPopDepObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamPopDepObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamPopDepObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamPopDepObj>() { @Override public void changed(ObservableValue<? extends ICFBamPopDepObj> observable, ICFBamPopDepObj oldValue, ICFBamPopDepObj 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 (observableListOfPopDep != null) { dataTable.setItems(observableListOfPopDep); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXTimestampDefPickerPane.java
public CFBamJavaFXTimestampDefPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamTimestampDefObj argFocus, ICFBamScopeObj argContainer, Collection<ICFBamTimestampDefObj> argDataCollection, ICFBamJavaFXTimestampDefChosen whenChosen) { super();//from www. j a v a2s . 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<ICFBamTimestampDefObj>(); tableColumnObjKind = new TableColumn<ICFBamTimestampDefObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampDefObj, String> p) { ICFBamTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String classCode = obj.getClassCode(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(classCode); return (observable); } } }); tableColumnObjKind.setCellFactory( new Callback<TableColumn<ICFBamTimestampDefObj, String>, TableCell<ICFBamTimestampDefObj, String>>() { @Override public TableCell<ICFBamTimestampDefObj, String> call( TableColumn<ICFBamTimestampDefObj, String> arg) { return new CFStringTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamTimestampDefObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamTimestampDefObj, Long> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { long value = obj.getRequiredId(); Long wrapped = new Long(value); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(wrapped); return (observable); } } }); tableColumnId.setCellFactory( new Callback<TableColumn<ICFBamTimestampDefObj, Long>, TableCell<ICFBamTimestampDefObj, Long>>() { @Override public TableCell<ICFBamTimestampDefObj, Long> call( TableColumn<ICFBamTimestampDefObj, Long> arg) { return new CFInt64TableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamTimestampDefObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampDefObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getRequiredName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnName.setCellFactory( new Callback<TableColumn<ICFBamTimestampDefObj, String>, TableCell<ICFBamTimestampDefObj, String>>() { @Override public TableCell<ICFBamTimestampDefObj, String> call( TableColumn<ICFBamTimestampDefObj, String> arg) { return new CFStringTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamTimestampDefObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampDefObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortName.setCellFactory( new Callback<TableColumn<ICFBamTimestampDefObj, String>, TableCell<ICFBamTimestampDefObj, String>>() { @Override public TableCell<ICFBamTimestampDefObj, String> call( TableColumn<ICFBamTimestampDefObj, String> arg) { return new CFStringTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamTimestampDefObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampDefObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalLabel(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnLabel.setCellFactory( new Callback<TableColumn<ICFBamTimestampDefObj, String>, TableCell<ICFBamTimestampDefObj, String>>() { @Override public TableCell<ICFBamTimestampDefObj, String> call( TableColumn<ICFBamTimestampDefObj, String> arg) { return new CFStringTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamTimestampDefObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampDefObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortDescription.setCellFactory( new Callback<TableColumn<ICFBamTimestampDefObj, String>, TableCell<ICFBamTimestampDefObj, String>>() { @Override public TableCell<ICFBamTimestampDefObj, String> call( TableColumn<ICFBamTimestampDefObj, String> arg) { return new CFStringTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamTimestampDefObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampDefObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDescription.setCellFactory( new Callback<TableColumn<ICFBamTimestampDefObj, String>, TableCell<ICFBamTimestampDefObj, String>>() { @Override public TableCell<ICFBamTimestampDefObj, String> call( TableColumn<ICFBamTimestampDefObj, String> arg) { return new CFStringTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamTimestampDefObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimestampDefObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredIsNullable(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnIsNullable.setCellFactory( new Callback<TableColumn<ICFBamTimestampDefObj, Boolean>, TableCell<ICFBamTimestampDefObj, Boolean>>() { @Override public TableCell<ICFBamTimestampDefObj, Boolean> call( TableColumn<ICFBamTimestampDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamTimestampDefObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimestampDefObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { Boolean value = obj.getOptionalGenerateId(); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(value); return (observable); } } }); tableColumnGenerateId.setCellFactory( new Callback<TableColumn<ICFBamTimestampDefObj, Boolean>, TableCell<ICFBamTimestampDefObj, Boolean>>() { @Override public TableCell<ICFBamTimestampDefObj, Boolean> call( TableColumn<ICFBamTimestampDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamTimestampDefObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimestampDefObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredDefaultVisibility(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnDefaultVisibility.setCellFactory( new Callback<TableColumn<ICFBamTimestampDefObj, Boolean>, TableCell<ICFBamTimestampDefObj, Boolean>>() { @Override public TableCell<ICFBamTimestampDefObj, Boolean> call( TableColumn<ICFBamTimestampDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamTimestampDefObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampDefObj, String> p) { ICFBamAtomObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDbName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDbName.setCellFactory( new Callback<TableColumn<ICFBamTimestampDefObj, String>, TableCell<ICFBamTimestampDefObj, String>>() { @Override public TableCell<ICFBamTimestampDefObj, String> call( TableColumn<ICFBamTimestampDefObj, String> arg) { return new CFStringTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamTimestampDefObj, Calendar>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampDefObj, Calendar> p) { ICFBamTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamTimestampDefObj, Calendar>, TableCell<ICFBamTimestampDefObj, Calendar>>() { @Override public TableCell<ICFBamTimestampDefObj, Calendar> call( TableColumn<ICFBamTimestampDefObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamTimestampDefObj, Calendar>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampDefObj, Calendar> p) { ICFBamTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamTimestampDefObj, Calendar>, TableCell<ICFBamTimestampDefObj, Calendar>>() { @Override public TableCell<ICFBamTimestampDefObj, Calendar> call( TableColumn<ICFBamTimestampDefObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamTimestampDefObj, Calendar>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampDefObj, Calendar> p) { ICFBamTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalMinValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnMinValue.setCellFactory( new Callback<TableColumn<ICFBamTimestampDefObj, Calendar>, TableCell<ICFBamTimestampDefObj, Calendar>>() { @Override public TableCell<ICFBamTimestampDefObj, Calendar> call( TableColumn<ICFBamTimestampDefObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamTimestampDefObj, Calendar>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampDefObj, Calendar> p) { ICFBamTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalMaxValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnMaxValue.setCellFactory( new Callback<TableColumn<ICFBamTimestampDefObj, Calendar>, TableCell<ICFBamTimestampDefObj, Calendar>>() { @Override public TableCell<ICFBamTimestampDefObj, Calendar> call( TableColumn<ICFBamTimestampDefObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamTimestampDefObj, Calendar>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampDefObj, Calendar> p) { ICFBamTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamTimestampDefObj, Calendar>, TableCell<ICFBamTimestampDefObj, Calendar>>() { @Override public TableCell<ICFBamTimestampDefObj, Calendar> call( TableColumn<ICFBamTimestampDefObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamTimestampDefObj, Calendar>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampDefObj, Calendar> p) { ICFBamTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamTimestampDefObj, Calendar>, TableCell<ICFBamTimestampDefObj, Calendar>>() { @Override public TableCell<ICFBamTimestampDefObj, Calendar> call( TableColumn<ICFBamTimestampDefObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampDefObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamTimestampDefObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampDefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamTimestampDefObj, ICFBamSchemaDefObj> p) { ICFBamTimestampDefObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema(); ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupDefSchema.setCellFactory( new Callback<TableColumn<ICFBamTimestampDefObj, ICFBamSchemaDefObj>, TableCell<ICFBamTimestampDefObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamTimestampDefObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamTimestampDefObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamTimestampDefObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty() .addListener(new ChangeListener<ICFBamTimestampDefObj>() { @Override public void changed(ObservableValue<? extends ICFBamTimestampDefObj> observable, ICFBamTimestampDefObj oldValue, ICFBamTimestampDefObj newValue) { setJavaFXFocus(newValue); 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.choseTimestampDef(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"); } ICFBamTimestampDefObj selectedInstance = getJavaFXFocusAsTimestampDef(); invokeWhenChosen.choseTimestampDef(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); }