List of usage examples for javafx.event ActionEvent getSource
public Object getSource()
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXStringTypePickerPane.java
public CFBamJavaFXStringTypePickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamStringTypeObj argFocus, ICFBamSchemaDefObj argContainer, Collection<ICFBamStringTypeObj> argDataCollection, ICFBamJavaFXStringTypeChosen whenChosen) { super();/*from w w w .j a va 2 s . c om*/ final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } 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<ICFBamStringTypeObj>(); tableColumnId = new TableColumn<ICFBamStringTypeObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamStringTypeObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamStringTypeObj, 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<ICFBamStringTypeObj, Long>, TableCell<ICFBamStringTypeObj, Long>>() { @Override public TableCell<ICFBamStringTypeObj, Long> call(TableColumn<ICFBamStringTypeObj, Long> arg) { return new CFInt64TableCell<ICFBamStringTypeObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamStringTypeObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamStringTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamStringTypeObj, 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<ICFBamStringTypeObj, String>, TableCell<ICFBamStringTypeObj, String>>() { @Override public TableCell<ICFBamStringTypeObj, String> call( TableColumn<ICFBamStringTypeObj, String> arg) { return new CFStringTableCell<ICFBamStringTypeObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamStringTypeObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamStringTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamStringTypeObj, 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<ICFBamStringTypeObj, String>, TableCell<ICFBamStringTypeObj, String>>() { @Override public TableCell<ICFBamStringTypeObj, String> call( TableColumn<ICFBamStringTypeObj, String> arg) { return new CFStringTableCell<ICFBamStringTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamStringTypeObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamStringTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamStringTypeObj, 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<ICFBamStringTypeObj, String>, TableCell<ICFBamStringTypeObj, String>>() { @Override public TableCell<ICFBamStringTypeObj, String> call( TableColumn<ICFBamStringTypeObj, String> arg) { return new CFStringTableCell<ICFBamStringTypeObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamStringTypeObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamStringTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamStringTypeObj, 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<ICFBamStringTypeObj, String>, TableCell<ICFBamStringTypeObj, String>>() { @Override public TableCell<ICFBamStringTypeObj, String> call( TableColumn<ICFBamStringTypeObj, String> arg) { return new CFStringTableCell<ICFBamStringTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamStringTypeObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamStringTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamStringTypeObj, 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<ICFBamStringTypeObj, String>, TableCell<ICFBamStringTypeObj, String>>() { @Override public TableCell<ICFBamStringTypeObj, String> call( TableColumn<ICFBamStringTypeObj, String> arg) { return new CFStringTableCell<ICFBamStringTypeObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamStringTypeObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamStringTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamStringTypeObj, 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<ICFBamStringTypeObj, Boolean>, TableCell<ICFBamStringTypeObj, Boolean>>() { @Override public TableCell<ICFBamStringTypeObj, Boolean> call( TableColumn<ICFBamStringTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamStringTypeObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamStringTypeObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamStringTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamStringTypeObj, 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<ICFBamStringTypeObj, Boolean>, TableCell<ICFBamStringTypeObj, Boolean>>() { @Override public TableCell<ICFBamStringTypeObj, Boolean> call( TableColumn<ICFBamStringTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamStringTypeObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamStringTypeObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamStringTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamStringTypeObj, 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<ICFBamStringTypeObj, Boolean>, TableCell<ICFBamStringTypeObj, Boolean>>() { @Override public TableCell<ICFBamStringTypeObj, Boolean> call( TableColumn<ICFBamStringTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamStringTypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamStringTypeObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamStringTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamStringTypeObj, 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<ICFBamStringTypeObj, String>, TableCell<ICFBamStringTypeObj, String>>() { @Override public TableCell<ICFBamStringTypeObj, String> call( TableColumn<ICFBamStringTypeObj, String> arg) { return new CFStringTableCell<ICFBamStringTypeObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnMaxLen = new TableColumn<ICFBamStringTypeObj, Integer>("Max. Length"); tableColumnMaxLen.setCellValueFactory( new Callback<CellDataFeatures<ICFBamStringTypeObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamStringTypeObj, Integer> p) { ICFBamStringDefObj 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<ICFBamStringTypeObj, Integer>, TableCell<ICFBamStringTypeObj, Integer>>() { @Override public TableCell<ICFBamStringTypeObj, Integer> call( TableColumn<ICFBamStringTypeObj, Integer> arg) { return new CFInt32TableCell<ICFBamStringTypeObj>(); } }); dataTable.getColumns().add(tableColumnMaxLen); tableColumnShowLines = new TableColumn<ICFBamStringTypeObj, Short>("Show Lines"); tableColumnShowLines.setCellValueFactory( new Callback<CellDataFeatures<ICFBamStringTypeObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamStringTypeObj, Short> p) { ICFBamStringDefObj 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<ICFBamStringTypeObj, Short>, TableCell<ICFBamStringTypeObj, Short>>() { @Override public TableCell<ICFBamStringTypeObj, Short> call(TableColumn<ICFBamStringTypeObj, Short> arg) { return new CFInt16TableCell<ICFBamStringTypeObj>(); } }); dataTable.getColumns().add(tableColumnShowLines); tableColumnInitValue = new TableColumn<ICFBamStringTypeObj, String>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamStringTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamStringTypeObj, String> p) { ICFBamStringDefObj 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<ICFBamStringTypeObj, String>, TableCell<ICFBamStringTypeObj, String>>() { @Override public TableCell<ICFBamStringTypeObj, String> call( TableColumn<ICFBamStringTypeObj, String> arg) { return new CFStringTableCell<ICFBamStringTypeObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamStringTypeObj, String>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamStringTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamStringTypeObj, String> p) { ICFBamStringDefObj 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<ICFBamStringTypeObj, String>, TableCell<ICFBamStringTypeObj, String>>() { @Override public TableCell<ICFBamStringTypeObj, String> call( TableColumn<ICFBamStringTypeObj, String> arg) { return new CFStringTableCell<ICFBamStringTypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnNullValue = new TableColumn<ICFBamStringTypeObj, String>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamStringTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamStringTypeObj, String> p) { ICFBamStringDefObj 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<ICFBamStringTypeObj, String>, TableCell<ICFBamStringTypeObj, String>>() { @Override public TableCell<ICFBamStringTypeObj, String> call( TableColumn<ICFBamStringTypeObj, String> arg) { return new CFStringTableCell<ICFBamStringTypeObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamStringTypeObj, String>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamStringTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamStringTypeObj, String> p) { ICFBamStringDefObj 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<ICFBamStringTypeObj, String>, TableCell<ICFBamStringTypeObj, String>>() { @Override public TableCell<ICFBamStringTypeObj, String> call( TableColumn<ICFBamStringTypeObj, String> arg) { return new CFStringTableCell<ICFBamStringTypeObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamStringTypeObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamStringTypeObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamStringTypeObj, ICFBamSchemaDefObj> p) { ICFBamStringTypeObj 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<ICFBamStringTypeObj, ICFBamSchemaDefObj>, TableCell<ICFBamStringTypeObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamStringTypeObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamStringTypeObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamStringTypeObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamStringTypeObj>() { @Override public void changed(ObservableValue<? extends ICFBamStringTypeObj> observable, ICFBamStringTypeObj oldValue, ICFBamStringTypeObj 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.choseStringType(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"); } ICFBamStringTypeObj selectedInstance = getJavaFXFocusAsStringType(); invokeWhenChosen.choseStringType(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.CFBamJavaFXTimestampColPickerPane.java
public CFBamJavaFXTimestampColPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamTimestampColObj argFocus, ICFBamTableObj argContainer, Collection<ICFBamTimestampColObj> argDataCollection, ICFBamJavaFXTimestampColChosen whenChosen) { super();//w ww .ja v a 2 s . co m final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } 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<ICFBamTimestampColObj>(); tableColumnId = new TableColumn<ICFBamTimestampColObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamTimestampColObj, 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<ICFBamTimestampColObj, Long>, TableCell<ICFBamTimestampColObj, Long>>() { @Override public TableCell<ICFBamTimestampColObj, Long> call( TableColumn<ICFBamTimestampColObj, Long> arg) { return new CFInt64TableCell<ICFBamTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamTimestampColObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampColObj, 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<ICFBamTimestampColObj, String>, TableCell<ICFBamTimestampColObj, String>>() { @Override public TableCell<ICFBamTimestampColObj, String> call( TableColumn<ICFBamTimestampColObj, String> arg) { return new CFStringTableCell<ICFBamTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamTimestampColObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampColObj, 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<ICFBamTimestampColObj, String>, TableCell<ICFBamTimestampColObj, String>>() { @Override public TableCell<ICFBamTimestampColObj, String> call( TableColumn<ICFBamTimestampColObj, String> arg) { return new CFStringTableCell<ICFBamTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamTimestampColObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampColObj, 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<ICFBamTimestampColObj, String>, TableCell<ICFBamTimestampColObj, String>>() { @Override public TableCell<ICFBamTimestampColObj, String> call( TableColumn<ICFBamTimestampColObj, String> arg) { return new CFStringTableCell<ICFBamTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamTimestampColObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampColObj, 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<ICFBamTimestampColObj, String>, TableCell<ICFBamTimestampColObj, String>>() { @Override public TableCell<ICFBamTimestampColObj, String> call( TableColumn<ICFBamTimestampColObj, String> arg) { return new CFStringTableCell<ICFBamTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamTimestampColObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampColObj, 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<ICFBamTimestampColObj, String>, TableCell<ICFBamTimestampColObj, String>>() { @Override public TableCell<ICFBamTimestampColObj, String> call( TableColumn<ICFBamTimestampColObj, String> arg) { return new CFStringTableCell<ICFBamTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamTimestampColObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimestampColObj, 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<ICFBamTimestampColObj, Boolean>, TableCell<ICFBamTimestampColObj, Boolean>>() { @Override public TableCell<ICFBamTimestampColObj, Boolean> call( TableColumn<ICFBamTimestampColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamTimestampColObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimestampColObj, 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<ICFBamTimestampColObj, Boolean>, TableCell<ICFBamTimestampColObj, Boolean>>() { @Override public TableCell<ICFBamTimestampColObj, Boolean> call( TableColumn<ICFBamTimestampColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamTimestampColObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimestampColObj, 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<ICFBamTimestampColObj, Boolean>, TableCell<ICFBamTimestampColObj, Boolean>>() { @Override public TableCell<ICFBamTimestampColObj, Boolean> call( TableColumn<ICFBamTimestampColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamTimestampColObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampColObj, 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<ICFBamTimestampColObj, String>, TableCell<ICFBamTimestampColObj, String>>() { @Override public TableCell<ICFBamTimestampColObj, String> call( TableColumn<ICFBamTimestampColObj, String> arg) { return new CFStringTableCell<ICFBamTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamTimestampColObj, Calendar>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampColObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampColObj, 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<ICFBamTimestampColObj, Calendar>, TableCell<ICFBamTimestampColObj, Calendar>>() { @Override public TableCell<ICFBamTimestampColObj, Calendar> call( TableColumn<ICFBamTimestampColObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamTimestampColObj, Calendar>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampColObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampColObj, 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<ICFBamTimestampColObj, Calendar>, TableCell<ICFBamTimestampColObj, Calendar>>() { @Override public TableCell<ICFBamTimestampColObj, Calendar> call( TableColumn<ICFBamTimestampColObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamTimestampColObj, Calendar>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampColObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampColObj, 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<ICFBamTimestampColObj, Calendar>, TableCell<ICFBamTimestampColObj, Calendar>>() { @Override public TableCell<ICFBamTimestampColObj, Calendar> call( TableColumn<ICFBamTimestampColObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamTimestampColObj, Calendar>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampColObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampColObj, 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<ICFBamTimestampColObj, Calendar>, TableCell<ICFBamTimestampColObj, Calendar>>() { @Override public TableCell<ICFBamTimestampColObj, Calendar> call( TableColumn<ICFBamTimestampColObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamTimestampColObj, Calendar>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampColObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampColObj, 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<ICFBamTimestampColObj, Calendar>, TableCell<ICFBamTimestampColObj, Calendar>>() { @Override public TableCell<ICFBamTimestampColObj, Calendar> call( TableColumn<ICFBamTimestampColObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamTimestampColObj, Calendar>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampColObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampColObj, 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<ICFBamTimestampColObj, Calendar>, TableCell<ICFBamTimestampColObj, Calendar>>() { @Override public TableCell<ICFBamTimestampColObj, Calendar> call( TableColumn<ICFBamTimestampColObj, Calendar> arg) { return new CFTimestampTableCell<ICFBamTimestampColObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamTimestampColObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTimestampColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamTimestampColObj, ICFBamSchemaDefObj> p) { ICFBamTimestampColObj 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<ICFBamTimestampColObj, ICFBamSchemaDefObj>, TableCell<ICFBamTimestampColObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamTimestampColObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamTimestampColObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamTimestampColObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty() .addListener(new ChangeListener<ICFBamTimestampColObj>() { @Override public void changed(ObservableValue<? extends ICFBamTimestampColObj> observable, ICFBamTimestampColObj oldValue, ICFBamTimestampColObj 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.choseTimestampCol(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"); } ICFBamTimestampColObj selectedInstance = getJavaFXFocusAsTimestampCol(); invokeWhenChosen.choseTimestampCol(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.CFBamJavaFXTimestampTypePickerPane.java
public CFBamJavaFXTimestampTypePickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamTimestampTypeObj argFocus, ICFBamSchemaDefObj argContainer, Collection<ICFBamTimestampTypeObj> argDataCollection, ICFBamJavaFXTimestampTypeChosen whenChosen) { super();/* ww w .j a v a 2 s . c o m*/ final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } if (whenChosen == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6, "whenChosen"); } invokeWhenChosen = whenChosen; // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<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.CFBamJavaFXTZTimestampColPickerPane.java
public CFBamJavaFXTZTimestampColPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamTZTimestampColObj argFocus, ICFBamTableObj argContainer, Collection<ICFBamTZTimestampColObj> argDataCollection, ICFBamJavaFXTZTimestampColChosen whenChosen) { super();/*from ww w . j av a 2 s .co m*/ final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } if (whenChosen == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6, "whenChosen"); } invokeWhenChosen = whenChosen; // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<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.CFBamJavaFXTZTimestampTypePickerPane.java
public CFBamJavaFXTZTimestampTypePickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamTZTimestampTypeObj argFocus, ICFBamSchemaDefObj argContainer, Collection<ICFBamTZTimestampTypeObj> argDataCollection, ICFBamJavaFXTZTimestampTypeChosen whenChosen) { super();// w w w .jav 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<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.CFBamJavaFXNmTokensColPickerPane.java
public CFBamJavaFXNmTokensColPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamNmTokensColObj argFocus, ICFBamTableObj argContainer, Collection<ICFBamNmTokensColObj> argDataCollection, ICFBamJavaFXNmTokensColChosen whenChosen) { super();//w ww.j av a2s. 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"); } 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<ICFBamNmTokensColObj>(); tableColumnId = new TableColumn<ICFBamNmTokensColObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamNmTokensColObj, 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<ICFBamNmTokensColObj, Long>, TableCell<ICFBamNmTokensColObj, Long>>() { @Override public TableCell<ICFBamNmTokensColObj, Long> call(TableColumn<ICFBamNmTokensColObj, Long> arg) { return new CFInt64TableCell<ICFBamNmTokensColObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamNmTokensColObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensColObj, 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<ICFBamNmTokensColObj, String>, TableCell<ICFBamNmTokensColObj, String>>() { @Override public TableCell<ICFBamNmTokensColObj, String> call( TableColumn<ICFBamNmTokensColObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensColObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamNmTokensColObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensColObj, 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<ICFBamNmTokensColObj, String>, TableCell<ICFBamNmTokensColObj, String>>() { @Override public TableCell<ICFBamNmTokensColObj, String> call( TableColumn<ICFBamNmTokensColObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensColObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamNmTokensColObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensColObj, 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<ICFBamNmTokensColObj, String>, TableCell<ICFBamNmTokensColObj, String>>() { @Override public TableCell<ICFBamNmTokensColObj, String> call( TableColumn<ICFBamNmTokensColObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensColObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamNmTokensColObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensColObj, 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<ICFBamNmTokensColObj, String>, TableCell<ICFBamNmTokensColObj, String>>() { @Override public TableCell<ICFBamNmTokensColObj, String> call( TableColumn<ICFBamNmTokensColObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensColObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamNmTokensColObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensColObj, 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<ICFBamNmTokensColObj, String>, TableCell<ICFBamNmTokensColObj, String>>() { @Override public TableCell<ICFBamNmTokensColObj, String> call( TableColumn<ICFBamNmTokensColObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensColObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamNmTokensColObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokensColObj, 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<ICFBamNmTokensColObj, Boolean>, TableCell<ICFBamNmTokensColObj, Boolean>>() { @Override public TableCell<ICFBamNmTokensColObj, Boolean> call( TableColumn<ICFBamNmTokensColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokensColObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamNmTokensColObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokensColObj, 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<ICFBamNmTokensColObj, Boolean>, TableCell<ICFBamNmTokensColObj, Boolean>>() { @Override public TableCell<ICFBamNmTokensColObj, Boolean> call( TableColumn<ICFBamNmTokensColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokensColObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamNmTokensColObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokensColObj, 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<ICFBamNmTokensColObj, Boolean>, TableCell<ICFBamNmTokensColObj, Boolean>>() { @Override public TableCell<ICFBamNmTokensColObj, Boolean> call( TableColumn<ICFBamNmTokensColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokensColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamNmTokensColObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensColObj, 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<ICFBamNmTokensColObj, String>, TableCell<ICFBamNmTokensColObj, String>>() { @Override public TableCell<ICFBamNmTokensColObj, String> call( TableColumn<ICFBamNmTokensColObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensColObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnMaxLen = new TableColumn<ICFBamNmTokensColObj, Integer>("Max. Length"); tableColumnMaxLen.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensColObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamNmTokensColObj, 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<ICFBamNmTokensColObj, Integer>, TableCell<ICFBamNmTokensColObj, Integer>>() { @Override public TableCell<ICFBamNmTokensColObj, Integer> call( TableColumn<ICFBamNmTokensColObj, Integer> arg) { return new CFInt32TableCell<ICFBamNmTokensColObj>(); } }); dataTable.getColumns().add(tableColumnMaxLen); tableColumnInitValue = new TableColumn<ICFBamNmTokensColObj, String>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensColObj, 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<ICFBamNmTokensColObj, String>, TableCell<ICFBamNmTokensColObj, String>>() { @Override public TableCell<ICFBamNmTokensColObj, String> call( TableColumn<ICFBamNmTokensColObj, String> arg) { return new CFNmTokensTableCell<ICFBamNmTokensColObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamNmTokensColObj, String>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensColObj, 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<ICFBamNmTokensColObj, String>, TableCell<ICFBamNmTokensColObj, String>>() { @Override public TableCell<ICFBamNmTokensColObj, String> call( TableColumn<ICFBamNmTokensColObj, String> arg) { return new CFNmTokensTableCell<ICFBamNmTokensColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnNullValue = new TableColumn<ICFBamNmTokensColObj, String>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensColObj, 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<ICFBamNmTokensColObj, String>, TableCell<ICFBamNmTokensColObj, String>>() { @Override public TableCell<ICFBamNmTokensColObj, String> call( TableColumn<ICFBamNmTokensColObj, String> arg) { return new CFNmTokensTableCell<ICFBamNmTokensColObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamNmTokensColObj, String>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensColObj, 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<ICFBamNmTokensColObj, String>, TableCell<ICFBamNmTokensColObj, String>>() { @Override public TableCell<ICFBamNmTokensColObj, String> call( TableColumn<ICFBamNmTokensColObj, String> arg) { return new CFNmTokensTableCell<ICFBamNmTokensColObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnShowLines = new TableColumn<ICFBamNmTokensColObj, Short>("Show Lines"); tableColumnShowLines.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensColObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamNmTokensColObj, 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<ICFBamNmTokensColObj, Short>, TableCell<ICFBamNmTokensColObj, Short>>() { @Override public TableCell<ICFBamNmTokensColObj, Short> call( TableColumn<ICFBamNmTokensColObj, Short> arg) { return new CFInt16TableCell<ICFBamNmTokensColObj>(); } }); dataTable.getColumns().add(tableColumnShowLines); tableColumnLookupDefSchema = new TableColumn<ICFBamNmTokensColObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamNmTokensColObj, ICFBamSchemaDefObj> p) { ICFBamNmTokensColObj 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<ICFBamNmTokensColObj, ICFBamSchemaDefObj>, TableCell<ICFBamNmTokensColObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamNmTokensColObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamNmTokensColObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamNmTokensColObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty() .addListener(new ChangeListener<ICFBamNmTokensColObj>() { @Override public void changed(ObservableValue<? extends ICFBamNmTokensColObj> observable, ICFBamNmTokensColObj oldValue, ICFBamNmTokensColObj 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.choseNmTokensCol(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"); } ICFBamNmTokensColObj selectedInstance = getJavaFXFocusAsNmTokensCol(); invokeWhenChosen.choseNmTokensCol(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.CFBamJavaFXNmTokenTypePickerPane.java
public CFBamJavaFXNmTokenTypePickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamNmTokenTypeObj argFocus, ICFBamSchemaDefObj argContainer, Collection<ICFBamNmTokenTypeObj> argDataCollection, ICFBamJavaFXNmTokenTypeChosen whenChosen) { super();/*w w w. j a v a 2 s. c om*/ final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } 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<ICFBamNmTokenTypeObj>(); tableColumnId = new TableColumn<ICFBamNmTokenTypeObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenTypeObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamNmTokenTypeObj, 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<ICFBamNmTokenTypeObj, Long>, TableCell<ICFBamNmTokenTypeObj, Long>>() { @Override public TableCell<ICFBamNmTokenTypeObj, Long> call(TableColumn<ICFBamNmTokenTypeObj, Long> arg) { return new CFInt64TableCell<ICFBamNmTokenTypeObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamNmTokenTypeObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenTypeObj, 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<ICFBamNmTokenTypeObj, String>, TableCell<ICFBamNmTokenTypeObj, String>>() { @Override public TableCell<ICFBamNmTokenTypeObj, String> call( TableColumn<ICFBamNmTokenTypeObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenTypeObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamNmTokenTypeObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenTypeObj, 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<ICFBamNmTokenTypeObj, String>, TableCell<ICFBamNmTokenTypeObj, String>>() { @Override public TableCell<ICFBamNmTokenTypeObj, String> call( TableColumn<ICFBamNmTokenTypeObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamNmTokenTypeObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenTypeObj, 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<ICFBamNmTokenTypeObj, String>, TableCell<ICFBamNmTokenTypeObj, String>>() { @Override public TableCell<ICFBamNmTokenTypeObj, String> call( TableColumn<ICFBamNmTokenTypeObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenTypeObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamNmTokenTypeObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenTypeObj, 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<ICFBamNmTokenTypeObj, String>, TableCell<ICFBamNmTokenTypeObj, String>>() { @Override public TableCell<ICFBamNmTokenTypeObj, String> call( TableColumn<ICFBamNmTokenTypeObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamNmTokenTypeObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenTypeObj, 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<ICFBamNmTokenTypeObj, String>, TableCell<ICFBamNmTokenTypeObj, String>>() { @Override public TableCell<ICFBamNmTokenTypeObj, String> call( TableColumn<ICFBamNmTokenTypeObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenTypeObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamNmTokenTypeObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokenTypeObj, 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<ICFBamNmTokenTypeObj, Boolean>, TableCell<ICFBamNmTokenTypeObj, Boolean>>() { @Override public TableCell<ICFBamNmTokenTypeObj, Boolean> call( TableColumn<ICFBamNmTokenTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokenTypeObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamNmTokenTypeObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokenTypeObj, 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<ICFBamNmTokenTypeObj, Boolean>, TableCell<ICFBamNmTokenTypeObj, Boolean>>() { @Override public TableCell<ICFBamNmTokenTypeObj, Boolean> call( TableColumn<ICFBamNmTokenTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokenTypeObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamNmTokenTypeObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokenTypeObj, 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<ICFBamNmTokenTypeObj, Boolean>, TableCell<ICFBamNmTokenTypeObj, Boolean>>() { @Override public TableCell<ICFBamNmTokenTypeObj, Boolean> call( TableColumn<ICFBamNmTokenTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokenTypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamNmTokenTypeObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenTypeObj, 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<ICFBamNmTokenTypeObj, String>, TableCell<ICFBamNmTokenTypeObj, String>>() { @Override public TableCell<ICFBamNmTokenTypeObj, String> call( TableColumn<ICFBamNmTokenTypeObj, String> arg) { return new CFStringTableCell<ICFBamNmTokenTypeObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnMaxLen = new TableColumn<ICFBamNmTokenTypeObj, Integer>("Max. Length"); tableColumnMaxLen.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenTypeObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamNmTokenTypeObj, 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<ICFBamNmTokenTypeObj, Integer>, TableCell<ICFBamNmTokenTypeObj, Integer>>() { @Override public TableCell<ICFBamNmTokenTypeObj, Integer> call( TableColumn<ICFBamNmTokenTypeObj, Integer> arg) { return new CFInt32TableCell<ICFBamNmTokenTypeObj>(); } }); dataTable.getColumns().add(tableColumnMaxLen); tableColumnInitValue = new TableColumn<ICFBamNmTokenTypeObj, String>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenTypeObj, 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<ICFBamNmTokenTypeObj, String>, TableCell<ICFBamNmTokenTypeObj, String>>() { @Override public TableCell<ICFBamNmTokenTypeObj, String> call( TableColumn<ICFBamNmTokenTypeObj, String> arg) { return new CFNmTokenTableCell<ICFBamNmTokenTypeObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamNmTokenTypeObj, String>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenTypeObj, 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<ICFBamNmTokenTypeObj, String>, TableCell<ICFBamNmTokenTypeObj, String>>() { @Override public TableCell<ICFBamNmTokenTypeObj, String> call( TableColumn<ICFBamNmTokenTypeObj, String> arg) { return new CFNmTokenTableCell<ICFBamNmTokenTypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnNullValue = new TableColumn<ICFBamNmTokenTypeObj, String>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenTypeObj, 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<ICFBamNmTokenTypeObj, String>, TableCell<ICFBamNmTokenTypeObj, String>>() { @Override public TableCell<ICFBamNmTokenTypeObj, String> call( TableColumn<ICFBamNmTokenTypeObj, String> arg) { return new CFNmTokenTableCell<ICFBamNmTokenTypeObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamNmTokenTypeObj, String>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokenTypeObj, 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<ICFBamNmTokenTypeObj, String>, TableCell<ICFBamNmTokenTypeObj, String>>() { @Override public TableCell<ICFBamNmTokenTypeObj, String> call( TableColumn<ICFBamNmTokenTypeObj, String> arg) { return new CFNmTokenTableCell<ICFBamNmTokenTypeObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnShowLines = new TableColumn<ICFBamNmTokenTypeObj, Short>("Show Lines"); tableColumnShowLines.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenTypeObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamNmTokenTypeObj, 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<ICFBamNmTokenTypeObj, Short>, TableCell<ICFBamNmTokenTypeObj, Short>>() { @Override public TableCell<ICFBamNmTokenTypeObj, Short> call( TableColumn<ICFBamNmTokenTypeObj, Short> arg) { return new CFInt16TableCell<ICFBamNmTokenTypeObj>(); } }); dataTable.getColumns().add(tableColumnShowLines); tableColumnLookupDefSchema = new TableColumn<ICFBamNmTokenTypeObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokenTypeObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamNmTokenTypeObj, ICFBamSchemaDefObj> p) { ICFBamNmTokenTypeObj 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<ICFBamNmTokenTypeObj, ICFBamSchemaDefObj>, TableCell<ICFBamNmTokenTypeObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamNmTokenTypeObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamNmTokenTypeObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamNmTokenTypeObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty() .addListener(new ChangeListener<ICFBamNmTokenTypeObj>() { @Override public void changed(ObservableValue<? extends ICFBamNmTokenTypeObj> observable, ICFBamNmTokenTypeObj oldValue, ICFBamNmTokenTypeObj 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.choseNmTokenType(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"); } ICFBamNmTokenTypeObj selectedInstance = getJavaFXFocusAsNmTokenType(); invokeWhenChosen.choseNmTokenType(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.CFBamJavaFXNmTokensTypePickerPane.java
public CFBamJavaFXNmTokensTypePickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamNmTokensTypeObj argFocus, ICFBamSchemaDefObj argContainer, Collection<ICFBamNmTokensTypeObj> argDataCollection, ICFBamJavaFXNmTokensTypeChosen whenChosen) { super();// w w w . j a v a 2 s. c o m final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } if (whenChosen == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6, "whenChosen"); } invokeWhenChosen = whenChosen; // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamNmTokensTypeObj>(); tableColumnId = new TableColumn<ICFBamNmTokensTypeObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensTypeObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamNmTokensTypeObj, 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<ICFBamNmTokensTypeObj, Long>, TableCell<ICFBamNmTokensTypeObj, Long>>() { @Override public TableCell<ICFBamNmTokensTypeObj, Long> call( TableColumn<ICFBamNmTokensTypeObj, Long> arg) { return new CFInt64TableCell<ICFBamNmTokensTypeObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamNmTokensTypeObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensTypeObj, 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<ICFBamNmTokensTypeObj, String>, TableCell<ICFBamNmTokensTypeObj, String>>() { @Override public TableCell<ICFBamNmTokensTypeObj, String> call( TableColumn<ICFBamNmTokensTypeObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensTypeObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamNmTokensTypeObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensTypeObj, 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<ICFBamNmTokensTypeObj, String>, TableCell<ICFBamNmTokensTypeObj, String>>() { @Override public TableCell<ICFBamNmTokensTypeObj, String> call( TableColumn<ICFBamNmTokensTypeObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamNmTokensTypeObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensTypeObj, 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<ICFBamNmTokensTypeObj, String>, TableCell<ICFBamNmTokensTypeObj, String>>() { @Override public TableCell<ICFBamNmTokensTypeObj, String> call( TableColumn<ICFBamNmTokensTypeObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensTypeObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamNmTokensTypeObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensTypeObj, 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<ICFBamNmTokensTypeObj, String>, TableCell<ICFBamNmTokensTypeObj, String>>() { @Override public TableCell<ICFBamNmTokensTypeObj, String> call( TableColumn<ICFBamNmTokensTypeObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamNmTokensTypeObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensTypeObj, 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<ICFBamNmTokensTypeObj, String>, TableCell<ICFBamNmTokensTypeObj, String>>() { @Override public TableCell<ICFBamNmTokensTypeObj, String> call( TableColumn<ICFBamNmTokensTypeObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensTypeObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamNmTokensTypeObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokensTypeObj, 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<ICFBamNmTokensTypeObj, Boolean>, TableCell<ICFBamNmTokensTypeObj, Boolean>>() { @Override public TableCell<ICFBamNmTokensTypeObj, Boolean> call( TableColumn<ICFBamNmTokensTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokensTypeObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamNmTokensTypeObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokensTypeObj, 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<ICFBamNmTokensTypeObj, Boolean>, TableCell<ICFBamNmTokensTypeObj, Boolean>>() { @Override public TableCell<ICFBamNmTokensTypeObj, Boolean> call( TableColumn<ICFBamNmTokensTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokensTypeObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamNmTokensTypeObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokensTypeObj, 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<ICFBamNmTokensTypeObj, Boolean>, TableCell<ICFBamNmTokensTypeObj, Boolean>>() { @Override public TableCell<ICFBamNmTokensTypeObj, Boolean> call( TableColumn<ICFBamNmTokensTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamNmTokensTypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamNmTokensTypeObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensTypeObj, 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<ICFBamNmTokensTypeObj, String>, TableCell<ICFBamNmTokensTypeObj, String>>() { @Override public TableCell<ICFBamNmTokensTypeObj, String> call( TableColumn<ICFBamNmTokensTypeObj, String> arg) { return new CFStringTableCell<ICFBamNmTokensTypeObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnMaxLen = new TableColumn<ICFBamNmTokensTypeObj, Integer>("Max. Length"); tableColumnMaxLen.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensTypeObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamNmTokensTypeObj, 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<ICFBamNmTokensTypeObj, Integer>, TableCell<ICFBamNmTokensTypeObj, Integer>>() { @Override public TableCell<ICFBamNmTokensTypeObj, Integer> call( TableColumn<ICFBamNmTokensTypeObj, Integer> arg) { return new CFInt32TableCell<ICFBamNmTokensTypeObj>(); } }); dataTable.getColumns().add(tableColumnMaxLen); tableColumnInitValue = new TableColumn<ICFBamNmTokensTypeObj, String>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensTypeObj, 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<ICFBamNmTokensTypeObj, String>, TableCell<ICFBamNmTokensTypeObj, String>>() { @Override public TableCell<ICFBamNmTokensTypeObj, String> call( TableColumn<ICFBamNmTokensTypeObj, String> arg) { return new CFNmTokensTableCell<ICFBamNmTokensTypeObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamNmTokensTypeObj, String>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensTypeObj, 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<ICFBamNmTokensTypeObj, String>, TableCell<ICFBamNmTokensTypeObj, String>>() { @Override public TableCell<ICFBamNmTokensTypeObj, String> call( TableColumn<ICFBamNmTokensTypeObj, String> arg) { return new CFNmTokensTableCell<ICFBamNmTokensTypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnNullValue = new TableColumn<ICFBamNmTokensTypeObj, String>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensTypeObj, 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<ICFBamNmTokensTypeObj, String>, TableCell<ICFBamNmTokensTypeObj, String>>() { @Override public TableCell<ICFBamNmTokensTypeObj, String> call( TableColumn<ICFBamNmTokensTypeObj, String> arg) { return new CFNmTokensTableCell<ICFBamNmTokensTypeObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamNmTokensTypeObj, String>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensTypeObj, 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<ICFBamNmTokensTypeObj, String>, TableCell<ICFBamNmTokensTypeObj, String>>() { @Override public TableCell<ICFBamNmTokensTypeObj, String> call( TableColumn<ICFBamNmTokensTypeObj, String> arg) { return new CFNmTokensTableCell<ICFBamNmTokensTypeObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnShowLines = new TableColumn<ICFBamNmTokensTypeObj, Short>("Show Lines"); tableColumnShowLines.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensTypeObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamNmTokensTypeObj, 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<ICFBamNmTokensTypeObj, Short>, TableCell<ICFBamNmTokensTypeObj, Short>>() { @Override public TableCell<ICFBamNmTokensTypeObj, Short> call( TableColumn<ICFBamNmTokensTypeObj, Short> arg) { return new CFInt16TableCell<ICFBamNmTokensTypeObj>(); } }); dataTable.getColumns().add(tableColumnShowLines); tableColumnLookupDefSchema = new TableColumn<ICFBamNmTokensTypeObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamNmTokensTypeObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamNmTokensTypeObj, ICFBamSchemaDefObj> p) { ICFBamNmTokensTypeObj 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<ICFBamNmTokensTypeObj, ICFBamSchemaDefObj>, TableCell<ICFBamNmTokensTypeObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamNmTokensTypeObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamNmTokensTypeObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamNmTokensTypeObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty() .addListener(new ChangeListener<ICFBamNmTokensTypeObj>() { @Override public void changed(ObservableValue<? extends ICFBamNmTokensTypeObj> observable, ICFBamNmTokensTypeObj oldValue, ICFBamNmTokensTypeObj 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.choseNmTokensType(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"); } ICFBamNmTokensTypeObj selectedInstance = getJavaFXFocusAsNmTokensType(); invokeWhenChosen.choseNmTokensType(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.CFBamJavaFXDateDefPickerPane.java
public CFBamJavaFXDateDefPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamDateDefObj argFocus, ICFBamScopeObj argContainer, Collection<ICFBamDateDefObj> argDataCollection, ICFBamJavaFXDateDefChosen whenChosen) { super();//from w ww . jav 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<ICFBamDateDefObj>(); tableColumnObjKind = new TableColumn<ICFBamDateDefObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateDefObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamDateDefObj, String> p) { ICFBamDateDefObj 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<ICFBamDateDefObj, String>, TableCell<ICFBamDateDefObj, String>>() { @Override public TableCell<ICFBamDateDefObj, String> call(TableColumn<ICFBamDateDefObj, String> arg) { return new CFStringTableCell<ICFBamDateDefObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamDateDefObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateDefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamDateDefObj, 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<ICFBamDateDefObj, Long>, TableCell<ICFBamDateDefObj, Long>>() { @Override public TableCell<ICFBamDateDefObj, Long> call(TableColumn<ICFBamDateDefObj, Long> arg) { return new CFInt64TableCell<ICFBamDateDefObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamDateDefObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamDateDefObj, 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<ICFBamDateDefObj, String>, TableCell<ICFBamDateDefObj, String>>() { @Override public TableCell<ICFBamDateDefObj, String> call(TableColumn<ICFBamDateDefObj, String> arg) { return new CFStringTableCell<ICFBamDateDefObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamDateDefObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamDateDefObj, 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<ICFBamDateDefObj, String>, TableCell<ICFBamDateDefObj, String>>() { @Override public TableCell<ICFBamDateDefObj, String> call(TableColumn<ICFBamDateDefObj, String> arg) { return new CFStringTableCell<ICFBamDateDefObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamDateDefObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamDateDefObj, 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<ICFBamDateDefObj, String>, TableCell<ICFBamDateDefObj, String>>() { @Override public TableCell<ICFBamDateDefObj, String> call(TableColumn<ICFBamDateDefObj, String> arg) { return new CFStringTableCell<ICFBamDateDefObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamDateDefObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamDateDefObj, 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<ICFBamDateDefObj, String>, TableCell<ICFBamDateDefObj, String>>() { @Override public TableCell<ICFBamDateDefObj, String> call(TableColumn<ICFBamDateDefObj, String> arg) { return new CFStringTableCell<ICFBamDateDefObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamDateDefObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamDateDefObj, 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<ICFBamDateDefObj, String>, TableCell<ICFBamDateDefObj, String>>() { @Override public TableCell<ICFBamDateDefObj, String> call(TableColumn<ICFBamDateDefObj, String> arg) { return new CFStringTableCell<ICFBamDateDefObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamDateDefObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamDateDefObj, 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<ICFBamDateDefObj, Boolean>, TableCell<ICFBamDateDefObj, Boolean>>() { @Override public TableCell<ICFBamDateDefObj, Boolean> call(TableColumn<ICFBamDateDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamDateDefObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamDateDefObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamDateDefObj, 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<ICFBamDateDefObj, Boolean>, TableCell<ICFBamDateDefObj, Boolean>>() { @Override public TableCell<ICFBamDateDefObj, Boolean> call(TableColumn<ICFBamDateDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamDateDefObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamDateDefObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamDateDefObj, 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<ICFBamDateDefObj, Boolean>, TableCell<ICFBamDateDefObj, Boolean>>() { @Override public TableCell<ICFBamDateDefObj, Boolean> call(TableColumn<ICFBamDateDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamDateDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamDateDefObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamDateDefObj, 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<ICFBamDateDefObj, String>, TableCell<ICFBamDateDefObj, String>>() { @Override public TableCell<ICFBamDateDefObj, String> call(TableColumn<ICFBamDateDefObj, String> arg) { return new CFStringTableCell<ICFBamDateDefObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamDateDefObj, Calendar>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamDateDefObj, Calendar> p) { ICFBamDateDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamDateDefObj, Calendar>, TableCell<ICFBamDateDefObj, Calendar>>() { @Override public TableCell<ICFBamDateDefObj, Calendar> call(TableColumn<ICFBamDateDefObj, Calendar> arg) { return new CFDateTableCell<ICFBamDateDefObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamDateDefObj, Calendar>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamDateDefObj, Calendar> p) { ICFBamDateDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamDateDefObj, Calendar>, TableCell<ICFBamDateDefObj, Calendar>>() { @Override public TableCell<ICFBamDateDefObj, Calendar> call(TableColumn<ICFBamDateDefObj, Calendar> arg) { return new CFDateTableCell<ICFBamDateDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamDateDefObj, Calendar>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamDateDefObj, Calendar> p) { ICFBamDateDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalMinValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnMinValue.setCellFactory( new Callback<TableColumn<ICFBamDateDefObj, Calendar>, TableCell<ICFBamDateDefObj, Calendar>>() { @Override public TableCell<ICFBamDateDefObj, Calendar> call(TableColumn<ICFBamDateDefObj, Calendar> arg) { return new CFDateTableCell<ICFBamDateDefObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamDateDefObj, Calendar>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamDateDefObj, Calendar> p) { ICFBamDateDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalMaxValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnMaxValue.setCellFactory( new Callback<TableColumn<ICFBamDateDefObj, Calendar>, TableCell<ICFBamDateDefObj, Calendar>>() { @Override public TableCell<ICFBamDateDefObj, Calendar> call(TableColumn<ICFBamDateDefObj, Calendar> arg) { return new CFDateTableCell<ICFBamDateDefObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamDateDefObj, Calendar>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamDateDefObj, Calendar> p) { ICFBamDateDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamDateDefObj, Calendar>, TableCell<ICFBamDateDefObj, Calendar>>() { @Override public TableCell<ICFBamDateDefObj, Calendar> call(TableColumn<ICFBamDateDefObj, Calendar> arg) { return new CFDateTableCell<ICFBamDateDefObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamDateDefObj, Calendar>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateDefObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamDateDefObj, Calendar> p) { ICFBamDateDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamDateDefObj, Calendar>, TableCell<ICFBamDateDefObj, Calendar>>() { @Override public TableCell<ICFBamDateDefObj, Calendar> call(TableColumn<ICFBamDateDefObj, Calendar> arg) { return new CFDateTableCell<ICFBamDateDefObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamDateDefObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDateDefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamDateDefObj, ICFBamSchemaDefObj> p) { ICFBamDateDefObj 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<ICFBamDateDefObj, ICFBamSchemaDefObj>, TableCell<ICFBamDateDefObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamDateDefObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamDateDefObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamDateDefObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamDateDefObj>() { @Override public void changed(ObservableValue<? extends ICFBamDateDefObj> observable, ICFBamDateDefObj oldValue, ICFBamDateDefObj 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.choseDateDef(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"); } ICFBamDateDefObj selectedInstance = getJavaFXFocusAsDateDef(); invokeWhenChosen.choseDateDef(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.CFBamJavaFXEnumDefPickerPane.java
public CFBamJavaFXEnumDefPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamEnumDefObj argFocus, ICFBamScopeObj argContainer, Collection<ICFBamEnumDefObj> argDataCollection, ICFBamJavaFXEnumDefChosen whenChosen) { super();/* w ww . 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"); } 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<ICFBamEnumDefObj>(); tableColumnObjKind = new TableColumn<ICFBamEnumDefObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamEnumDefObj, String> p) { ICFBamEnumDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String classCode = obj.getClassCode(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(classCode); return (observable); } } }); tableColumnObjKind.setCellFactory( new Callback<TableColumn<ICFBamEnumDefObj, String>, TableCell<ICFBamEnumDefObj, String>>() { @Override public TableCell<ICFBamEnumDefObj, String> call(TableColumn<ICFBamEnumDefObj, String> arg) { return new CFStringTableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamEnumDefObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamEnumDefObj, Long> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { long value = obj.getRequiredId(); Long wrapped = new Long(value); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(wrapped); return (observable); } } }); tableColumnId.setCellFactory( new Callback<TableColumn<ICFBamEnumDefObj, Long>, TableCell<ICFBamEnumDefObj, Long>>() { @Override public TableCell<ICFBamEnumDefObj, Long> call(TableColumn<ICFBamEnumDefObj, Long> arg) { return new CFInt64TableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamEnumDefObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamEnumDefObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getRequiredName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnName.setCellFactory( new Callback<TableColumn<ICFBamEnumDefObj, String>, TableCell<ICFBamEnumDefObj, String>>() { @Override public TableCell<ICFBamEnumDefObj, String> call(TableColumn<ICFBamEnumDefObj, String> arg) { return new CFStringTableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamEnumDefObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamEnumDefObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortName.setCellFactory( new Callback<TableColumn<ICFBamEnumDefObj, String>, TableCell<ICFBamEnumDefObj, String>>() { @Override public TableCell<ICFBamEnumDefObj, String> call(TableColumn<ICFBamEnumDefObj, String> arg) { return new CFStringTableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamEnumDefObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamEnumDefObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalLabel(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnLabel.setCellFactory( new Callback<TableColumn<ICFBamEnumDefObj, String>, TableCell<ICFBamEnumDefObj, String>>() { @Override public TableCell<ICFBamEnumDefObj, String> call(TableColumn<ICFBamEnumDefObj, String> arg) { return new CFStringTableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamEnumDefObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamEnumDefObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortDescription.setCellFactory( new Callback<TableColumn<ICFBamEnumDefObj, String>, TableCell<ICFBamEnumDefObj, String>>() { @Override public TableCell<ICFBamEnumDefObj, String> call(TableColumn<ICFBamEnumDefObj, String> arg) { return new CFStringTableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamEnumDefObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamEnumDefObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDescription.setCellFactory( new Callback<TableColumn<ICFBamEnumDefObj, String>, TableCell<ICFBamEnumDefObj, String>>() { @Override public TableCell<ICFBamEnumDefObj, String> call(TableColumn<ICFBamEnumDefObj, String> arg) { return new CFStringTableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamEnumDefObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamEnumDefObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredIsNullable(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnIsNullable.setCellFactory( new Callback<TableColumn<ICFBamEnumDefObj, Boolean>, TableCell<ICFBamEnumDefObj, Boolean>>() { @Override public TableCell<ICFBamEnumDefObj, Boolean> call(TableColumn<ICFBamEnumDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamEnumDefObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamEnumDefObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { Boolean value = obj.getOptionalGenerateId(); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(value); return (observable); } } }); tableColumnGenerateId.setCellFactory( new Callback<TableColumn<ICFBamEnumDefObj, Boolean>, TableCell<ICFBamEnumDefObj, Boolean>>() { @Override public TableCell<ICFBamEnumDefObj, Boolean> call(TableColumn<ICFBamEnumDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamEnumDefObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamEnumDefObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredDefaultVisibility(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnDefaultVisibility.setCellFactory( new Callback<TableColumn<ICFBamEnumDefObj, Boolean>, TableCell<ICFBamEnumDefObj, Boolean>>() { @Override public TableCell<ICFBamEnumDefObj, Boolean> call(TableColumn<ICFBamEnumDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamEnumDefObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamEnumDefObj, String> p) { ICFBamAtomObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDbName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDbName.setCellFactory( new Callback<TableColumn<ICFBamEnumDefObj, String>, TableCell<ICFBamEnumDefObj, String>>() { @Override public TableCell<ICFBamEnumDefObj, String> call(TableColumn<ICFBamEnumDefObj, String> arg) { return new CFStringTableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamEnumDefObj, Short>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamEnumDefObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamEnumDefObj, Short>, TableCell<ICFBamEnumDefObj, Short>>() { @Override public TableCell<ICFBamEnumDefObj, Short> call(TableColumn<ICFBamEnumDefObj, Short> arg) { return new CFInt16TableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamEnumDefObj, Short>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamEnumDefObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamEnumDefObj, Short>, TableCell<ICFBamEnumDefObj, Short>>() { @Override public TableCell<ICFBamEnumDefObj, Short> call(TableColumn<ICFBamEnumDefObj, Short> arg) { return new CFInt16TableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamEnumDefObj, Short>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamEnumDefObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalMinValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnMinValue.setCellFactory( new Callback<TableColumn<ICFBamEnumDefObj, Short>, TableCell<ICFBamEnumDefObj, Short>>() { @Override public TableCell<ICFBamEnumDefObj, Short> call(TableColumn<ICFBamEnumDefObj, Short> arg) { return new CFInt16TableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamEnumDefObj, Short>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamEnumDefObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalMaxValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnMaxValue.setCellFactory( new Callback<TableColumn<ICFBamEnumDefObj, Short>, TableCell<ICFBamEnumDefObj, Short>>() { @Override public TableCell<ICFBamEnumDefObj, Short> call(TableColumn<ICFBamEnumDefObj, Short> arg) { return new CFInt16TableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamEnumDefObj, Short>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamEnumDefObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamEnumDefObj, Short>, TableCell<ICFBamEnumDefObj, Short>>() { @Override public TableCell<ICFBamEnumDefObj, Short> call(TableColumn<ICFBamEnumDefObj, Short> arg) { return new CFInt16TableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamEnumDefObj, Short>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamEnumDefObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamEnumDefObj, Short>, TableCell<ICFBamEnumDefObj, Short>>() { @Override public TableCell<ICFBamEnumDefObj, Short> call(TableColumn<ICFBamEnumDefObj, Short> arg) { return new CFInt16TableCell<ICFBamEnumDefObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamEnumDefObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamEnumDefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamEnumDefObj, ICFBamSchemaDefObj> p) { ICFBamEnumDefObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema(); ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupDefSchema.setCellFactory( new Callback<TableColumn<ICFBamEnumDefObj, ICFBamSchemaDefObj>, TableCell<ICFBamEnumDefObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamEnumDefObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamEnumDefObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamEnumDefObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamEnumDefObj>() { @Override public void changed(ObservableValue<? extends ICFBamEnumDefObj> observable, ICFBamEnumDefObj oldValue, ICFBamEnumDefObj newValue) { setJavaFXFocus(newValue); 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.choseEnumDef(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"); } ICFBamEnumDefObj selectedInstance = getJavaFXFocusAsEnumDef(); invokeWhenChosen.choseEnumDef(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); }