List of usage examples for javafx.util Callback Callback
Callback
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXTZTimeColPickerPane.java
public CFBamJavaFXTZTimeColPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamTZTimeColObj argFocus, ICFBamTableObj argContainer, Collection<ICFBamTZTimeColObj> argDataCollection, ICFBamJavaFXTZTimeColChosen whenChosen) { super();// www.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<ICFBamTZTimeColObj>(); tableColumnId = new TableColumn<ICFBamTZTimeColObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamTZTimeColObj, Long> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { long value = obj.getRequiredId(); Long wrapped = new Long(value); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(wrapped); return (observable); } } }); tableColumnId.setCellFactory( new Callback<TableColumn<ICFBamTZTimeColObj, Long>, TableCell<ICFBamTZTimeColObj, Long>>() { @Override public TableCell<ICFBamTZTimeColObj, Long> call(TableColumn<ICFBamTZTimeColObj, Long> arg) { return new CFInt64TableCell<ICFBamTZTimeColObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamTZTimeColObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getRequiredName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnName.setCellFactory( new Callback<TableColumn<ICFBamTZTimeColObj, String>, TableCell<ICFBamTZTimeColObj, String>>() { @Override public TableCell<ICFBamTZTimeColObj, String> call(TableColumn<ICFBamTZTimeColObj, String> arg) { return new CFStringTableCell<ICFBamTZTimeColObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamTZTimeColObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortName.setCellFactory( new Callback<TableColumn<ICFBamTZTimeColObj, String>, TableCell<ICFBamTZTimeColObj, String>>() { @Override public TableCell<ICFBamTZTimeColObj, String> call(TableColumn<ICFBamTZTimeColObj, String> arg) { return new CFStringTableCell<ICFBamTZTimeColObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamTZTimeColObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalLabel(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnLabel.setCellFactory( new Callback<TableColumn<ICFBamTZTimeColObj, String>, TableCell<ICFBamTZTimeColObj, String>>() { @Override public TableCell<ICFBamTZTimeColObj, String> call(TableColumn<ICFBamTZTimeColObj, String> arg) { return new CFStringTableCell<ICFBamTZTimeColObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamTZTimeColObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalShortDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnShortDescription.setCellFactory( new Callback<TableColumn<ICFBamTZTimeColObj, String>, TableCell<ICFBamTZTimeColObj, String>>() { @Override public TableCell<ICFBamTZTimeColObj, String> call(TableColumn<ICFBamTZTimeColObj, String> arg) { return new CFStringTableCell<ICFBamTZTimeColObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamTZTimeColObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeColObj, String> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDescription(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDescription.setCellFactory( new Callback<TableColumn<ICFBamTZTimeColObj, String>, TableCell<ICFBamTZTimeColObj, String>>() { @Override public TableCell<ICFBamTZTimeColObj, String> call(TableColumn<ICFBamTZTimeColObj, String> arg) { return new CFStringTableCell<ICFBamTZTimeColObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamTZTimeColObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimeColObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredIsNullable(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnIsNullable.setCellFactory( new Callback<TableColumn<ICFBamTZTimeColObj, Boolean>, TableCell<ICFBamTZTimeColObj, Boolean>>() { @Override public TableCell<ICFBamTZTimeColObj, Boolean> call( TableColumn<ICFBamTZTimeColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZTimeColObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamTZTimeColObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimeColObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { Boolean value = obj.getOptionalGenerateId(); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(value); return (observable); } } }); tableColumnGenerateId.setCellFactory( new Callback<TableColumn<ICFBamTZTimeColObj, Boolean>, TableCell<ICFBamTZTimeColObj, Boolean>>() { @Override public TableCell<ICFBamTZTimeColObj, Boolean> call( TableColumn<ICFBamTZTimeColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZTimeColObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamTZTimeColObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimeColObj, Boolean> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { boolean value = obj.getRequiredDefaultVisibility(); Boolean wrapped = new Boolean(value); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(wrapped); return (observable); } } }); tableColumnDefaultVisibility.setCellFactory( new Callback<TableColumn<ICFBamTZTimeColObj, Boolean>, TableCell<ICFBamTZTimeColObj, Boolean>>() { @Override public TableCell<ICFBamTZTimeColObj, Boolean> call( TableColumn<ICFBamTZTimeColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZTimeColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamTZTimeColObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeColObj, String> p) { ICFBamAtomObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalDbName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnDbName.setCellFactory( new Callback<TableColumn<ICFBamTZTimeColObj, String>, TableCell<ICFBamTZTimeColObj, String>>() { @Override public TableCell<ICFBamTZTimeColObj, String> call(TableColumn<ICFBamTZTimeColObj, String> arg) { return new CFStringTableCell<ICFBamTZTimeColObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamTZTimeColObj, Calendar>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeColObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimeColObj, Calendar> p) { ICFBamTZTimeDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamTZTimeColObj, Calendar>, TableCell<ICFBamTZTimeColObj, Calendar>>() { @Override public TableCell<ICFBamTZTimeColObj, Calendar> call( TableColumn<ICFBamTZTimeColObj, Calendar> arg) { return new CFTZTimeTableCell<ICFBamTZTimeColObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamTZTimeColObj, Calendar>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeColObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimeColObj, Calendar> p) { ICFBamTZTimeDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamTZTimeColObj, Calendar>, TableCell<ICFBamTZTimeColObj, Calendar>>() { @Override public TableCell<ICFBamTZTimeColObj, Calendar> call( TableColumn<ICFBamTZTimeColObj, Calendar> arg) { return new CFTZTimeTableCell<ICFBamTZTimeColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnNullValue = new TableColumn<ICFBamTZTimeColObj, Calendar>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeColObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimeColObj, Calendar> p) { ICFBamTZTimeDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamTZTimeColObj, Calendar>, TableCell<ICFBamTZTimeColObj, Calendar>>() { @Override public TableCell<ICFBamTZTimeColObj, Calendar> call( TableColumn<ICFBamTZTimeColObj, Calendar> arg) { return new CFTZTimeTableCell<ICFBamTZTimeColObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamTZTimeColObj, Calendar>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeColObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimeColObj, Calendar> p) { ICFBamTZTimeDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Calendar value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamTZTimeColObj, Calendar>, TableCell<ICFBamTZTimeColObj, Calendar>>() { @Override public TableCell<ICFBamTZTimeColObj, Calendar> call( TableColumn<ICFBamTZTimeColObj, Calendar> arg) { return new CFTZTimeTableCell<ICFBamTZTimeColObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamTZTimeColObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamTZTimeColObj, ICFBamSchemaDefObj> p) { ICFBamTZTimeColObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema(); ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupDefSchema.setCellFactory( new Callback<TableColumn<ICFBamTZTimeColObj, ICFBamSchemaDefObj>, TableCell<ICFBamTZTimeColObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamTZTimeColObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamTZTimeColObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamTZTimeColObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamTZTimeColObj>() { @Override public void changed(ObservableValue<? extends ICFBamTZTimeColObj> observable, ICFBamTZTimeColObj oldValue, ICFBamTZTimeColObj newValue) { setJavaFXFocus(newValue); if (buttonChooseSelected != null) { if (newValue != null) { buttonChooseSelected.setDisable(false); } else { buttonChooseSelected.setDisable(true); } } } }); hboxMenu = new CFHBox(10); buttonCancel = new CFButton(); buttonCancel.setMinWidth(200); buttonCancel.setText("Cancel"); buttonCancel.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { cfFormManager.closeCurrentForm(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonCancel); buttonChooseNone = new CFButton(); buttonChooseNone.setMinWidth(200); buttonChooseNone.setText("ChooseNone"); buttonChooseNone.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); if (schemaObj == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "schemaObj"); } invokeWhenChosen.choseTZTimeCol(null); cfFormManager.closeCurrentForm(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonChooseNone); buttonChooseSelected = new CFButton(); buttonChooseSelected.setMinWidth(200); buttonChooseSelected.setText("ChooseSelected"); buttonChooseSelected.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); if (schemaObj == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "schemaObj"); } ICFBamTZTimeColObj selectedInstance = getJavaFXFocusAsTZTimeCol(); invokeWhenChosen.choseTZTimeCol(selectedInstance); cfFormManager.closeCurrentForm(); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonChooseSelected); if (argFocus != null) { dataTable.getSelectionModel().select(argFocus); } setTop(hboxMenu); setCenter(dataTable); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXDelSubDep1ListPane.java
public CFBamJavaFXDelSubDep1ListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamDelTopDepObj argContainer, ICFBamDelSubDep1Obj argFocus, Collection<ICFBamDelSubDep1Obj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();//from ww w . j a v a2 s . co m final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamDelSubDep1Obj>(); tableColumnId = new TableColumn<ICFBamDelSubDep1Obj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDelSubDep1Obj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamDelSubDep1Obj, Long> p) { ICFBamScopeObj obj = p.getValue(); if (obj == null) { return (null); } else { long value = obj.getRequiredId(); Long wrapped = new Long(value); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(wrapped); return (observable); } } }); tableColumnId.setCellFactory( new Callback<TableColumn<ICFBamDelSubDep1Obj, Long>, TableCell<ICFBamDelSubDep1Obj, Long>>() { @Override public TableCell<ICFBamDelSubDep1Obj, Long> call(TableColumn<ICFBamDelSubDep1Obj, Long> arg) { return new CFInt64TableCell<ICFBamDelSubDep1Obj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamDelSubDep1Obj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDelSubDep1Obj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamDelSubDep1Obj, String> p) { ICFBamDelSubDep1Obj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getRequiredName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnName.setCellFactory( new Callback<TableColumn<ICFBamDelSubDep1Obj, String>, TableCell<ICFBamDelSubDep1Obj, String>>() { @Override public TableCell<ICFBamDelSubDep1Obj, String> call( TableColumn<ICFBamDelSubDep1Obj, String> arg) { return new CFStringTableCell<ICFBamDelSubDep1Obj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnLookupRelation = new TableColumn<ICFBamDelSubDep1Obj, ICFBamRelationObj>("Relation"); tableColumnLookupRelation.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDelSubDep1Obj, ICFBamRelationObj>, ObservableValue<ICFBamRelationObj>>() { public ObservableValue<ICFBamRelationObj> call( CellDataFeatures<ICFBamDelSubDep1Obj, ICFBamRelationObj> p) { ICFBamDelSubDep1Obj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamRelationObj ref = obj.getRequiredLookupRelation(); ReadOnlyObjectWrapper<ICFBamRelationObj> observable = new ReadOnlyObjectWrapper<ICFBamRelationObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupRelation.setCellFactory( new Callback<TableColumn<ICFBamDelSubDep1Obj, ICFBamRelationObj>, TableCell<ICFBamDelSubDep1Obj, ICFBamRelationObj>>() { @Override public TableCell<ICFBamDelSubDep1Obj, ICFBamRelationObj> call( TableColumn<ICFBamDelSubDep1Obj, ICFBamRelationObj> arg) { return new CFReferenceTableCell<ICFBamDelSubDep1Obj, ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnLookupRelation); tableColumnLookupDefSchema = new TableColumn<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj> p) { ICFBamDelSubDep1Obj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema(); ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupDefSchema.setCellFactory( new Callback<TableColumn<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj>, TableCell<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj> call( TableColumn<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamDelSubDep1Obj>() { @Override public void changed(ObservableValue<? extends ICFBamDelSubDep1Obj> observable, ICFBamDelSubDep1Obj oldValue, ICFBamDelSubDep1Obj newValue) { setJavaFXFocus(newValue); } }); scrollMenu = new ScrollPane(); scrollMenu.setVbarPolicy(ScrollBarPolicy.NEVER); scrollMenu.setHbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollMenu.setFitToHeight(true); scrollMenu.setContent(getPanelHBoxMenu()); setTop(scrollMenu); setCenter(dataTable); javafxIsInitializing = false; if (observableListOfDelSubDep1 != null) { dataTable.setItems(observableListOfDelSubDep1); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXPopSubDep1ListPane.java
public CFBamJavaFXPopSubDep1ListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamPopTopDepObj argContainer, ICFBamPopSubDep1Obj argFocus, Collection<ICFBamPopSubDep1Obj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();/*from w ww . jav a2s .c o m*/ final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamPopSubDep1Obj>(); tableColumnId = new TableColumn<ICFBamPopSubDep1Obj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamPopSubDep1Obj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamPopSubDep1Obj, Long> p) { ICFBamScopeObj obj = p.getValue(); if (obj == null) { return (null); } else { long value = obj.getRequiredId(); Long wrapped = new Long(value); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(wrapped); return (observable); } } }); tableColumnId.setCellFactory( new Callback<TableColumn<ICFBamPopSubDep1Obj, Long>, TableCell<ICFBamPopSubDep1Obj, Long>>() { @Override public TableCell<ICFBamPopSubDep1Obj, Long> call(TableColumn<ICFBamPopSubDep1Obj, Long> arg) { return new CFInt64TableCell<ICFBamPopSubDep1Obj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamPopSubDep1Obj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamPopSubDep1Obj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamPopSubDep1Obj, String> p) { ICFBamPopSubDep1Obj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getRequiredName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnName.setCellFactory( new Callback<TableColumn<ICFBamPopSubDep1Obj, String>, TableCell<ICFBamPopSubDep1Obj, String>>() { @Override public TableCell<ICFBamPopSubDep1Obj, String> call( TableColumn<ICFBamPopSubDep1Obj, String> arg) { return new CFStringTableCell<ICFBamPopSubDep1Obj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnLookupRelation = new TableColumn<ICFBamPopSubDep1Obj, ICFBamRelationObj>("Relation"); tableColumnLookupRelation.setCellValueFactory( new Callback<CellDataFeatures<ICFBamPopSubDep1Obj, ICFBamRelationObj>, ObservableValue<ICFBamRelationObj>>() { public ObservableValue<ICFBamRelationObj> call( CellDataFeatures<ICFBamPopSubDep1Obj, ICFBamRelationObj> p) { ICFBamPopSubDep1Obj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamRelationObj ref = obj.getRequiredLookupRelation(); ReadOnlyObjectWrapper<ICFBamRelationObj> observable = new ReadOnlyObjectWrapper<ICFBamRelationObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupRelation.setCellFactory( new Callback<TableColumn<ICFBamPopSubDep1Obj, ICFBamRelationObj>, TableCell<ICFBamPopSubDep1Obj, ICFBamRelationObj>>() { @Override public TableCell<ICFBamPopSubDep1Obj, ICFBamRelationObj> call( TableColumn<ICFBamPopSubDep1Obj, ICFBamRelationObj> arg) { return new CFReferenceTableCell<ICFBamPopSubDep1Obj, ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnLookupRelation); tableColumnLookupDefSchema = new TableColumn<ICFBamPopSubDep1Obj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamPopSubDep1Obj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamPopSubDep1Obj, ICFBamSchemaDefObj> p) { ICFBamPopSubDep1Obj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema(); ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupDefSchema.setCellFactory( new Callback<TableColumn<ICFBamPopSubDep1Obj, ICFBamSchemaDefObj>, TableCell<ICFBamPopSubDep1Obj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamPopSubDep1Obj, ICFBamSchemaDefObj> call( TableColumn<ICFBamPopSubDep1Obj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamPopSubDep1Obj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamPopSubDep1Obj>() { @Override public void changed(ObservableValue<? extends ICFBamPopSubDep1Obj> observable, ICFBamPopSubDep1Obj oldValue, ICFBamPopSubDep1Obj newValue) { setJavaFXFocus(newValue); } }); scrollMenu = new ScrollPane(); scrollMenu.setVbarPolicy(ScrollBarPolicy.NEVER); scrollMenu.setHbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollMenu.setFitToHeight(true); scrollMenu.setContent(getPanelHBoxMenu()); setTop(scrollMenu); setCenter(dataTable); javafxIsInitializing = false; if (observableListOfPopSubDep1 != null) { dataTable.setItems(observableListOfPopSubDep1); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXDelSubDep2ListPane.java
public CFBamJavaFXDelSubDep2ListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamDelSubDep1Obj argContainer, ICFBamDelSubDep2Obj argFocus, Collection<ICFBamDelSubDep2Obj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();// www . ja v a 2 s . co m final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamDelSubDep2Obj>(); tableColumnId = new TableColumn<ICFBamDelSubDep2Obj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDelSubDep2Obj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamDelSubDep2Obj, Long> p) { ICFBamScopeObj obj = p.getValue(); if (obj == null) { return (null); } else { long value = obj.getRequiredId(); Long wrapped = new Long(value); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(wrapped); return (observable); } } }); tableColumnId.setCellFactory( new Callback<TableColumn<ICFBamDelSubDep2Obj, Long>, TableCell<ICFBamDelSubDep2Obj, Long>>() { @Override public TableCell<ICFBamDelSubDep2Obj, Long> call(TableColumn<ICFBamDelSubDep2Obj, Long> arg) { return new CFInt64TableCell<ICFBamDelSubDep2Obj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamDelSubDep2Obj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDelSubDep2Obj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamDelSubDep2Obj, String> p) { ICFBamDelSubDep2Obj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getRequiredName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnName.setCellFactory( new Callback<TableColumn<ICFBamDelSubDep2Obj, String>, TableCell<ICFBamDelSubDep2Obj, String>>() { @Override public TableCell<ICFBamDelSubDep2Obj, String> call( TableColumn<ICFBamDelSubDep2Obj, String> arg) { return new CFStringTableCell<ICFBamDelSubDep2Obj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnLookupRelation = new TableColumn<ICFBamDelSubDep2Obj, ICFBamRelationObj>("Relation"); tableColumnLookupRelation.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDelSubDep2Obj, ICFBamRelationObj>, ObservableValue<ICFBamRelationObj>>() { public ObservableValue<ICFBamRelationObj> call( CellDataFeatures<ICFBamDelSubDep2Obj, ICFBamRelationObj> p) { ICFBamDelSubDep2Obj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamRelationObj ref = obj.getRequiredLookupRelation(); ReadOnlyObjectWrapper<ICFBamRelationObj> observable = new ReadOnlyObjectWrapper<ICFBamRelationObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupRelation.setCellFactory( new Callback<TableColumn<ICFBamDelSubDep2Obj, ICFBamRelationObj>, TableCell<ICFBamDelSubDep2Obj, ICFBamRelationObj>>() { @Override public TableCell<ICFBamDelSubDep2Obj, ICFBamRelationObj> call( TableColumn<ICFBamDelSubDep2Obj, ICFBamRelationObj> arg) { return new CFReferenceTableCell<ICFBamDelSubDep2Obj, ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnLookupRelation); tableColumnLookupDefSchema = new TableColumn<ICFBamDelSubDep2Obj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDelSubDep2Obj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamDelSubDep2Obj, ICFBamSchemaDefObj> p) { ICFBamDelSubDep2Obj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema(); ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupDefSchema.setCellFactory( new Callback<TableColumn<ICFBamDelSubDep2Obj, ICFBamSchemaDefObj>, TableCell<ICFBamDelSubDep2Obj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamDelSubDep2Obj, ICFBamSchemaDefObj> call( TableColumn<ICFBamDelSubDep2Obj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamDelSubDep2Obj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamDelSubDep2Obj>() { @Override public void changed(ObservableValue<? extends ICFBamDelSubDep2Obj> observable, ICFBamDelSubDep2Obj oldValue, ICFBamDelSubDep2Obj newValue) { setJavaFXFocus(newValue); } }); scrollMenu = new ScrollPane(); scrollMenu.setVbarPolicy(ScrollBarPolicy.NEVER); scrollMenu.setHbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollMenu.setFitToHeight(true); scrollMenu.setContent(getPanelHBoxMenu()); setTop(scrollMenu); setCenter(dataTable); javafxIsInitializing = false; if (observableListOfDelSubDep2 != null) { dataTable.setItems(observableListOfDelSubDep2); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXDelSubDep3ListPane.java
public CFBamJavaFXDelSubDep3ListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamDelSubDep2Obj argContainer, ICFBamDelSubDep3Obj argFocus, Collection<ICFBamDelSubDep3Obj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();//from www . j a va 2s .c o m final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamDelSubDep3Obj>(); tableColumnId = new TableColumn<ICFBamDelSubDep3Obj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDelSubDep3Obj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamDelSubDep3Obj, Long> p) { ICFBamScopeObj obj = p.getValue(); if (obj == null) { return (null); } else { long value = obj.getRequiredId(); Long wrapped = new Long(value); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(wrapped); return (observable); } } }); tableColumnId.setCellFactory( new Callback<TableColumn<ICFBamDelSubDep3Obj, Long>, TableCell<ICFBamDelSubDep3Obj, Long>>() { @Override public TableCell<ICFBamDelSubDep3Obj, Long> call(TableColumn<ICFBamDelSubDep3Obj, Long> arg) { return new CFInt64TableCell<ICFBamDelSubDep3Obj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamDelSubDep3Obj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDelSubDep3Obj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamDelSubDep3Obj, String> p) { ICFBamDelSubDep3Obj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getRequiredName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnName.setCellFactory( new Callback<TableColumn<ICFBamDelSubDep3Obj, String>, TableCell<ICFBamDelSubDep3Obj, String>>() { @Override public TableCell<ICFBamDelSubDep3Obj, String> call( TableColumn<ICFBamDelSubDep3Obj, String> arg) { return new CFStringTableCell<ICFBamDelSubDep3Obj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnLookupRelation = new TableColumn<ICFBamDelSubDep3Obj, ICFBamRelationObj>("Relation"); tableColumnLookupRelation.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDelSubDep3Obj, ICFBamRelationObj>, ObservableValue<ICFBamRelationObj>>() { public ObservableValue<ICFBamRelationObj> call( CellDataFeatures<ICFBamDelSubDep3Obj, ICFBamRelationObj> p) { ICFBamDelSubDep3Obj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamRelationObj ref = obj.getRequiredLookupRelation(); ReadOnlyObjectWrapper<ICFBamRelationObj> observable = new ReadOnlyObjectWrapper<ICFBamRelationObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupRelation.setCellFactory( new Callback<TableColumn<ICFBamDelSubDep3Obj, ICFBamRelationObj>, TableCell<ICFBamDelSubDep3Obj, ICFBamRelationObj>>() { @Override public TableCell<ICFBamDelSubDep3Obj, ICFBamRelationObj> call( TableColumn<ICFBamDelSubDep3Obj, ICFBamRelationObj> arg) { return new CFReferenceTableCell<ICFBamDelSubDep3Obj, ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnLookupRelation); tableColumnLookupDefSchema = new TableColumn<ICFBamDelSubDep3Obj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDelSubDep3Obj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamDelSubDep3Obj, ICFBamSchemaDefObj> p) { ICFBamDelSubDep3Obj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema(); ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupDefSchema.setCellFactory( new Callback<TableColumn<ICFBamDelSubDep3Obj, ICFBamSchemaDefObj>, TableCell<ICFBamDelSubDep3Obj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamDelSubDep3Obj, ICFBamSchemaDefObj> call( TableColumn<ICFBamDelSubDep3Obj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamDelSubDep3Obj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamDelSubDep3Obj>() { @Override public void changed(ObservableValue<? extends ICFBamDelSubDep3Obj> observable, ICFBamDelSubDep3Obj oldValue, ICFBamDelSubDep3Obj newValue) { setJavaFXFocus(newValue); } }); scrollMenu = new ScrollPane(); scrollMenu.setVbarPolicy(ScrollBarPolicy.NEVER); scrollMenu.setHbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollMenu.setFitToHeight(true); scrollMenu.setContent(getPanelHBoxMenu()); setTop(scrollMenu); setCenter(dataTable); javafxIsInitializing = false; if (observableListOfDelSubDep3 != null) { dataTable.setItems(observableListOfDelSubDep3); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXPopSubDep2ListPane.java
public CFBamJavaFXPopSubDep2ListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamPopSubDep1Obj argContainer, ICFBamPopSubDep2Obj argFocus, Collection<ICFBamPopSubDep2Obj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();/* w w w . j a v a2s . c o m*/ final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamPopSubDep2Obj>(); tableColumnId = new TableColumn<ICFBamPopSubDep2Obj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamPopSubDep2Obj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamPopSubDep2Obj, Long> p) { ICFBamScopeObj obj = p.getValue(); if (obj == null) { return (null); } else { long value = obj.getRequiredId(); Long wrapped = new Long(value); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(wrapped); return (observable); } } }); tableColumnId.setCellFactory( new Callback<TableColumn<ICFBamPopSubDep2Obj, Long>, TableCell<ICFBamPopSubDep2Obj, Long>>() { @Override public TableCell<ICFBamPopSubDep2Obj, Long> call(TableColumn<ICFBamPopSubDep2Obj, Long> arg) { return new CFInt64TableCell<ICFBamPopSubDep2Obj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamPopSubDep2Obj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamPopSubDep2Obj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamPopSubDep2Obj, String> p) { ICFBamPopSubDep2Obj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getRequiredName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnName.setCellFactory( new Callback<TableColumn<ICFBamPopSubDep2Obj, String>, TableCell<ICFBamPopSubDep2Obj, String>>() { @Override public TableCell<ICFBamPopSubDep2Obj, String> call( TableColumn<ICFBamPopSubDep2Obj, String> arg) { return new CFStringTableCell<ICFBamPopSubDep2Obj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnLookupRelation = new TableColumn<ICFBamPopSubDep2Obj, ICFBamRelationObj>("Relation"); tableColumnLookupRelation.setCellValueFactory( new Callback<CellDataFeatures<ICFBamPopSubDep2Obj, ICFBamRelationObj>, ObservableValue<ICFBamRelationObj>>() { public ObservableValue<ICFBamRelationObj> call( CellDataFeatures<ICFBamPopSubDep2Obj, ICFBamRelationObj> p) { ICFBamPopSubDep2Obj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamRelationObj ref = obj.getRequiredLookupRelation(); ReadOnlyObjectWrapper<ICFBamRelationObj> observable = new ReadOnlyObjectWrapper<ICFBamRelationObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupRelation.setCellFactory( new Callback<TableColumn<ICFBamPopSubDep2Obj, ICFBamRelationObj>, TableCell<ICFBamPopSubDep2Obj, ICFBamRelationObj>>() { @Override public TableCell<ICFBamPopSubDep2Obj, ICFBamRelationObj> call( TableColumn<ICFBamPopSubDep2Obj, ICFBamRelationObj> arg) { return new CFReferenceTableCell<ICFBamPopSubDep2Obj, ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnLookupRelation); tableColumnLookupDefSchema = new TableColumn<ICFBamPopSubDep2Obj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamPopSubDep2Obj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamPopSubDep2Obj, ICFBamSchemaDefObj> p) { ICFBamPopSubDep2Obj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema(); ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupDefSchema.setCellFactory( new Callback<TableColumn<ICFBamPopSubDep2Obj, ICFBamSchemaDefObj>, TableCell<ICFBamPopSubDep2Obj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamPopSubDep2Obj, ICFBamSchemaDefObj> call( TableColumn<ICFBamPopSubDep2Obj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamPopSubDep2Obj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamPopSubDep2Obj>() { @Override public void changed(ObservableValue<? extends ICFBamPopSubDep2Obj> observable, ICFBamPopSubDep2Obj oldValue, ICFBamPopSubDep2Obj newValue) { setJavaFXFocus(newValue); } }); scrollMenu = new ScrollPane(); scrollMenu.setVbarPolicy(ScrollBarPolicy.NEVER); scrollMenu.setHbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollMenu.setFitToHeight(true); scrollMenu.setContent(getPanelHBoxMenu()); setTop(scrollMenu); setCenter(dataTable); javafxIsInitializing = false; if (observableListOfPopSubDep2 != null) { dataTable.setItems(observableListOfPopSubDep2); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXPopSubDep3ListPane.java
public CFBamJavaFXPopSubDep3ListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamPopSubDep2Obj argContainer, ICFBamPopSubDep3Obj argFocus, Collection<ICFBamPopSubDep3Obj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();/* ww w . ja va2s . c om*/ final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamPopSubDep3Obj>(); tableColumnId = new TableColumn<ICFBamPopSubDep3Obj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamPopSubDep3Obj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamPopSubDep3Obj, 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<ICFBamPopSubDep3Obj, Long>, TableCell<ICFBamPopSubDep3Obj, Long>>() { @Override public TableCell<ICFBamPopSubDep3Obj, Long> call(TableColumn<ICFBamPopSubDep3Obj, Long> arg) { return new CFInt64TableCell<ICFBamPopSubDep3Obj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamPopSubDep3Obj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamPopSubDep3Obj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamPopSubDep3Obj, String> p) { ICFBamPopSubDep3Obj 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<ICFBamPopSubDep3Obj, String>, TableCell<ICFBamPopSubDep3Obj, String>>() { @Override public TableCell<ICFBamPopSubDep3Obj, String> call( TableColumn<ICFBamPopSubDep3Obj, String> arg) { return new CFStringTableCell<ICFBamPopSubDep3Obj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnLookupRelation = new TableColumn<ICFBamPopSubDep3Obj, ICFBamRelationObj>("Relation"); tableColumnLookupRelation.setCellValueFactory( new Callback<CellDataFeatures<ICFBamPopSubDep3Obj, ICFBamRelationObj>, ObservableValue<ICFBamRelationObj>>() { public ObservableValue<ICFBamRelationObj> call( CellDataFeatures<ICFBamPopSubDep3Obj, ICFBamRelationObj> p) { ICFBamPopSubDep3Obj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamRelationObj ref = obj.getRequiredLookupRelation(); ReadOnlyObjectWrapper<ICFBamRelationObj> observable = new ReadOnlyObjectWrapper<ICFBamRelationObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupRelation.setCellFactory( new Callback<TableColumn<ICFBamPopSubDep3Obj, ICFBamRelationObj>, TableCell<ICFBamPopSubDep3Obj, ICFBamRelationObj>>() { @Override public TableCell<ICFBamPopSubDep3Obj, ICFBamRelationObj> call( TableColumn<ICFBamPopSubDep3Obj, ICFBamRelationObj> arg) { return new CFReferenceTableCell<ICFBamPopSubDep3Obj, ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnLookupRelation); tableColumnLookupDefSchema = new TableColumn<ICFBamPopSubDep3Obj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamPopSubDep3Obj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamPopSubDep3Obj, ICFBamSchemaDefObj> p) { ICFBamPopSubDep3Obj 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<ICFBamPopSubDep3Obj, ICFBamSchemaDefObj>, TableCell<ICFBamPopSubDep3Obj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamPopSubDep3Obj, ICFBamSchemaDefObj> call( TableColumn<ICFBamPopSubDep3Obj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamPopSubDep3Obj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamPopSubDep3Obj>() { @Override public void changed(ObservableValue<? extends ICFBamPopSubDep3Obj> observable, ICFBamPopSubDep3Obj oldValue, ICFBamPopSubDep3Obj newValue) { setJavaFXFocus(newValue); } }); scrollMenu = new ScrollPane(); scrollMenu.setVbarPolicy(ScrollBarPolicy.NEVER); scrollMenu.setHbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollMenu.setFitToHeight(true); scrollMenu.setContent(getPanelHBoxMenu()); setTop(scrollMenu); setCenter(dataTable); javafxIsInitializing = false; if (observableListOfPopSubDep3 != null) { dataTable.setItems(observableListOfPopSubDep3); } adjustListButtons(); }
From source file:com.panemu.tiwulfx.control.skin.LookupFieldSkin.java
private void createPopup() { popup = new PopupControl() { {//www . jav a 2s.c om setSkin(new Skin() { @Override public Skinnable getSkinnable() { return LookupFieldSkin.this.lookupField; } @Override public Node getNode() { return listView; } @Override public void dispose() { } }); } }; popup.setAutoHide(true); popup.setAutoFix(true); popup.setHideOnEscape(true); popup.addEventHandler(MouseEvent.MOUSE_CLICKED, new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent t) { popup.hide(); } }); listView.setCellFactory(new Callback() { @Override public Object call(Object p) { return new PropertyListCell(lookupField.getPropertyName()); } }); /** * Taken from * {@link com.sun.javafx.scene.control.skin.ComboBoxListViewSkin} */ listView.addEventFilter(MouseEvent.MOUSE_RELEASED, new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent t) { // RT-18672: Without checking if the user is clicking in the // scrollbar area of the ListView, the comboBox will hide. Therefore, // we add the check below to prevent this from happening. EventTarget target = t.getTarget(); if (target instanceof Parent) { List<String> s = ((Parent) target).getStyleClass(); if (s.contains("thumb") || s.contains("track") || s.contains("decrement-arrow") || s.contains("increment-arrow")) { return; } } needValidation = false; lookupField.setValue(listView.getSelectionModel().getSelectedItem()); popup.hide(); } }); listView.setOnKeyPressed(new EventHandler<KeyEvent>() { @Override public void handle(KeyEvent t) { if (t.getCode() == KeyCode.ENTER) { needValidation = false; lookupField.setValue(listView.getSelectionModel().getSelectedItem()); popup.hide(); } else if (t.getCode() == KeyCode.ESCAPE) { popup.hide(); } } }); }
From source file:gov.va.isaac.gui.preferences.plugins.properties.PreferencesPluginComboBoxProperty.java
/** * @param name//from www. j a v a 2 s . c o m * @param stringConverter * * Constructor for ComboBox that displays a String * that must be derived/converted from its underlying value * * Allows a preexisting Label to be used */ protected PreferencesPluginComboBoxProperty(Label label, StringConverter<T> stringConverter) { super(label, new ComboBox<T>(), new SimpleObjectProperty<T>(), null, // validator handled below stringConverter, new PropertyAction<T, ComboBox<T>>() { @Override public void apply(PreferencesPluginProperty<T, ComboBox<T>> property) { property.getProperty() .bind(property.getControl().getSelectionModel().selectedItemProperty()); } }, new PropertyAction<T, ComboBox<T>>() { @Override public void apply(PreferencesPluginProperty<T, ComboBox<T>> property) { property.getControl().getSelectionModel().select(property.readFromPersistedPreferences()); } }, new PropertyAction<T, ComboBox<T>>() { @Override public void apply(PreferencesPluginProperty<T, ComboBox<T>> property) { GridPane.setHgrow(property.getLabel(), Priority.NEVER); GridPane.setFillWidth(property.getControl(), true); GridPane.setHgrow(property.getControl(), Priority.ALWAYS); } }); validator = new ValidBooleanBinding() { { bind(getProperty()); setComputeOnInvalidate(true); } @Override protected boolean computeValue() { if (getProperty().getValue() == null) { this.setInvalidReason("null/unset/unselected " + name); logger.debug(getReasonWhyInvalid().get()); TextErrorColorHelper.setTextErrorColor(label); return false; } else { TextErrorColorHelper.clearTextErrorColor(label); } if (StringUtils.isEmpty(getStringConverter().convertToString(getProperty().getValue()))) { this.setInvalidReason("Invalid " + name); logger.debug(getReasonWhyInvalid().get()); TextErrorColorHelper.setTextErrorColor(label); return false; } else { TextErrorColorHelper.clearTextErrorColor(label); } this.clearInvalidReason(); return true; } }; control.setCellFactory(new Callback<ListView<T>, ListCell<T>>() { @Override public ListCell<T> call(ListView<T> param) { final ListCell<T> cell = new ListCell<T>() { @Override protected void updateItem(T c, boolean emptyRow) { super.updateItem(c, emptyRow); if (c == null) { setText(null); } else { String diplay = getStringConverter().convertToString(c); setText(diplay); } } }; return cell; } }); control.setButtonCell(new ListCell<T>() { @Override protected void updateItem(T c, boolean emptyRow) { super.updateItem(c, emptyRow); if (emptyRow) { setText(""); } else { String diplay = getStringConverter().convertToString(c); setText(diplay); } } }); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXBoolColPickerPane.java
public CFBamJavaFXBoolColPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamBoolColObj argFocus, ICFBamTableObj argContainer, Collection<ICFBamBoolColObj> argDataCollection, ICFBamJavaFXBoolColChosen whenChosen) { super();//from w ww . j a v a 2 s.c o m final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } if (whenChosen == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6, "whenChosen"); } invokeWhenChosen = whenChosen; // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamBoolColObj>(); tableColumnId = new TableColumn<ICFBamBoolColObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamBoolColObj, 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<ICFBamBoolColObj, Long>, TableCell<ICFBamBoolColObj, Long>>() { @Override public TableCell<ICFBamBoolColObj, Long> call(TableColumn<ICFBamBoolColObj, Long> arg) { return new CFInt64TableCell<ICFBamBoolColObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamBoolColObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBoolColObj, 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<ICFBamBoolColObj, String>, TableCell<ICFBamBoolColObj, String>>() { @Override public TableCell<ICFBamBoolColObj, String> call(TableColumn<ICFBamBoolColObj, String> arg) { return new CFStringTableCell<ICFBamBoolColObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamBoolColObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBoolColObj, 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<ICFBamBoolColObj, String>, TableCell<ICFBamBoolColObj, String>>() { @Override public TableCell<ICFBamBoolColObj, String> call(TableColumn<ICFBamBoolColObj, String> arg) { return new CFStringTableCell<ICFBamBoolColObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamBoolColObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBoolColObj, 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<ICFBamBoolColObj, String>, TableCell<ICFBamBoolColObj, String>>() { @Override public TableCell<ICFBamBoolColObj, String> call(TableColumn<ICFBamBoolColObj, String> arg) { return new CFStringTableCell<ICFBamBoolColObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamBoolColObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBoolColObj, 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<ICFBamBoolColObj, String>, TableCell<ICFBamBoolColObj, String>>() { @Override public TableCell<ICFBamBoolColObj, String> call(TableColumn<ICFBamBoolColObj, String> arg) { return new CFStringTableCell<ICFBamBoolColObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamBoolColObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBoolColObj, 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<ICFBamBoolColObj, String>, TableCell<ICFBamBoolColObj, String>>() { @Override public TableCell<ICFBamBoolColObj, String> call(TableColumn<ICFBamBoolColObj, String> arg) { return new CFStringTableCell<ICFBamBoolColObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamBoolColObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBoolColObj, 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<ICFBamBoolColObj, Boolean>, TableCell<ICFBamBoolColObj, Boolean>>() { @Override public TableCell<ICFBamBoolColObj, Boolean> call(TableColumn<ICFBamBoolColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamBoolColObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamBoolColObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBoolColObj, 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<ICFBamBoolColObj, Boolean>, TableCell<ICFBamBoolColObj, Boolean>>() { @Override public TableCell<ICFBamBoolColObj, Boolean> call(TableColumn<ICFBamBoolColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamBoolColObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamBoolColObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBoolColObj, 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<ICFBamBoolColObj, Boolean>, TableCell<ICFBamBoolColObj, Boolean>>() { @Override public TableCell<ICFBamBoolColObj, Boolean> call(TableColumn<ICFBamBoolColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamBoolColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamBoolColObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBoolColObj, 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<ICFBamBoolColObj, String>, TableCell<ICFBamBoolColObj, String>>() { @Override public TableCell<ICFBamBoolColObj, String> call(TableColumn<ICFBamBoolColObj, String> arg) { return new CFStringTableCell<ICFBamBoolColObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamBoolColObj, Boolean>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBoolColObj, Boolean> p) { ICFBamBoolDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Boolean value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamBoolColObj, Boolean>, TableCell<ICFBamBoolColObj, Boolean>>() { @Override public TableCell<ICFBamBoolColObj, Boolean> call(TableColumn<ICFBamBoolColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamBoolColObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamBoolColObj, Boolean>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBoolColObj, Boolean> p) { ICFBamBoolDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Boolean value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamBoolColObj, Boolean>, TableCell<ICFBamBoolColObj, Boolean>>() { @Override public TableCell<ICFBamBoolColObj, Boolean> call(TableColumn<ICFBamBoolColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamBoolColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnFalseString = new TableColumn<ICFBamBoolColObj, String>("FalseString"); tableColumnFalseString.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBoolColObj, String> p) { ICFBamBoolDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalFalseString(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnFalseString.setCellFactory( new Callback<TableColumn<ICFBamBoolColObj, String>, TableCell<ICFBamBoolColObj, String>>() { @Override public TableCell<ICFBamBoolColObj, String> call(TableColumn<ICFBamBoolColObj, String> arg) { return new CFStringTableCell<ICFBamBoolColObj>(); } }); dataTable.getColumns().add(tableColumnFalseString); tableColumnTrueString = new TableColumn<ICFBamBoolColObj, String>("TrueString"); tableColumnTrueString.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBoolColObj, String> p) { ICFBamBoolDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalTrueString(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnTrueString.setCellFactory( new Callback<TableColumn<ICFBamBoolColObj, String>, TableCell<ICFBamBoolColObj, String>>() { @Override public TableCell<ICFBamBoolColObj, String> call(TableColumn<ICFBamBoolColObj, String> arg) { return new CFStringTableCell<ICFBamBoolColObj>(); } }); dataTable.getColumns().add(tableColumnTrueString); tableColumnNullString = new TableColumn<ICFBamBoolColObj, String>("NullString"); tableColumnNullString.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBoolColObj, String> p) { ICFBamBoolDefObj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getOptionalNullString(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnNullString.setCellFactory( new Callback<TableColumn<ICFBamBoolColObj, String>, TableCell<ICFBamBoolColObj, String>>() { @Override public TableCell<ICFBamBoolColObj, String> call(TableColumn<ICFBamBoolColObj, String> arg) { return new CFStringTableCell<ICFBamBoolColObj>(); } }); dataTable.getColumns().add(tableColumnNullString); tableColumnLookupDefSchema = new TableColumn<ICFBamBoolColObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamBoolColObj, ICFBamSchemaDefObj> p) { ICFBamBoolColObj 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<ICFBamBoolColObj, ICFBamSchemaDefObj>, TableCell<ICFBamBoolColObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamBoolColObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamBoolColObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamBoolColObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamBoolColObj>() { @Override public void changed(ObservableValue<? extends ICFBamBoolColObj> observable, ICFBamBoolColObj oldValue, ICFBamBoolColObj 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.choseBoolCol(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"); } ICFBamBoolColObj selectedInstance = getJavaFXFocusAsBoolCol(); invokeWhenChosen.choseBoolCol(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); }