List of usage examples for javafx.scene.control TableColumn TableColumn
public TableColumn(String text)
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXIndexColPickerPane.java
public CFBamJavaFXIndexColPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamIndexColObj argFocus, ICFBamIndexObj argContainer, Collection<ICFBamIndexColObj> argDataCollection, ICFBamJavaFXIndexColChosen whenChosen) { super();//from 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<ICFBamIndexColObj>(); tableColumnId = new TableColumn<ICFBamIndexColObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamIndexColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamIndexColObj, Long> p) { ICFBamIndexColObj 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<ICFBamIndexColObj, Long>, TableCell<ICFBamIndexColObj, Long>>() { @Override public TableCell<ICFBamIndexColObj, Long> call(TableColumn<ICFBamIndexColObj, Long> arg) { return new CFInt64TableCell<ICFBamIndexColObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamIndexColObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamIndexColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamIndexColObj, String> p) { ICFBamIndexColObj 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<ICFBamIndexColObj, String>, TableCell<ICFBamIndexColObj, String>>() { @Override public TableCell<ICFBamIndexColObj, String> call(TableColumn<ICFBamIndexColObj, String> arg) { return new CFStringTableCell<ICFBamIndexColObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamIndexColObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamIndexColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamIndexColObj, String> p) { ICFBamIndexColObj 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<ICFBamIndexColObj, String>, TableCell<ICFBamIndexColObj, String>>() { @Override public TableCell<ICFBamIndexColObj, String> call(TableColumn<ICFBamIndexColObj, String> arg) { return new CFStringTableCell<ICFBamIndexColObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamIndexColObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamIndexColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamIndexColObj, String> p) { ICFBamIndexColObj 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<ICFBamIndexColObj, String>, TableCell<ICFBamIndexColObj, String>>() { @Override public TableCell<ICFBamIndexColObj, String> call(TableColumn<ICFBamIndexColObj, String> arg) { return new CFStringTableCell<ICFBamIndexColObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamIndexColObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamIndexColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamIndexColObj, String> p) { ICFBamIndexColObj 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<ICFBamIndexColObj, String>, TableCell<ICFBamIndexColObj, String>>() { @Override public TableCell<ICFBamIndexColObj, String> call(TableColumn<ICFBamIndexColObj, String> arg) { return new CFStringTableCell<ICFBamIndexColObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamIndexColObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamIndexColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamIndexColObj, String> p) { ICFBamIndexColObj 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<ICFBamIndexColObj, String>, TableCell<ICFBamIndexColObj, String>>() { @Override public TableCell<ICFBamIndexColObj, String> call(TableColumn<ICFBamIndexColObj, String> arg) { return new CFStringTableCell<ICFBamIndexColObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsAscending = new TableColumn<ICFBamIndexColObj, Boolean>("IsAscending"); tableColumnIsAscending.setCellValueFactory( new Callback<CellDataFeatures<ICFBamIndexColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamIndexColObj, Boolean> p) { ICFBamIndexColObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredIsAscending(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnIsAscending.setCellFactory( new Callback<TableColumn<ICFBamIndexColObj, Boolean>, TableCell<ICFBamIndexColObj, Boolean>>() { @Override public TableCell<ICFBamIndexColObj, Boolean> call(TableColumn<ICFBamIndexColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamIndexColObj>(); } }); dataTable.getColumns().add(tableColumnIsAscending); tableColumnDefaultVisibility = new TableColumn<ICFBamIndexColObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamIndexColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamIndexColObj, Boolean> p) { ICFBamIndexColObj 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<ICFBamIndexColObj, Boolean>, TableCell<ICFBamIndexColObj, Boolean>>() { @Override public TableCell<ICFBamIndexColObj, Boolean> call(TableColumn<ICFBamIndexColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamIndexColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnLookupDefSchema = new TableColumn<ICFBamIndexColObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamIndexColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamIndexColObj, ICFBamSchemaDefObj> p) { ICFBamIndexColObj 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<ICFBamIndexColObj, ICFBamSchemaDefObj>, TableCell<ICFBamIndexColObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamIndexColObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamIndexColObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamIndexColObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); tableColumnLookupColumn = new TableColumn<ICFBamIndexColObj, ICFBamValueObj>("Column"); tableColumnLookupColumn.setCellValueFactory( new Callback<CellDataFeatures<ICFBamIndexColObj, ICFBamValueObj>, ObservableValue<ICFBamValueObj>>() { public ObservableValue<ICFBamValueObj> call( CellDataFeatures<ICFBamIndexColObj, ICFBamValueObj> p) { ICFBamIndexColObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamValueObj ref = obj.getRequiredLookupColumn(); ReadOnlyObjectWrapper<ICFBamValueObj> observable = new ReadOnlyObjectWrapper<ICFBamValueObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupColumn.setCellFactory( new Callback<TableColumn<ICFBamIndexColObj, ICFBamValueObj>, TableCell<ICFBamIndexColObj, ICFBamValueObj>>() { @Override public TableCell<ICFBamIndexColObj, ICFBamValueObj> call( TableColumn<ICFBamIndexColObj, ICFBamValueObj> arg) { return new CFReferenceTableCell<ICFBamIndexColObj, ICFBamValueObj>(); } }); dataTable.getColumns().add(tableColumnLookupColumn); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamIndexColObj>() { @Override public void changed(ObservableValue<? extends ICFBamIndexColObj> observable, ICFBamIndexColObj oldValue, ICFBamIndexColObj 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.choseIndexCol(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"); } ICFBamIndexColObj selectedInstance = getJavaFXFocusAsIndexCol(); invokeWhenChosen.choseIndexCol(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.CFBamJavaFXValuePickerPane.java
public CFBamJavaFXValuePickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamValueObj argFocus, ICFBamScopeObj argContainer, Collection<ICFBamValueObj> argDataCollection, ICFBamJavaFXValueChosen whenChosen) { super();// ww w . ja v a 2s .c o m final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } 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<ICFBamValueObj>(); tableColumnObjKind = new TableColumn<ICFBamValueObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamValueObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamValueObj, String> p) { ICFBamValueObj 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<ICFBamValueObj, String>, TableCell<ICFBamValueObj, String>>() { @Override public TableCell<ICFBamValueObj, String> call(TableColumn<ICFBamValueObj, String> arg) { return new CFStringTableCell<ICFBamValueObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamValueObj, Long>("Id"); tableColumnId .setCellValueFactory(new Callback<CellDataFeatures<ICFBamValueObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamValueObj, 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<ICFBamValueObj, Long>, TableCell<ICFBamValueObj, Long>>() { @Override public TableCell<ICFBamValueObj, Long> call(TableColumn<ICFBamValueObj, Long> arg) { return new CFInt64TableCell<ICFBamValueObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamValueObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamValueObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamValueObj, 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<ICFBamValueObj, String>, TableCell<ICFBamValueObj, String>>() { @Override public TableCell<ICFBamValueObj, String> call(TableColumn<ICFBamValueObj, String> arg) { return new CFStringTableCell<ICFBamValueObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamValueObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamValueObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamValueObj, 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<ICFBamValueObj, String>, TableCell<ICFBamValueObj, String>>() { @Override public TableCell<ICFBamValueObj, String> call(TableColumn<ICFBamValueObj, String> arg) { return new CFStringTableCell<ICFBamValueObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamValueObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamValueObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamValueObj, 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<ICFBamValueObj, String>, TableCell<ICFBamValueObj, String>>() { @Override public TableCell<ICFBamValueObj, String> call(TableColumn<ICFBamValueObj, String> arg) { return new CFStringTableCell<ICFBamValueObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamValueObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamValueObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamValueObj, 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<ICFBamValueObj, String>, TableCell<ICFBamValueObj, String>>() { @Override public TableCell<ICFBamValueObj, String> call(TableColumn<ICFBamValueObj, String> arg) { return new CFStringTableCell<ICFBamValueObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamValueObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamValueObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamValueObj, 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<ICFBamValueObj, String>, TableCell<ICFBamValueObj, String>>() { @Override public TableCell<ICFBamValueObj, String> call(TableColumn<ICFBamValueObj, String> arg) { return new CFStringTableCell<ICFBamValueObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamValueObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamValueObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamValueObj, 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<ICFBamValueObj, Boolean>, TableCell<ICFBamValueObj, Boolean>>() { @Override public TableCell<ICFBamValueObj, Boolean> call(TableColumn<ICFBamValueObj, Boolean> arg) { return new CFBoolTableCell<ICFBamValueObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamValueObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamValueObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamValueObj, 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<ICFBamValueObj, Boolean>, TableCell<ICFBamValueObj, Boolean>>() { @Override public TableCell<ICFBamValueObj, Boolean> call(TableColumn<ICFBamValueObj, Boolean> arg) { return new CFBoolTableCell<ICFBamValueObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamValueObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamValueObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamValueObj, 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<ICFBamValueObj, Boolean>, TableCell<ICFBamValueObj, Boolean>>() { @Override public TableCell<ICFBamValueObj, Boolean> call(TableColumn<ICFBamValueObj, Boolean> arg) { return new CFBoolTableCell<ICFBamValueObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnLookupDefSchema = new TableColumn<ICFBamValueObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamValueObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamValueObj, ICFBamSchemaDefObj> p) { ICFBamValueObj 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<ICFBamValueObj, ICFBamSchemaDefObj>, TableCell<ICFBamValueObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamValueObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamValueObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamValueObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamValueObj>() { @Override public void changed(ObservableValue<? extends ICFBamValueObj> observable, ICFBamValueObj oldValue, ICFBamValueObj 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.choseValue(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"); } ICFBamValueObj selectedInstance = getJavaFXFocusAsValue(); invokeWhenChosen.choseValue(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.CFBamJavaFXChainPickerPane.java
public CFBamJavaFXChainPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamChainObj argFocus, ICFBamTableObj argContainer, Collection<ICFBamChainObj> argDataCollection, ICFBamJavaFXChainChosen whenChosen) { super();//from w w w . j av a 2 s . c o m final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } if (whenChosen == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6, "whenChosen"); } invokeWhenChosen = whenChosen; // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamChainObj>(); tableColumnId = new TableColumn<ICFBamChainObj, Long>("Id"); tableColumnId .setCellValueFactory(new Callback<CellDataFeatures<ICFBamChainObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamChainObj, Long> p) { ICFBamChainObj 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<ICFBamChainObj, Long>, TableCell<ICFBamChainObj, Long>>() { @Override public TableCell<ICFBamChainObj, Long> call(TableColumn<ICFBamChainObj, Long> arg) { return new CFInt64TableCell<ICFBamChainObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamChainObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamChainObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamChainObj, String> p) { ICFBamChainObj 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<ICFBamChainObj, String>, TableCell<ICFBamChainObj, String>>() { @Override public TableCell<ICFBamChainObj, String> call(TableColumn<ICFBamChainObj, String> arg) { return new CFStringTableCell<ICFBamChainObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamChainObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamChainObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamChainObj, String> p) { ICFBamChainObj 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<ICFBamChainObj, String>, TableCell<ICFBamChainObj, String>>() { @Override public TableCell<ICFBamChainObj, String> call(TableColumn<ICFBamChainObj, String> arg) { return new CFStringTableCell<ICFBamChainObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamChainObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamChainObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamChainObj, String> p) { ICFBamChainObj 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<ICFBamChainObj, String>, TableCell<ICFBamChainObj, String>>() { @Override public TableCell<ICFBamChainObj, String> call(TableColumn<ICFBamChainObj, String> arg) { return new CFStringTableCell<ICFBamChainObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamChainObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamChainObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamChainObj, String> p) { ICFBamChainObj 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<ICFBamChainObj, String>, TableCell<ICFBamChainObj, String>>() { @Override public TableCell<ICFBamChainObj, String> call(TableColumn<ICFBamChainObj, String> arg) { return new CFStringTableCell<ICFBamChainObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamChainObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamChainObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamChainObj, String> p) { ICFBamChainObj 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<ICFBamChainObj, String>, TableCell<ICFBamChainObj, String>>() { @Override public TableCell<ICFBamChainObj, String> call(TableColumn<ICFBamChainObj, String> arg) { return new CFStringTableCell<ICFBamChainObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnSuffix = new TableColumn<ICFBamChainObj, String>("Suffix"); tableColumnSuffix.setCellValueFactory( new Callback<CellDataFeatures<ICFBamChainObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamChainObj, String> p) { ICFBamChainObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalSuffix(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnSuffix.setCellFactory( new Callback<TableColumn<ICFBamChainObj, String>, TableCell<ICFBamChainObj, String>>() { @Override public TableCell<ICFBamChainObj, String> call(TableColumn<ICFBamChainObj, String> arg) { return new CFStringTableCell<ICFBamChainObj>(); } }); dataTable.getColumns().add(tableColumnSuffix); tableColumnDefaultVisibility = new TableColumn<ICFBamChainObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamChainObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamChainObj, Boolean> p) { ICFBamChainObj 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<ICFBamChainObj, Boolean>, TableCell<ICFBamChainObj, Boolean>>() { @Override public TableCell<ICFBamChainObj, Boolean> call(TableColumn<ICFBamChainObj, Boolean> arg) { return new CFBoolTableCell<ICFBamChainObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnLookupDefSchema = new TableColumn<ICFBamChainObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamChainObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamChainObj, ICFBamSchemaDefObj> p) { ICFBamChainObj 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<ICFBamChainObj, ICFBamSchemaDefObj>, TableCell<ICFBamChainObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamChainObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamChainObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamChainObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); tableColumnLookupPrevRel = new TableColumn<ICFBamChainObj, ICFBamRelationObj>("Previous Relation"); tableColumnLookupPrevRel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamChainObj, ICFBamRelationObj>, ObservableValue<ICFBamRelationObj>>() { public ObservableValue<ICFBamRelationObj> call( CellDataFeatures<ICFBamChainObj, ICFBamRelationObj> p) { ICFBamChainObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamRelationObj ref = obj.getRequiredLookupPrevRel(); ReadOnlyObjectWrapper<ICFBamRelationObj> observable = new ReadOnlyObjectWrapper<ICFBamRelationObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupPrevRel.setCellFactory( new Callback<TableColumn<ICFBamChainObj, ICFBamRelationObj>, TableCell<ICFBamChainObj, ICFBamRelationObj>>() { @Override public TableCell<ICFBamChainObj, ICFBamRelationObj> call( TableColumn<ICFBamChainObj, ICFBamRelationObj> arg) { return new CFReferenceTableCell<ICFBamChainObj, ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnLookupPrevRel); tableColumnLookupNextRel = new TableColumn<ICFBamChainObj, ICFBamRelationObj>("Next Relation"); tableColumnLookupNextRel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamChainObj, ICFBamRelationObj>, ObservableValue<ICFBamRelationObj>>() { public ObservableValue<ICFBamRelationObj> call( CellDataFeatures<ICFBamChainObj, ICFBamRelationObj> p) { ICFBamChainObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamRelationObj ref = obj.getRequiredLookupNextRel(); ReadOnlyObjectWrapper<ICFBamRelationObj> observable = new ReadOnlyObjectWrapper<ICFBamRelationObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupNextRel.setCellFactory( new Callback<TableColumn<ICFBamChainObj, ICFBamRelationObj>, TableCell<ICFBamChainObj, ICFBamRelationObj>>() { @Override public TableCell<ICFBamChainObj, ICFBamRelationObj> call( TableColumn<ICFBamChainObj, ICFBamRelationObj> arg) { return new CFReferenceTableCell<ICFBamChainObj, ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnLookupNextRel); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamChainObj>() { @Override public void changed(ObservableValue<? extends ICFBamChainObj> observable, ICFBamChainObj oldValue, ICFBamChainObj 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.choseChain(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"); } ICFBamChainObj selectedInstance = getJavaFXFocusAsChain(); invokeWhenChosen.choseChain(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.CFBamJavaFXRelationColPickerPane.java
public CFBamJavaFXRelationColPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamRelationColObj argFocus, ICFBamRelationObj argContainer, Collection<ICFBamRelationColObj> argDataCollection, ICFBamJavaFXRelationColChosen whenChosen) { super();/*from www . 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<ICFBamRelationColObj>(); tableColumnId = new TableColumn<ICFBamRelationColObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamRelationColObj, Long> p) { ICFBamRelationColObj 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<ICFBamRelationColObj, Long>, TableCell<ICFBamRelationColObj, Long>>() { @Override public TableCell<ICFBamRelationColObj, Long> call(TableColumn<ICFBamRelationColObj, Long> arg) { return new CFInt64TableCell<ICFBamRelationColObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamRelationColObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamRelationColObj, String> p) { ICFBamRelationColObj 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<ICFBamRelationColObj, String>, TableCell<ICFBamRelationColObj, String>>() { @Override public TableCell<ICFBamRelationColObj, String> call( TableColumn<ICFBamRelationColObj, String> arg) { return new CFStringTableCell<ICFBamRelationColObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamRelationColObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamRelationColObj, String> p) { ICFBamRelationColObj 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<ICFBamRelationColObj, String>, TableCell<ICFBamRelationColObj, String>>() { @Override public TableCell<ICFBamRelationColObj, String> call( TableColumn<ICFBamRelationColObj, String> arg) { return new CFStringTableCell<ICFBamRelationColObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamRelationColObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamRelationColObj, String> p) { ICFBamRelationColObj 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<ICFBamRelationColObj, String>, TableCell<ICFBamRelationColObj, String>>() { @Override public TableCell<ICFBamRelationColObj, String> call( TableColumn<ICFBamRelationColObj, String> arg) { return new CFStringTableCell<ICFBamRelationColObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamRelationColObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamRelationColObj, String> p) { ICFBamRelationColObj 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<ICFBamRelationColObj, String>, TableCell<ICFBamRelationColObj, String>>() { @Override public TableCell<ICFBamRelationColObj, String> call( TableColumn<ICFBamRelationColObj, String> arg) { return new CFStringTableCell<ICFBamRelationColObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamRelationColObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamRelationColObj, String> p) { ICFBamRelationColObj 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<ICFBamRelationColObj, String>, TableCell<ICFBamRelationColObj, String>>() { @Override public TableCell<ICFBamRelationColObj, String> call( TableColumn<ICFBamRelationColObj, String> arg) { return new CFStringTableCell<ICFBamRelationColObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnDefaultVisibility = new TableColumn<ICFBamRelationColObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamRelationColObj, Boolean> p) { ICFBamRelationColObj 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<ICFBamRelationColObj, Boolean>, TableCell<ICFBamRelationColObj, Boolean>>() { @Override public TableCell<ICFBamRelationColObj, Boolean> call( TableColumn<ICFBamRelationColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamRelationColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnLookupDefSchema = new TableColumn<ICFBamRelationColObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamRelationColObj, ICFBamSchemaDefObj> p) { ICFBamRelationColObj 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<ICFBamRelationColObj, ICFBamSchemaDefObj>, TableCell<ICFBamRelationColObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamRelationColObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamRelationColObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamRelationColObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); tableColumnLookupFromCol = new TableColumn<ICFBamRelationColObj, ICFBamIndexColObj>("From Column"); tableColumnLookupFromCol.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationColObj, ICFBamIndexColObj>, ObservableValue<ICFBamIndexColObj>>() { public ObservableValue<ICFBamIndexColObj> call( CellDataFeatures<ICFBamRelationColObj, ICFBamIndexColObj> p) { ICFBamRelationColObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamIndexColObj ref = obj.getRequiredLookupFromCol(); ReadOnlyObjectWrapper<ICFBamIndexColObj> observable = new ReadOnlyObjectWrapper<ICFBamIndexColObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupFromCol.setCellFactory( new Callback<TableColumn<ICFBamRelationColObj, ICFBamIndexColObj>, TableCell<ICFBamRelationColObj, ICFBamIndexColObj>>() { @Override public TableCell<ICFBamRelationColObj, ICFBamIndexColObj> call( TableColumn<ICFBamRelationColObj, ICFBamIndexColObj> arg) { return new CFReferenceTableCell<ICFBamRelationColObj, ICFBamIndexColObj>(); } }); dataTable.getColumns().add(tableColumnLookupFromCol); tableColumnLookupToCol = new TableColumn<ICFBamRelationColObj, ICFBamIndexColObj>("To Column"); tableColumnLookupToCol.setCellValueFactory( new Callback<CellDataFeatures<ICFBamRelationColObj, ICFBamIndexColObj>, ObservableValue<ICFBamIndexColObj>>() { public ObservableValue<ICFBamIndexColObj> call( CellDataFeatures<ICFBamRelationColObj, ICFBamIndexColObj> p) { ICFBamRelationColObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamIndexColObj ref = obj.getRequiredLookupToCol(); ReadOnlyObjectWrapper<ICFBamIndexColObj> observable = new ReadOnlyObjectWrapper<ICFBamIndexColObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupToCol.setCellFactory( new Callback<TableColumn<ICFBamRelationColObj, ICFBamIndexColObj>, TableCell<ICFBamRelationColObj, ICFBamIndexColObj>>() { @Override public TableCell<ICFBamRelationColObj, ICFBamIndexColObj> call( TableColumn<ICFBamRelationColObj, ICFBamIndexColObj> arg) { return new CFReferenceTableCell<ICFBamRelationColObj, ICFBamIndexColObj>(); } }); dataTable.getColumns().add(tableColumnLookupToCol); dataTable.getSelectionModel().selectedItemProperty() .addListener(new ChangeListener<ICFBamRelationColObj>() { @Override public void changed(ObservableValue<? extends ICFBamRelationColObj> observable, ICFBamRelationColObj oldValue, ICFBamRelationColObj 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.choseRelationCol(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"); } ICFBamRelationColObj selectedInstance = getJavaFXFocusAsRelationCol(); invokeWhenChosen.choseRelationCol(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.CFBamJavaFXAtomPickerPane.java
public CFBamJavaFXAtomPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamAtomObj argFocus, ICFBamScopeObj argContainer, Collection<ICFBamAtomObj> argDataCollection, ICFBamJavaFXAtomChosen whenChosen) { super();// w w w .jav 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<ICFBamAtomObj>(); tableColumnObjKind = new TableColumn<ICFBamAtomObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamAtomObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamAtomObj, String> p) { ICFBamAtomObj 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<ICFBamAtomObj, String>, TableCell<ICFBamAtomObj, String>>() { @Override public TableCell<ICFBamAtomObj, String> call(TableColumn<ICFBamAtomObj, String> arg) { return new CFStringTableCell<ICFBamAtomObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamAtomObj, Long>("Id"); tableColumnId .setCellValueFactory(new Callback<CellDataFeatures<ICFBamAtomObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamAtomObj, 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<ICFBamAtomObj, Long>, TableCell<ICFBamAtomObj, Long>>() { @Override public TableCell<ICFBamAtomObj, Long> call(TableColumn<ICFBamAtomObj, Long> arg) { return new CFInt64TableCell<ICFBamAtomObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamAtomObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamAtomObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamAtomObj, 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<ICFBamAtomObj, String>, TableCell<ICFBamAtomObj, String>>() { @Override public TableCell<ICFBamAtomObj, String> call(TableColumn<ICFBamAtomObj, String> arg) { return new CFStringTableCell<ICFBamAtomObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamAtomObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamAtomObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamAtomObj, 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<ICFBamAtomObj, String>, TableCell<ICFBamAtomObj, String>>() { @Override public TableCell<ICFBamAtomObj, String> call(TableColumn<ICFBamAtomObj, String> arg) { return new CFStringTableCell<ICFBamAtomObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamAtomObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamAtomObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamAtomObj, 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<ICFBamAtomObj, String>, TableCell<ICFBamAtomObj, String>>() { @Override public TableCell<ICFBamAtomObj, String> call(TableColumn<ICFBamAtomObj, String> arg) { return new CFStringTableCell<ICFBamAtomObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamAtomObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamAtomObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamAtomObj, 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<ICFBamAtomObj, String>, TableCell<ICFBamAtomObj, String>>() { @Override public TableCell<ICFBamAtomObj, String> call(TableColumn<ICFBamAtomObj, String> arg) { return new CFStringTableCell<ICFBamAtomObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamAtomObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamAtomObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamAtomObj, 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<ICFBamAtomObj, String>, TableCell<ICFBamAtomObj, String>>() { @Override public TableCell<ICFBamAtomObj, String> call(TableColumn<ICFBamAtomObj, String> arg) { return new CFStringTableCell<ICFBamAtomObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamAtomObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamAtomObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamAtomObj, 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<ICFBamAtomObj, Boolean>, TableCell<ICFBamAtomObj, Boolean>>() { @Override public TableCell<ICFBamAtomObj, Boolean> call(TableColumn<ICFBamAtomObj, Boolean> arg) { return new CFBoolTableCell<ICFBamAtomObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamAtomObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamAtomObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamAtomObj, 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<ICFBamAtomObj, Boolean>, TableCell<ICFBamAtomObj, Boolean>>() { @Override public TableCell<ICFBamAtomObj, Boolean> call(TableColumn<ICFBamAtomObj, Boolean> arg) { return new CFBoolTableCell<ICFBamAtomObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamAtomObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamAtomObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamAtomObj, 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<ICFBamAtomObj, Boolean>, TableCell<ICFBamAtomObj, Boolean>>() { @Override public TableCell<ICFBamAtomObj, Boolean> call(TableColumn<ICFBamAtomObj, Boolean> arg) { return new CFBoolTableCell<ICFBamAtomObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamAtomObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamAtomObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamAtomObj, 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<ICFBamAtomObj, String>, TableCell<ICFBamAtomObj, String>>() { @Override public TableCell<ICFBamAtomObj, String> call(TableColumn<ICFBamAtomObj, String> arg) { return new CFStringTableCell<ICFBamAtomObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnLookupDefSchema = new TableColumn<ICFBamAtomObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamAtomObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamAtomObj, ICFBamSchemaDefObj> p) { ICFBamAtomObj 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<ICFBamAtomObj, ICFBamSchemaDefObj>, TableCell<ICFBamAtomObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamAtomObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamAtomObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamAtomObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamAtomObj>() { @Override public void changed(ObservableValue<? extends ICFBamAtomObj> observable, ICFBamAtomObj oldValue, ICFBamAtomObj 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.choseAtom(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"); } ICFBamAtomObj selectedInstance = getJavaFXFocusAsAtom(); invokeWhenChosen.choseAtom(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.CFBamJavaFXIndexPickerPane.java
public CFBamJavaFXIndexPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamIndexObj argFocus, ICFBamTableObj argContainer, Collection<ICFBamIndexObj> argDataCollection, ICFBamJavaFXIndexChosen whenChosen) { super();// w ww . j ava2s . 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<ICFBamIndexObj>(); tableColumnId = new TableColumn<ICFBamIndexObj, Long>("Id"); tableColumnId .setCellValueFactory(new Callback<CellDataFeatures<ICFBamIndexObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamIndexObj, Long> p) { ICFBamScopeObj obj = p.getValue(); if (obj == null) { return (null); } else { long value = obj.getRequiredId(); Long wrapped = new Long(value); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(wrapped); return (observable); } } }); tableColumnId .setCellFactory(new Callback<TableColumn<ICFBamIndexObj, Long>, TableCell<ICFBamIndexObj, Long>>() { @Override public TableCell<ICFBamIndexObj, Long> call(TableColumn<ICFBamIndexObj, Long> arg) { return new CFInt64TableCell<ICFBamIndexObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamIndexObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamIndexObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamIndexObj, String> p) { ICFBamIndexObj 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<ICFBamIndexObj, String>, TableCell<ICFBamIndexObj, String>>() { @Override public TableCell<ICFBamIndexObj, String> call(TableColumn<ICFBamIndexObj, String> arg) { return new CFStringTableCell<ICFBamIndexObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamIndexObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamIndexObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamIndexObj, String> p) { ICFBamIndexObj 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<ICFBamIndexObj, String>, TableCell<ICFBamIndexObj, String>>() { @Override public TableCell<ICFBamIndexObj, String> call(TableColumn<ICFBamIndexObj, String> arg) { return new CFStringTableCell<ICFBamIndexObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamIndexObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamIndexObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamIndexObj, String> p) { ICFBamIndexObj 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<ICFBamIndexObj, String>, TableCell<ICFBamIndexObj, String>>() { @Override public TableCell<ICFBamIndexObj, String> call(TableColumn<ICFBamIndexObj, String> arg) { return new CFStringTableCell<ICFBamIndexObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamIndexObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamIndexObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamIndexObj, String> p) { ICFBamIndexObj 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<ICFBamIndexObj, String>, TableCell<ICFBamIndexObj, String>>() { @Override public TableCell<ICFBamIndexObj, String> call(TableColumn<ICFBamIndexObj, String> arg) { return new CFStringTableCell<ICFBamIndexObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamIndexObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamIndexObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamIndexObj, String> p) { ICFBamIndexObj 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<ICFBamIndexObj, String>, TableCell<ICFBamIndexObj, String>>() { @Override public TableCell<ICFBamIndexObj, String> call(TableColumn<ICFBamIndexObj, String> arg) { return new CFStringTableCell<ICFBamIndexObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnDbName = new TableColumn<ICFBamIndexObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamIndexObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamIndexObj, String> p) { ICFBamIndexObj 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<ICFBamIndexObj, String>, TableCell<ICFBamIndexObj, String>>() { @Override public TableCell<ICFBamIndexObj, String> call(TableColumn<ICFBamIndexObj, String> arg) { return new CFStringTableCell<ICFBamIndexObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnSuffix = new TableColumn<ICFBamIndexObj, String>("Suffix"); tableColumnSuffix.setCellValueFactory( new Callback<CellDataFeatures<ICFBamIndexObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamIndexObj, String> p) { ICFBamIndexObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalSuffix(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnSuffix.setCellFactory( new Callback<TableColumn<ICFBamIndexObj, String>, TableCell<ICFBamIndexObj, String>>() { @Override public TableCell<ICFBamIndexObj, String> call(TableColumn<ICFBamIndexObj, String> arg) { return new CFStringTableCell<ICFBamIndexObj>(); } }); dataTable.getColumns().add(tableColumnSuffix); tableColumnIsUnique = new TableColumn<ICFBamIndexObj, Boolean>("Is Unique"); tableColumnIsUnique.setCellValueFactory( new Callback<CellDataFeatures<ICFBamIndexObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamIndexObj, Boolean> p) { ICFBamIndexObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredIsUnique(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnIsUnique.setCellFactory( new Callback<TableColumn<ICFBamIndexObj, Boolean>, TableCell<ICFBamIndexObj, Boolean>>() { @Override public TableCell<ICFBamIndexObj, Boolean> call(TableColumn<ICFBamIndexObj, Boolean> arg) { return new CFBoolTableCell<ICFBamIndexObj>(); } }); dataTable.getColumns().add(tableColumnIsUnique); tableColumnIsDbMapped = new TableColumn<ICFBamIndexObj, Boolean>("Is Db Mapped"); tableColumnIsDbMapped.setCellValueFactory( new Callback<CellDataFeatures<ICFBamIndexObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamIndexObj, Boolean> p) { ICFBamIndexObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredIsDbMapped(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnIsDbMapped.setCellFactory( new Callback<TableColumn<ICFBamIndexObj, Boolean>, TableCell<ICFBamIndexObj, Boolean>>() { @Override public TableCell<ICFBamIndexObj, Boolean> call(TableColumn<ICFBamIndexObj, Boolean> arg) { return new CFBoolTableCell<ICFBamIndexObj>(); } }); dataTable.getColumns().add(tableColumnIsDbMapped); tableColumnDefaultVisibility = new TableColumn<ICFBamIndexObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamIndexObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamIndexObj, Boolean> p) { ICFBamIndexObj 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<ICFBamIndexObj, Boolean>, TableCell<ICFBamIndexObj, Boolean>>() { @Override public TableCell<ICFBamIndexObj, Boolean> call(TableColumn<ICFBamIndexObj, Boolean> arg) { return new CFBoolTableCell<ICFBamIndexObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnLookupDefSchema = new TableColumn<ICFBamIndexObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamIndexObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamIndexObj, ICFBamSchemaDefObj> p) { ICFBamIndexObj 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<ICFBamIndexObj, ICFBamSchemaDefObj>, TableCell<ICFBamIndexObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamIndexObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamIndexObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamIndexObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamIndexObj>() { @Override public void changed(ObservableValue<? extends ICFBamIndexObj> observable, ICFBamIndexObj oldValue, ICFBamIndexObj 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.choseIndex(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"); } ICFBamIndexObj selectedInstance = getJavaFXFocusAsIndex(); invokeWhenChosen.choseIndex(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.CFBamJavaFXBlobColPickerPane.java
public CFBamJavaFXBlobColPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamBlobColObj argFocus, ICFBamTableObj argContainer, Collection<ICFBamBlobColObj> argDataCollection, ICFBamJavaFXBlobColChosen whenChosen) { super();/*from w ww . j a v 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<ICFBamBlobColObj>(); tableColumnId = new TableColumn<ICFBamBlobColObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBlobColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamBlobColObj, 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<ICFBamBlobColObj, Long>, TableCell<ICFBamBlobColObj, Long>>() { @Override public TableCell<ICFBamBlobColObj, Long> call(TableColumn<ICFBamBlobColObj, Long> arg) { return new CFInt64TableCell<ICFBamBlobColObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamBlobColObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBlobColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBlobColObj, 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<ICFBamBlobColObj, String>, TableCell<ICFBamBlobColObj, String>>() { @Override public TableCell<ICFBamBlobColObj, String> call(TableColumn<ICFBamBlobColObj, String> arg) { return new CFStringTableCell<ICFBamBlobColObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamBlobColObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBlobColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBlobColObj, 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<ICFBamBlobColObj, String>, TableCell<ICFBamBlobColObj, String>>() { @Override public TableCell<ICFBamBlobColObj, String> call(TableColumn<ICFBamBlobColObj, String> arg) { return new CFStringTableCell<ICFBamBlobColObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamBlobColObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBlobColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBlobColObj, 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<ICFBamBlobColObj, String>, TableCell<ICFBamBlobColObj, String>>() { @Override public TableCell<ICFBamBlobColObj, String> call(TableColumn<ICFBamBlobColObj, String> arg) { return new CFStringTableCell<ICFBamBlobColObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamBlobColObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBlobColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBlobColObj, 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<ICFBamBlobColObj, String>, TableCell<ICFBamBlobColObj, String>>() { @Override public TableCell<ICFBamBlobColObj, String> call(TableColumn<ICFBamBlobColObj, String> arg) { return new CFStringTableCell<ICFBamBlobColObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamBlobColObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBlobColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBlobColObj, 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<ICFBamBlobColObj, String>, TableCell<ICFBamBlobColObj, String>>() { @Override public TableCell<ICFBamBlobColObj, String> call(TableColumn<ICFBamBlobColObj, String> arg) { return new CFStringTableCell<ICFBamBlobColObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamBlobColObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBlobColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBlobColObj, 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<ICFBamBlobColObj, Boolean>, TableCell<ICFBamBlobColObj, Boolean>>() { @Override public TableCell<ICFBamBlobColObj, Boolean> call(TableColumn<ICFBamBlobColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamBlobColObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamBlobColObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBlobColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBlobColObj, 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<ICFBamBlobColObj, Boolean>, TableCell<ICFBamBlobColObj, Boolean>>() { @Override public TableCell<ICFBamBlobColObj, Boolean> call(TableColumn<ICFBamBlobColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamBlobColObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamBlobColObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBlobColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBlobColObj, 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<ICFBamBlobColObj, Boolean>, TableCell<ICFBamBlobColObj, Boolean>>() { @Override public TableCell<ICFBamBlobColObj, Boolean> call(TableColumn<ICFBamBlobColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamBlobColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamBlobColObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBlobColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBlobColObj, 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<ICFBamBlobColObj, String>, TableCell<ICFBamBlobColObj, String>>() { @Override public TableCell<ICFBamBlobColObj, String> call(TableColumn<ICFBamBlobColObj, String> arg) { return new CFStringTableCell<ICFBamBlobColObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnMaxLen = new TableColumn<ICFBamBlobColObj, Integer>("Max. Length"); tableColumnMaxLen.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBlobColObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamBlobColObj, Integer> p) { ICFBamBlobDefObj 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<ICFBamBlobColObj, Integer>, TableCell<ICFBamBlobColObj, Integer>>() { @Override public TableCell<ICFBamBlobColObj, Integer> call(TableColumn<ICFBamBlobColObj, Integer> arg) { return new CFInt32TableCell<ICFBamBlobColObj>(); } }); dataTable.getColumns().add(tableColumnMaxLen); tableColumnLookupDefSchema = new TableColumn<ICFBamBlobColObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBlobColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamBlobColObj, ICFBamSchemaDefObj> p) { ICFBamBlobColObj 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<ICFBamBlobColObj, ICFBamSchemaDefObj>, TableCell<ICFBamBlobColObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamBlobColObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamBlobColObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamBlobColObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamBlobColObj>() { @Override public void changed(ObservableValue<? extends ICFBamBlobColObj> observable, ICFBamBlobColObj oldValue, ICFBamBlobColObj 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.choseBlobCol(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"); } ICFBamBlobColObj selectedInstance = getJavaFXFocusAsBlobCol(); invokeWhenChosen.choseBlobCol(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:dpfmanager.shell.interfaces.gui.component.report.ReportsView.java
private void addHeaders() { TableColumn colDate = new TableColumn(bundle.getString("colDate")); setMinMaxWidth(colDate, 75);/*from w ww.j ava 2 s . c o m*/ colDate.setCellValueFactory(new PropertyValueFactory<ReportRow, String>("date")); TableColumn colTime = new TableColumn(bundle.getString("colTime")); setMinMaxWidth(colTime, 75); colTime.setCellValueFactory(new PropertyValueFactory<ReportRow, String>("time")); TableColumn colN = new TableColumn(bundle.getString("colN")); setMinMaxWidth(colN, 70); colN.setCellValueFactory(new PropertyValueFactory<ReportRow, String>("nfiles")); TableColumn colFile = new TableColumn(bundle.getString("colFile")); setMinMaxWidth(colFile, 160); colFile.setCellValueFactory(new PropertyValueFactory<ReportRow, String>("input")); TableColumn colErrors = new TableColumn(bundle.getString("colErrors")); setMinMaxWidth(colErrors, 65); colErrors.setCellValueFactory(new PropertyValueFactory<ReportRow, String>("errors")); TableColumn colWarnings = new TableColumn(bundle.getString("colWarnings")); setMinMaxWidth(colWarnings, 85); colWarnings.setCellValueFactory(new PropertyValueFactory<ReportRow, String>("warnings")); TableColumn colPassed = new TableColumn(bundle.getString("colPassed")); setMinMaxWidth(colPassed, 65); colPassed.setCellValueFactory(new PropertyValueFactory<ReportRow, String>("passed")); colScore = new TableColumn(bundle.getString("colScore")); setMinMaxWidth(colScore, 75); colScore.setCellValueFactory(new PropertyValueFactory<ReportRow, String>("score")); colFormats = new TableColumn(bundle.getString("colFormats")); setMinMaxWidth(colFormats, 120); colFormats .setCellValueFactory(new PropertyValueFactory<ReportRow, ObservableMap<String, String>>("formats")); colDelete = new TableColumn(bundle.getString("colDelete")); setMinMaxWidth(colDelete, 30); colDelete.setVisible(true); colDelete.setCellValueFactory(new PropertyValueFactory<>("delete")); tabReports.skinProperty().addListener((obs, oldSkin, newSkin) -> { TableHeaderRow header = (TableHeaderRow) tabReports.lookup("TableHeaderRow"); header.reorderingProperty().addListener((o, oldVal, newVal) -> header.setReordering(false)); }); tabReports.setPrefWidth(840.0); tabReports.setFixedCellSize(28.0); tabReports.getColumns().addAll(colDate, colTime, colN, colFile, colErrors, colWarnings, colPassed, colScore, colFormats, colDelete); tabReports.setCursor(Cursor.DEFAULT); tabReports.setEditable(false); tabReports.setMaxHeight(470.0); // Change column colors changeColumnTextColor(colDate, Color.LIGHTGRAY); changeColumnTextColor(colTime, Color.LIGHTGRAY); changeColumnTextColor(colFile, Color.LIGHTGRAY); changeColumnTextColor(colN, Color.CYAN); changeColumnTextColor(colErrors, Color.RED); changeColumnTextColor(colWarnings, Color.ORANGE); changeColumnTextColor(colPassed, Color.GREENYELLOW); changeColumnTextColor(colScore, Color.LIGHTGRAY); // Columns factories Bindings.size(tabReports.getItems()).addListener(new ChangeListener<Number>() { @Override public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) { resizeTable(); } }); addChartScore(); addFormatIcons(); addDeleteIcon(); }
From source file:de.perdian.apps.tagtiger.fx.handlers.batchupdate.UpdateFileNamesFromTagsActionEventHandler.java
private TableView<?> createNewFileNamesPane(ObservableList<UpdateFileNamesFromTagsItem> items) { TableColumn<UpdateFileNamesFromTagsItem, String> currentFileNameColumn = new TableColumn<>( this.getLocalization().currentFileName()); currentFileNameColumn.setSortable(false); currentFileNameColumn.setCellValueFactory(p -> p.getValue().getCurrentFileName()); TableColumn<UpdateFileNamesFromTagsItem, String> newFileNameColumn = new TableColumn<>( this.getLocalization().newFileName()); newFileNameColumn.setSortable(false); newFileNameColumn.setCellValueFactory(p -> p.getValue().getNewFileName()); TableView<UpdateFileNamesFromTagsItem> tableView = new TableView<>(items); tableView.getColumns().addAll(Arrays.asList(currentFileNameColumn, newFileNameColumn)); tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); return tableView; }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXBlobTypePickerPane.java
public CFBamJavaFXBlobTypePickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamBlobTypeObj argFocus, ICFBamSchemaDefObj argContainer, Collection<ICFBamBlobTypeObj> argDataCollection, ICFBamJavaFXBlobTypeChosen whenChosen) { super();/* w w w .j a va 2s . c o m*/ final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } 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<ICFBamBlobTypeObj>(); tableColumnId = new TableColumn<ICFBamBlobTypeObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBlobTypeObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamBlobTypeObj, 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<ICFBamBlobTypeObj, Long>, TableCell<ICFBamBlobTypeObj, Long>>() { @Override public TableCell<ICFBamBlobTypeObj, Long> call(TableColumn<ICFBamBlobTypeObj, Long> arg) { return new CFInt64TableCell<ICFBamBlobTypeObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamBlobTypeObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBlobTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBlobTypeObj, 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<ICFBamBlobTypeObj, String>, TableCell<ICFBamBlobTypeObj, String>>() { @Override public TableCell<ICFBamBlobTypeObj, String> call(TableColumn<ICFBamBlobTypeObj, String> arg) { return new CFStringTableCell<ICFBamBlobTypeObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamBlobTypeObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBlobTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBlobTypeObj, 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<ICFBamBlobTypeObj, String>, TableCell<ICFBamBlobTypeObj, String>>() { @Override public TableCell<ICFBamBlobTypeObj, String> call(TableColumn<ICFBamBlobTypeObj, String> arg) { return new CFStringTableCell<ICFBamBlobTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamBlobTypeObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBlobTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBlobTypeObj, 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<ICFBamBlobTypeObj, String>, TableCell<ICFBamBlobTypeObj, String>>() { @Override public TableCell<ICFBamBlobTypeObj, String> call(TableColumn<ICFBamBlobTypeObj, String> arg) { return new CFStringTableCell<ICFBamBlobTypeObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamBlobTypeObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBlobTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBlobTypeObj, 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<ICFBamBlobTypeObj, String>, TableCell<ICFBamBlobTypeObj, String>>() { @Override public TableCell<ICFBamBlobTypeObj, String> call(TableColumn<ICFBamBlobTypeObj, String> arg) { return new CFStringTableCell<ICFBamBlobTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamBlobTypeObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBlobTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBlobTypeObj, 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<ICFBamBlobTypeObj, String>, TableCell<ICFBamBlobTypeObj, String>>() { @Override public TableCell<ICFBamBlobTypeObj, String> call(TableColumn<ICFBamBlobTypeObj, String> arg) { return new CFStringTableCell<ICFBamBlobTypeObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamBlobTypeObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBlobTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBlobTypeObj, 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<ICFBamBlobTypeObj, Boolean>, TableCell<ICFBamBlobTypeObj, Boolean>>() { @Override public TableCell<ICFBamBlobTypeObj, Boolean> call(TableColumn<ICFBamBlobTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamBlobTypeObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamBlobTypeObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBlobTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBlobTypeObj, 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<ICFBamBlobTypeObj, Boolean>, TableCell<ICFBamBlobTypeObj, Boolean>>() { @Override public TableCell<ICFBamBlobTypeObj, Boolean> call(TableColumn<ICFBamBlobTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamBlobTypeObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamBlobTypeObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBlobTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBlobTypeObj, 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<ICFBamBlobTypeObj, Boolean>, TableCell<ICFBamBlobTypeObj, Boolean>>() { @Override public TableCell<ICFBamBlobTypeObj, Boolean> call(TableColumn<ICFBamBlobTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamBlobTypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamBlobTypeObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBlobTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBlobTypeObj, 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<ICFBamBlobTypeObj, String>, TableCell<ICFBamBlobTypeObj, String>>() { @Override public TableCell<ICFBamBlobTypeObj, String> call(TableColumn<ICFBamBlobTypeObj, String> arg) { return new CFStringTableCell<ICFBamBlobTypeObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnMaxLen = new TableColumn<ICFBamBlobTypeObj, Integer>("Max. Length"); tableColumnMaxLen.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBlobTypeObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamBlobTypeObj, Integer> p) { ICFBamBlobDefObj 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<ICFBamBlobTypeObj, Integer>, TableCell<ICFBamBlobTypeObj, Integer>>() { @Override public TableCell<ICFBamBlobTypeObj, Integer> call(TableColumn<ICFBamBlobTypeObj, Integer> arg) { return new CFInt32TableCell<ICFBamBlobTypeObj>(); } }); dataTable.getColumns().add(tableColumnMaxLen); tableColumnLookupDefSchema = new TableColumn<ICFBamBlobTypeObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBlobTypeObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamBlobTypeObj, ICFBamSchemaDefObj> p) { ICFBamBlobTypeObj 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<ICFBamBlobTypeObj, ICFBamSchemaDefObj>, TableCell<ICFBamBlobTypeObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamBlobTypeObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamBlobTypeObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamBlobTypeObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamBlobTypeObj>() { @Override public void changed(ObservableValue<? extends ICFBamBlobTypeObj> observable, ICFBamBlobTypeObj oldValue, ICFBamBlobTypeObj 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.choseBlobType(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"); } ICFBamBlobTypeObj selectedInstance = getJavaFXFocusAsBlobType(); invokeWhenChosen.choseBlobType(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); }