List of usage examples for javafx.beans.value ChangeListener ChangeListener
ChangeListener
From source file:dsfixgui.view.DSPWPane.java
private void initializeEventHandlers() { applySettingsButton.setOnAction(e -> { ui.applyDSPWConfig();/* w ww. j a va 2 s .c o m*/ }); restoreDefaultsButton.setOnAction(e -> { ContinueDialog cD = new ContinueDialog(300.0, 80.0, DIALOG_TITLE_RESET, DIALOG_MSG_RESTORE_SETTINGS, DIALOG_BUTTON_TEXTS[2], DIALOG_BUTTON_TEXTS[1]); if (cD.show()) { config.restoreDefaults(); ui.refreshUI(); } }); versionBannerOn.setOnAction(e -> { config.ShowVersionBanner.replace(0, config.ShowVersionBanner.length(), TRUE_FALSE[0]); }); versionBannerOff.setOnAction(e -> { config.ShowVersionBanner.replace(0, config.ShowVersionBanner.length(), TRUE_FALSE[1]); }); overlayOn.setOnAction(e -> { config.ShowOverlay.replace(0, config.ShowOverlay.length(), TRUE_FALSE[0]); }); overlayOff.setOnAction(e -> { config.ShowOverlay.replace(0, config.ShowOverlay.length(), TRUE_FALSE[1]); }); invasionNotifOn.setOnAction(e -> { config.InvasionSoundNotification.replace(0, config.InvasionSoundNotification.length(), TRUE_FALSE[0]); }); invasionNotifOff.setOnAction(e -> { config.InvasionSoundNotification.replace(0, config.InvasionSoundNotification.length(), TRUE_FALSE[1]); }); cheaterNotifOn.setOnAction(e -> { config.CheaterSoundNotification.replace(0, config.CheaterSoundNotification.length(), TRUE_FALSE[0]); }); cheaterNotifOff.setOnAction(e -> { config.CheaterSoundNotification.replace(0, config.CheaterSoundNotification.length(), TRUE_FALSE[1]); }); blockArenaFreezeOn.setOnAction(e -> { config.BlockArenaFreeze.replace(0, config.BlockArenaFreeze.length(), TRUE_FALSE[0]); }); blockArenaFreezeOff.setOnAction(e -> { config.BlockArenaFreeze.replace(0, config.BlockArenaFreeze.length(), TRUE_FALSE[1]); }); nodeCountOn.setOnAction(e -> { config.ShowNodeDbCount.replace(0, config.ShowNodeDbCount.length(), TRUE_FALSE[0]); }); nodeCountOff.setOnAction(e -> { config.ShowNodeDbCount.replace(0, config.ShowNodeDbCount.length(), TRUE_FALSE[1]); }); increaseNodesOn.setOnAction(e -> { config.IncreaseNodeDbLimit.replace(0, config.IncreaseNodeDbLimit.length(), TRUE_FALSE[0]); }); increaseNodesOff.setOnAction(e -> { config.IncreaseNodeDbLimit.replace(0, config.IncreaseNodeDbLimit.length(), TRUE_FALSE[1]); }); dateOn.setOnAction(e -> { config.DisplayDate.replace(0, config.DisplayDate.length(), TRUE_FALSE[0]); }); dateOff.setOnAction(e -> { config.DisplayDate.replace(0, config.DisplayDate.length(), TRUE_FALSE[1]); }); timeOn.setOnAction(e -> { config.DisplayClock.replace(0, config.DisplayClock.length(), TRUE_FALSE[0]); }); timeOff.setOnAction(e -> { config.DisplayClock.replace(0, config.DisplayClock.length(), TRUE_FALSE[1]); }); updateOn.setOnAction(e -> { config.CheckForUpdates.replace(0, config.CheckForUpdates.length(), TRUE_FALSE[0]); }); updateOff.setOnAction(e -> { config.CheckForUpdates.replace(0, config.CheckForUpdates.length(), TRUE_FALSE[1]); }); textAlignmentLeft.setOnAction(e -> { config.TextAlignment.replace(0, config.TextAlignment.length(), DSPW_TEXT_ALIGNMENT_OPTIONS[0]); }); textAlignmentCenter.setOnAction(e -> { config.TextAlignment.replace(0, config.TextAlignment.length(), DSPW_TEXT_ALIGNMENT_OPTIONS[1]); }); textAlignmentRight.setOnAction(e -> { config.TextAlignment.replace(0, config.TextAlignment.length(), DSPW_TEXT_ALIGNMENT_OPTIONS[2]); }); fontSizeField.textProperty().addListener(new ChangeListener<String>() { @Override public void changed(ObservableValue<? extends String> observable, String oldText, String newText) { try { if (!NumberUtils.isParsable(newText) || Integer.parseInt(newText) > 72 || Integer.parseInt(newText) < 15) { fontSizeField.pseudoClassStateChanged(INVALID_INPUT, true); } else { fontSizeField.pseudoClassStateChanged(INVALID_INPUT, false); config.FontSize.replace(0, config.FontSize.length(), "" + Integer.parseInt(newText)); } } catch (NumberFormatException nFE) { ui.printConsole(INPUT_TOO_LARGE); fontSizeField.setText(""); } } }); dllChainButton.setOnAction(e -> { FileChooser dllChooser = new FileChooser(); dllChooser.setTitle(DIALOG_TITLE_DLL); if (ui.getDataFolder() != null) { dllChooser.setInitialDirectory(ui.getDataFolder()); } ExtensionFilter dllFilter = new ExtensionFilter(DLL_EXT_FILTER[0], DLL_EXT_FILTER[1]); dllChooser.getExtensionFilters().add(dllFilter); File dll = dllChooser.showOpenDialog(ui.getStage()); if (dll != null && ui.getDataFolder() != null) { File checkDLL = new File(ui.getDataFolder() + "\\" + dll.getName()); if (!checkDLL.exists()) { AlertDialog aD = new AlertDialog(300.0, 80.0, DIALOG_TITLE_WRONG_FOLDER, DLL_MUST_BE_IN_DATA, DIALOG_BUTTON_TEXTS[0]); } else { if (dll.getName().equals(DSM_FILES[0])) { AlertDialog aD = new AlertDialog(300.0, 80.0, INVALID_DLL, CANT_CHAIN_DLL_WITH_DSM, DIALOG_BUTTON_TEXTS[0]); } else if (dll.getName().equals(DSF_FILES[0])) { AlertDialog aD = new AlertDialog(300.0, 80.0, INVALID_DLL, CANT_CHAIN_DLL_WITH_DSF, DIALOG_BUTTON_TEXTS[0]); } else if (dll.getName().equals(DS_DEFAULT_DLLS[0]) || dll.getName().equals(DS_DEFAULT_DLLS[1]) || dll.getName().equals(DS_DEFAULT_DLLS[2])) { AlertDialog aD = new AlertDialog(300.0, 80.0, INVALID_DLL, CANT_CHAIN_DLL_WITH_DEFAULT, DIALOG_BUTTON_TEXTS[0]); } else if (dll.getName().equals(DSPW_FILES[1]) || dll.getName().equals(DSPW_FILES[4]) || dll.getName().equals(DSPW_FILES[5])) { AlertDialog aD = new AlertDialog(300.0, 80.0, INVALID_DLL, CANT_CHAIN_DSPW_WITH_DSPW, DIALOG_BUTTON_TEXTS[0]); } else { config.d3d9dllWrapper.replace(0, config.d3d9dllWrapper.length(), dll.getName()); dllChainField.setText(dll.getName()); dllChainField.setStyle("-fx-text-fill: black;"); noChainButton.setDisable(false); } } } }); noChainButton.setOnAction(e -> { dllChainField.setText(NONE); noChainButton.setDisable(true); dllChainField.setStyle("-fx-text-fill: gray;"); config.d3d9dllWrapper.replace(0, config.d3d9dllWrapper.length(), NONE); }); banPicker.setOnAction(e -> { config.key_BanPhantom.replace(0, config.key_BanPhantom.length(), keybindsHex.get(keybinds.indexOf(banPicker.getValue()))); }); ignorePicker.setOnAction(e -> { config.key_IgnorePhantom.replace(0, config.key_IgnorePhantom.length(), keybindsHex.get(keybinds.indexOf(ignorePicker.getValue()))); }); toggleOverlayPicker.setOnAction(e -> { config.key_HideOverlay.replace(0, config.key_HideOverlay.length(), keybindsHex.get(keybinds.indexOf(toggleOverlayPicker.getValue()))); }); aboutPicker.setOnAction(e -> { config.key_AboutDSPW.replace(0, config.key_AboutDSPW.length(), keybindsHex.get(keybinds.indexOf(aboutPicker.getValue()))); }); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXTZTimeTypeListPane.java
public CFBamJavaFXTZTimeTypeListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamSchemaDefObj argContainer, ICFBamTZTimeTypeObj argFocus, Collection<ICFBamTZTimeTypeObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();// www . j av a 2 s .com final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamTZTimeTypeObj>(); tableColumnId = new TableColumn<ICFBamTZTimeTypeObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeTypeObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamTZTimeTypeObj, 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<ICFBamTZTimeTypeObj, Long>, TableCell<ICFBamTZTimeTypeObj, Long>>() { @Override public TableCell<ICFBamTZTimeTypeObj, Long> call(TableColumn<ICFBamTZTimeTypeObj, Long> arg) { return new CFInt64TableCell<ICFBamTZTimeTypeObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamTZTimeTypeObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeTypeObj, 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<ICFBamTZTimeTypeObj, String>, TableCell<ICFBamTZTimeTypeObj, String>>() { @Override public TableCell<ICFBamTZTimeTypeObj, String> call( TableColumn<ICFBamTZTimeTypeObj, String> arg) { return new CFStringTableCell<ICFBamTZTimeTypeObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamTZTimeTypeObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeTypeObj, 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<ICFBamTZTimeTypeObj, String>, TableCell<ICFBamTZTimeTypeObj, String>>() { @Override public TableCell<ICFBamTZTimeTypeObj, String> call( TableColumn<ICFBamTZTimeTypeObj, String> arg) { return new CFStringTableCell<ICFBamTZTimeTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamTZTimeTypeObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeTypeObj, 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<ICFBamTZTimeTypeObj, String>, TableCell<ICFBamTZTimeTypeObj, String>>() { @Override public TableCell<ICFBamTZTimeTypeObj, String> call( TableColumn<ICFBamTZTimeTypeObj, String> arg) { return new CFStringTableCell<ICFBamTZTimeTypeObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamTZTimeTypeObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeTypeObj, 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<ICFBamTZTimeTypeObj, String>, TableCell<ICFBamTZTimeTypeObj, String>>() { @Override public TableCell<ICFBamTZTimeTypeObj, String> call( TableColumn<ICFBamTZTimeTypeObj, String> arg) { return new CFStringTableCell<ICFBamTZTimeTypeObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamTZTimeTypeObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeTypeObj, 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<ICFBamTZTimeTypeObj, String>, TableCell<ICFBamTZTimeTypeObj, String>>() { @Override public TableCell<ICFBamTZTimeTypeObj, String> call( TableColumn<ICFBamTZTimeTypeObj, String> arg) { return new CFStringTableCell<ICFBamTZTimeTypeObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamTZTimeTypeObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimeTypeObj, 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<ICFBamTZTimeTypeObj, Boolean>, TableCell<ICFBamTZTimeTypeObj, Boolean>>() { @Override public TableCell<ICFBamTZTimeTypeObj, Boolean> call( TableColumn<ICFBamTZTimeTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZTimeTypeObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamTZTimeTypeObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimeTypeObj, 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<ICFBamTZTimeTypeObj, Boolean>, TableCell<ICFBamTZTimeTypeObj, Boolean>>() { @Override public TableCell<ICFBamTZTimeTypeObj, Boolean> call( TableColumn<ICFBamTZTimeTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZTimeTypeObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamTZTimeTypeObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeTypeObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimeTypeObj, 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<ICFBamTZTimeTypeObj, Boolean>, TableCell<ICFBamTZTimeTypeObj, Boolean>>() { @Override public TableCell<ICFBamTZTimeTypeObj, Boolean> call( TableColumn<ICFBamTZTimeTypeObj, Boolean> arg) { return new CFBoolTableCell<ICFBamTZTimeTypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamTZTimeTypeObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeTypeObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeTypeObj, 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<ICFBamTZTimeTypeObj, String>, TableCell<ICFBamTZTimeTypeObj, String>>() { @Override public TableCell<ICFBamTZTimeTypeObj, String> call( TableColumn<ICFBamTZTimeTypeObj, String> arg) { return new CFStringTableCell<ICFBamTZTimeTypeObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamTZTimeTypeObj, Calendar>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimeTypeObj, 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<ICFBamTZTimeTypeObj, Calendar>, TableCell<ICFBamTZTimeTypeObj, Calendar>>() { @Override public TableCell<ICFBamTZTimeTypeObj, Calendar> call( TableColumn<ICFBamTZTimeTypeObj, Calendar> arg) { return new CFTZTimeTableCell<ICFBamTZTimeTypeObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamTZTimeTypeObj, Calendar>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimeTypeObj, 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<ICFBamTZTimeTypeObj, Calendar>, TableCell<ICFBamTZTimeTypeObj, Calendar>>() { @Override public TableCell<ICFBamTZTimeTypeObj, Calendar> call( TableColumn<ICFBamTZTimeTypeObj, Calendar> arg) { return new CFTZTimeTableCell<ICFBamTZTimeTypeObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnNullValue = new TableColumn<ICFBamTZTimeTypeObj, Calendar>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimeTypeObj, 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<ICFBamTZTimeTypeObj, Calendar>, TableCell<ICFBamTZTimeTypeObj, Calendar>>() { @Override public TableCell<ICFBamTZTimeTypeObj, Calendar> call( TableColumn<ICFBamTZTimeTypeObj, Calendar> arg) { return new CFTZTimeTableCell<ICFBamTZTimeTypeObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamTZTimeTypeObj, Calendar>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeTypeObj, Calendar>, ObservableValue<Calendar>>() { public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimeTypeObj, 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<ICFBamTZTimeTypeObj, Calendar>, TableCell<ICFBamTZTimeTypeObj, Calendar>>() { @Override public TableCell<ICFBamTZTimeTypeObj, Calendar> call( TableColumn<ICFBamTZTimeTypeObj, Calendar> arg) { return new CFTZTimeTableCell<ICFBamTZTimeTypeObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamTZTimeTypeObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamTZTimeTypeObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamTZTimeTypeObj, ICFBamSchemaDefObj> p) { ICFBamTZTimeTypeObj 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<ICFBamTZTimeTypeObj, ICFBamSchemaDefObj>, TableCell<ICFBamTZTimeTypeObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamTZTimeTypeObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamTZTimeTypeObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamTZTimeTypeObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamTZTimeTypeObj>() { @Override public void changed(ObservableValue<? extends ICFBamTZTimeTypeObj> observable, ICFBamTZTimeTypeObj oldValue, ICFBamTZTimeTypeObj 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 (observableListOfTZTimeType != null) { dataTable.setItems(observableListOfTZTimeType); } adjustListButtons(); }
From source file:org.noroomattheinn.visibletesla.NotifierController.java
private void bindBidrectional(final BigDecimalField bdf, final Slider slider) { bdf.setFormat(new DecimalFormat("##0.0")); bdf.setStepwidth(BigDecimal.valueOf(0.5)); bdf.setNumber(new BigDecimal(Utils.round(slider.getValue(), 1))); slider.valueProperty().addListener(new ChangeListener<Number>() { @Override//ww w . j a v a2 s. c o m public void changed(ObservableValue<? extends Number> ov, Number t, Number t1) { double val = Utils.round(t1.doubleValue(), 1); slider.setValue(val); bdf.setNumber(new BigDecimal(val)); } }); bdf.numberProperty().addListener(new ChangeListener<BigDecimal>() { @Override public void changed(ObservableValue<? extends BigDecimal> ov, BigDecimal t, BigDecimal t1) { double val = Utils.round(t1.doubleValue(), 1); slider.setValue(val); bdf.setNumber(new BigDecimal(val)); } }); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXAtomListPane.java
public CFBamJavaFXAtomListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamScopeObj argContainer, ICFBamAtomObj argFocus, Collection<ICFBamAtomObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();/*from www . j ava 2s . c om*/ final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // 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<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); } }); 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 (observableListOfAtom != null) { dataTable.setItems(observableListOfAtom); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXBoolColListPane.java
public CFBamJavaFXBoolColListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamTableObj argContainer, ICFBamBoolColObj argFocus, Collection<ICFBamBoolColObj> argDataCollection, ICFRefreshCallback refreshCallback, boolean sortByChain) { super();/*from www . j a v a 2s . com*/ final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; javafxRefreshCallback = refreshCallback; javafxSortByChain = sortByChain; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<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); } }); 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 (observableListOfBoolCol != null) { dataTable.setItems(observableListOfBoolCol); } adjustListButtons(); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXUuidGenPickerPane.java
public CFBamJavaFXUuidGenPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamUuidGenObj argFocus, ICFBamSchemaDefObj argContainer, Collection<ICFBamUuidGenObj> argDataCollection, ICFBamJavaFXUuidGenChosen whenChosen) { super();/*from www . j a va 2s . c om*/ final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } if (whenChosen == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6, "whenChosen"); } invokeWhenChosen = whenChosen; // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamUuidGenObj>(); tableColumnId = new TableColumn<ICFBamUuidGenObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidGenObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamUuidGenObj, 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<ICFBamUuidGenObj, Long>, TableCell<ICFBamUuidGenObj, Long>>() { @Override public TableCell<ICFBamUuidGenObj, Long> call(TableColumn<ICFBamUuidGenObj, Long> arg) { return new CFInt64TableCell<ICFBamUuidGenObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamUuidGenObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidGenObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUuidGenObj, 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<ICFBamUuidGenObj, String>, TableCell<ICFBamUuidGenObj, String>>() { @Override public TableCell<ICFBamUuidGenObj, String> call(TableColumn<ICFBamUuidGenObj, String> arg) { return new CFStringTableCell<ICFBamUuidGenObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamUuidGenObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidGenObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUuidGenObj, 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<ICFBamUuidGenObj, String>, TableCell<ICFBamUuidGenObj, String>>() { @Override public TableCell<ICFBamUuidGenObj, String> call(TableColumn<ICFBamUuidGenObj, String> arg) { return new CFStringTableCell<ICFBamUuidGenObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamUuidGenObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidGenObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUuidGenObj, 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<ICFBamUuidGenObj, String>, TableCell<ICFBamUuidGenObj, String>>() { @Override public TableCell<ICFBamUuidGenObj, String> call(TableColumn<ICFBamUuidGenObj, String> arg) { return new CFStringTableCell<ICFBamUuidGenObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamUuidGenObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidGenObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUuidGenObj, 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<ICFBamUuidGenObj, String>, TableCell<ICFBamUuidGenObj, String>>() { @Override public TableCell<ICFBamUuidGenObj, String> call(TableColumn<ICFBamUuidGenObj, String> arg) { return new CFStringTableCell<ICFBamUuidGenObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamUuidGenObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidGenObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUuidGenObj, 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<ICFBamUuidGenObj, String>, TableCell<ICFBamUuidGenObj, String>>() { @Override public TableCell<ICFBamUuidGenObj, String> call(TableColumn<ICFBamUuidGenObj, String> arg) { return new CFStringTableCell<ICFBamUuidGenObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamUuidGenObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidGenObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUuidGenObj, 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<ICFBamUuidGenObj, Boolean>, TableCell<ICFBamUuidGenObj, Boolean>>() { @Override public TableCell<ICFBamUuidGenObj, Boolean> call(TableColumn<ICFBamUuidGenObj, Boolean> arg) { return new CFBoolTableCell<ICFBamUuidGenObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamUuidGenObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidGenObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUuidGenObj, 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<ICFBamUuidGenObj, Boolean>, TableCell<ICFBamUuidGenObj, Boolean>>() { @Override public TableCell<ICFBamUuidGenObj, Boolean> call(TableColumn<ICFBamUuidGenObj, Boolean> arg) { return new CFBoolTableCell<ICFBamUuidGenObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamUuidGenObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidGenObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUuidGenObj, 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<ICFBamUuidGenObj, Boolean>, TableCell<ICFBamUuidGenObj, Boolean>>() { @Override public TableCell<ICFBamUuidGenObj, Boolean> call(TableColumn<ICFBamUuidGenObj, Boolean> arg) { return new CFBoolTableCell<ICFBamUuidGenObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamUuidGenObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidGenObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamUuidGenObj, 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<ICFBamUuidGenObj, String>, TableCell<ICFBamUuidGenObj, String>>() { @Override public TableCell<ICFBamUuidGenObj, String> call(TableColumn<ICFBamUuidGenObj, String> arg) { return new CFStringTableCell<ICFBamUuidGenObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamUuidGenObj, UUID>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidGenObj, UUID>, ObservableValue<UUID>>() { public ObservableValue<UUID> call(CellDataFeatures<ICFBamUuidGenObj, UUID> p) { ICFBamUuidDefObj obj = p.getValue(); if (obj == null) { return (null); } else { UUID value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<UUID> observable = new ReadOnlyObjectWrapper<UUID>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamUuidGenObj, UUID>, TableCell<ICFBamUuidGenObj, UUID>>() { @Override public TableCell<ICFBamUuidGenObj, UUID> call(TableColumn<ICFBamUuidGenObj, UUID> arg) { return new CFUuidTableCell<ICFBamUuidGenObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamUuidGenObj, UUID>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidGenObj, UUID>, ObservableValue<UUID>>() { public ObservableValue<UUID> call(CellDataFeatures<ICFBamUuidGenObj, UUID> p) { ICFBamUuidDefObj obj = p.getValue(); if (obj == null) { return (null); } else { UUID value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<UUID> observable = new ReadOnlyObjectWrapper<UUID>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamUuidGenObj, UUID>, TableCell<ICFBamUuidGenObj, UUID>>() { @Override public TableCell<ICFBamUuidGenObj, UUID> call(TableColumn<ICFBamUuidGenObj, UUID> arg) { return new CFUuidTableCell<ICFBamUuidGenObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnNullValue = new TableColumn<ICFBamUuidGenObj, UUID>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidGenObj, UUID>, ObservableValue<UUID>>() { public ObservableValue<UUID> call(CellDataFeatures<ICFBamUuidGenObj, UUID> p) { ICFBamUuidDefObj obj = p.getValue(); if (obj == null) { return (null); } else { UUID value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<UUID> observable = new ReadOnlyObjectWrapper<UUID>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamUuidGenObj, UUID>, TableCell<ICFBamUuidGenObj, UUID>>() { @Override public TableCell<ICFBamUuidGenObj, UUID> call(TableColumn<ICFBamUuidGenObj, UUID> arg) { return new CFUuidTableCell<ICFBamUuidGenObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamUuidGenObj, UUID>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidGenObj, UUID>, ObservableValue<UUID>>() { public ObservableValue<UUID> call(CellDataFeatures<ICFBamUuidGenObj, UUID> p) { ICFBamUuidDefObj obj = p.getValue(); if (obj == null) { return (null); } else { UUID value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<UUID> observable = new ReadOnlyObjectWrapper<UUID>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamUuidGenObj, UUID>, TableCell<ICFBamUuidGenObj, UUID>>() { @Override public TableCell<ICFBamUuidGenObj, UUID> call(TableColumn<ICFBamUuidGenObj, UUID> arg) { return new CFUuidTableCell<ICFBamUuidGenObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnSlice = new TableColumn<ICFBamUuidGenObj, Short>("Slice"); tableColumnSlice.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidGenObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamUuidGenObj, Short> p) { ICFBamUuidGenObj obj = p.getValue(); if (obj == null) { return (null); } else { short value = obj.getRequiredSlice(); Short wrapped = new Short(value); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(wrapped); return (observable); } } }); tableColumnSlice.setCellFactory( new Callback<TableColumn<ICFBamUuidGenObj, Short>, TableCell<ICFBamUuidGenObj, Short>>() { @Override public TableCell<ICFBamUuidGenObj, Short> call(TableColumn<ICFBamUuidGenObj, Short> arg) { return new CFInt16TableCell<ICFBamUuidGenObj>(); } }); dataTable.getColumns().add(tableColumnSlice); tableColumnBlockSize = new TableColumn<ICFBamUuidGenObj, Integer>("BlockSize"); tableColumnBlockSize.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidGenObj, Integer>, ObservableValue<Integer>>() { public ObservableValue<Integer> call(CellDataFeatures<ICFBamUuidGenObj, Integer> p) { ICFBamUuidGenObj obj = p.getValue(); if (obj == null) { return (null); } else { int value = obj.getRequiredBlockSize(); Integer wrapped = new Integer(value); ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>(); observable.setValue(wrapped); return (observable); } } }); tableColumnBlockSize.setCellFactory( new Callback<TableColumn<ICFBamUuidGenObj, Integer>, TableCell<ICFBamUuidGenObj, Integer>>() { @Override public TableCell<ICFBamUuidGenObj, Integer> call(TableColumn<ICFBamUuidGenObj, Integer> arg) { return new CFInt32TableCell<ICFBamUuidGenObj>(); } }); dataTable.getColumns().add(tableColumnBlockSize); tableColumnLookupDefSchema = new TableColumn<ICFBamUuidGenObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamUuidGenObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamUuidGenObj, ICFBamSchemaDefObj> p) { ICFBamUuidGenObj 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<ICFBamUuidGenObj, ICFBamSchemaDefObj>, TableCell<ICFBamUuidGenObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamUuidGenObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamUuidGenObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamUuidGenObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamUuidGenObj>() { @Override public void changed(ObservableValue<? extends ICFBamUuidGenObj> observable, ICFBamUuidGenObj oldValue, ICFBamUuidGenObj 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.choseUuidGen(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"); } ICFBamUuidGenObj selectedInstance = getJavaFXFocusAsUuidGen(); invokeWhenChosen.choseUuidGen(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.CFBamJavaFXInt64ColPickerPane.java
public CFBamJavaFXInt64ColPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamInt64ColObj argFocus, ICFBamTableObj argContainer, Collection<ICFBamInt64ColObj> argDataCollection, ICFBamJavaFXInt64ColChosen whenChosen) { super();//from w w w .j a va 2s. co m final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } 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<ICFBamInt64ColObj>(); tableColumnId = new TableColumn<ICFBamInt64ColObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64ColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamInt64ColObj, 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<ICFBamInt64ColObj, Long>, TableCell<ICFBamInt64ColObj, Long>>() { @Override public TableCell<ICFBamInt64ColObj, Long> call(TableColumn<ICFBamInt64ColObj, Long> arg) { return new CFInt64TableCell<ICFBamInt64ColObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamInt64ColObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64ColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt64ColObj, 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<ICFBamInt64ColObj, String>, TableCell<ICFBamInt64ColObj, String>>() { @Override public TableCell<ICFBamInt64ColObj, String> call(TableColumn<ICFBamInt64ColObj, String> arg) { return new CFStringTableCell<ICFBamInt64ColObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamInt64ColObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64ColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt64ColObj, 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<ICFBamInt64ColObj, String>, TableCell<ICFBamInt64ColObj, String>>() { @Override public TableCell<ICFBamInt64ColObj, String> call(TableColumn<ICFBamInt64ColObj, String> arg) { return new CFStringTableCell<ICFBamInt64ColObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamInt64ColObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64ColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt64ColObj, 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<ICFBamInt64ColObj, String>, TableCell<ICFBamInt64ColObj, String>>() { @Override public TableCell<ICFBamInt64ColObj, String> call(TableColumn<ICFBamInt64ColObj, String> arg) { return new CFStringTableCell<ICFBamInt64ColObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamInt64ColObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64ColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt64ColObj, 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<ICFBamInt64ColObj, String>, TableCell<ICFBamInt64ColObj, String>>() { @Override public TableCell<ICFBamInt64ColObj, String> call(TableColumn<ICFBamInt64ColObj, String> arg) { return new CFStringTableCell<ICFBamInt64ColObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamInt64ColObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64ColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt64ColObj, 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<ICFBamInt64ColObj, String>, TableCell<ICFBamInt64ColObj, String>>() { @Override public TableCell<ICFBamInt64ColObj, String> call(TableColumn<ICFBamInt64ColObj, String> arg) { return new CFStringTableCell<ICFBamInt64ColObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamInt64ColObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64ColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt64ColObj, 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<ICFBamInt64ColObj, Boolean>, TableCell<ICFBamInt64ColObj, Boolean>>() { @Override public TableCell<ICFBamInt64ColObj, Boolean> call(TableColumn<ICFBamInt64ColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamInt64ColObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamInt64ColObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64ColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt64ColObj, 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<ICFBamInt64ColObj, Boolean>, TableCell<ICFBamInt64ColObj, Boolean>>() { @Override public TableCell<ICFBamInt64ColObj, Boolean> call(TableColumn<ICFBamInt64ColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamInt64ColObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamInt64ColObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64ColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt64ColObj, 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<ICFBamInt64ColObj, Boolean>, TableCell<ICFBamInt64ColObj, Boolean>>() { @Override public TableCell<ICFBamInt64ColObj, Boolean> call(TableColumn<ICFBamInt64ColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamInt64ColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamInt64ColObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64ColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt64ColObj, 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<ICFBamInt64ColObj, String>, TableCell<ICFBamInt64ColObj, String>>() { @Override public TableCell<ICFBamInt64ColObj, String> call(TableColumn<ICFBamInt64ColObj, String> arg) { return new CFStringTableCell<ICFBamInt64ColObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamInt64ColObj, Long>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64ColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamInt64ColObj, Long> p) { ICFBamInt64DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Long value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamInt64ColObj, Long>, TableCell<ICFBamInt64ColObj, Long>>() { @Override public TableCell<ICFBamInt64ColObj, Long> call(TableColumn<ICFBamInt64ColObj, Long> arg) { return new CFInt64TableCell<ICFBamInt64ColObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamInt64ColObj, Long>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64ColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamInt64ColObj, Long> p) { ICFBamInt64DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Long value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamInt64ColObj, Long>, TableCell<ICFBamInt64ColObj, Long>>() { @Override public TableCell<ICFBamInt64ColObj, Long> call(TableColumn<ICFBamInt64ColObj, Long> arg) { return new CFInt64TableCell<ICFBamInt64ColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamInt64ColObj, Long>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64ColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamInt64ColObj, Long> p) { ICFBamInt64DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Long value = obj.getOptionalMinValue(); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(value); return (observable); } } }); tableColumnMinValue.setCellFactory( new Callback<TableColumn<ICFBamInt64ColObj, Long>, TableCell<ICFBamInt64ColObj, Long>>() { @Override public TableCell<ICFBamInt64ColObj, Long> call(TableColumn<ICFBamInt64ColObj, Long> arg) { return new CFInt64TableCell<ICFBamInt64ColObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamInt64ColObj, Long>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64ColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamInt64ColObj, Long> p) { ICFBamInt64DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Long value = obj.getOptionalMaxValue(); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(value); return (observable); } } }); tableColumnMaxValue.setCellFactory( new Callback<TableColumn<ICFBamInt64ColObj, Long>, TableCell<ICFBamInt64ColObj, Long>>() { @Override public TableCell<ICFBamInt64ColObj, Long> call(TableColumn<ICFBamInt64ColObj, Long> arg) { return new CFInt64TableCell<ICFBamInt64ColObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamInt64ColObj, Long>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64ColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamInt64ColObj, Long> p) { ICFBamInt64DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Long value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamInt64ColObj, Long>, TableCell<ICFBamInt64ColObj, Long>>() { @Override public TableCell<ICFBamInt64ColObj, Long> call(TableColumn<ICFBamInt64ColObj, Long> arg) { return new CFInt64TableCell<ICFBamInt64ColObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamInt64ColObj, Long>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64ColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamInt64ColObj, Long> p) { ICFBamInt64DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Long value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamInt64ColObj, Long>, TableCell<ICFBamInt64ColObj, Long>>() { @Override public TableCell<ICFBamInt64ColObj, Long> call(TableColumn<ICFBamInt64ColObj, Long> arg) { return new CFInt64TableCell<ICFBamInt64ColObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamInt64ColObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt64ColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamInt64ColObj, ICFBamSchemaDefObj> p) { ICFBamInt64ColObj 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<ICFBamInt64ColObj, ICFBamSchemaDefObj>, TableCell<ICFBamInt64ColObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamInt64ColObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamInt64ColObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamInt64ColObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamInt64ColObj>() { @Override public void changed(ObservableValue<? extends ICFBamInt64ColObj> observable, ICFBamInt64ColObj oldValue, ICFBamInt64ColObj 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.choseInt64Col(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"); } ICFBamInt64ColObj selectedInstance = getJavaFXFocusAsInt64Col(); invokeWhenChosen.choseInt64Col(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.CFBamJavaFXBoolDefPickerPane.java
public CFBamJavaFXBoolDefPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamBoolDefObj argFocus, ICFBamScopeObj argContainer, Collection<ICFBamBoolDefObj> argDataCollection, ICFBamJavaFXBoolDefChosen whenChosen) { super();/*from w w w. ja v a2 s. com*/ final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } if (whenChosen == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6, "whenChosen"); } invokeWhenChosen = whenChosen; // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamBoolDefObj>(); tableColumnObjKind = new TableColumn<ICFBamBoolDefObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamBoolDefObj, String> p) { ICFBamBoolDefObj 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<ICFBamBoolDefObj, String>, TableCell<ICFBamBoolDefObj, String>>() { @Override public TableCell<ICFBamBoolDefObj, String> call(TableColumn<ICFBamBoolDefObj, String> arg) { return new CFStringTableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamBoolDefObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamBoolDefObj, 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<ICFBamBoolDefObj, Long>, TableCell<ICFBamBoolDefObj, Long>>() { @Override public TableCell<ICFBamBoolDefObj, Long> call(TableColumn<ICFBamBoolDefObj, Long> arg) { return new CFInt64TableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamBoolDefObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBoolDefObj, 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<ICFBamBoolDefObj, String>, TableCell<ICFBamBoolDefObj, String>>() { @Override public TableCell<ICFBamBoolDefObj, String> call(TableColumn<ICFBamBoolDefObj, String> arg) { return new CFStringTableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamBoolDefObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBoolDefObj, 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<ICFBamBoolDefObj, String>, TableCell<ICFBamBoolDefObj, String>>() { @Override public TableCell<ICFBamBoolDefObj, String> call(TableColumn<ICFBamBoolDefObj, String> arg) { return new CFStringTableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamBoolDefObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBoolDefObj, 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<ICFBamBoolDefObj, String>, TableCell<ICFBamBoolDefObj, String>>() { @Override public TableCell<ICFBamBoolDefObj, String> call(TableColumn<ICFBamBoolDefObj, String> arg) { return new CFStringTableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamBoolDefObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBoolDefObj, 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<ICFBamBoolDefObj, String>, TableCell<ICFBamBoolDefObj, String>>() { @Override public TableCell<ICFBamBoolDefObj, String> call(TableColumn<ICFBamBoolDefObj, String> arg) { return new CFStringTableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamBoolDefObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBoolDefObj, 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<ICFBamBoolDefObj, String>, TableCell<ICFBamBoolDefObj, String>>() { @Override public TableCell<ICFBamBoolDefObj, String> call(TableColumn<ICFBamBoolDefObj, String> arg) { return new CFStringTableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamBoolDefObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBoolDefObj, 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<ICFBamBoolDefObj, Boolean>, TableCell<ICFBamBoolDefObj, Boolean>>() { @Override public TableCell<ICFBamBoolDefObj, Boolean> call(TableColumn<ICFBamBoolDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamBoolDefObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBoolDefObj, 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<ICFBamBoolDefObj, Boolean>, TableCell<ICFBamBoolDefObj, Boolean>>() { @Override public TableCell<ICFBamBoolDefObj, Boolean> call(TableColumn<ICFBamBoolDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamBoolDefObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBoolDefObj, 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<ICFBamBoolDefObj, Boolean>, TableCell<ICFBamBoolDefObj, Boolean>>() { @Override public TableCell<ICFBamBoolDefObj, Boolean> call(TableColumn<ICFBamBoolDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamBoolDefObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBoolDefObj, 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<ICFBamBoolDefObj, String>, TableCell<ICFBamBoolDefObj, String>>() { @Override public TableCell<ICFBamBoolDefObj, String> call(TableColumn<ICFBamBoolDefObj, String> arg) { return new CFStringTableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamBoolDefObj, Boolean>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBoolDefObj, 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<ICFBamBoolDefObj, Boolean>, TableCell<ICFBamBoolDefObj, Boolean>>() { @Override public TableCell<ICFBamBoolDefObj, Boolean> call(TableColumn<ICFBamBoolDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamBoolDefObj, Boolean>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBoolDefObj, 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<ICFBamBoolDefObj, Boolean>, TableCell<ICFBamBoolDefObj, Boolean>>() { @Override public TableCell<ICFBamBoolDefObj, Boolean> call(TableColumn<ICFBamBoolDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnFalseString = new TableColumn<ICFBamBoolDefObj, String>("FalseString"); tableColumnFalseString.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBoolDefObj, 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<ICFBamBoolDefObj, String>, TableCell<ICFBamBoolDefObj, String>>() { @Override public TableCell<ICFBamBoolDefObj, String> call(TableColumn<ICFBamBoolDefObj, String> arg) { return new CFStringTableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnFalseString); tableColumnTrueString = new TableColumn<ICFBamBoolDefObj, String>("TrueString"); tableColumnTrueString.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBoolDefObj, 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<ICFBamBoolDefObj, String>, TableCell<ICFBamBoolDefObj, String>>() { @Override public TableCell<ICFBamBoolDefObj, String> call(TableColumn<ICFBamBoolDefObj, String> arg) { return new CFStringTableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnTrueString); tableColumnNullString = new TableColumn<ICFBamBoolDefObj, String>("NullString"); tableColumnNullString.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamBoolDefObj, 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<ICFBamBoolDefObj, String>, TableCell<ICFBamBoolDefObj, String>>() { @Override public TableCell<ICFBamBoolDefObj, String> call(TableColumn<ICFBamBoolDefObj, String> arg) { return new CFStringTableCell<ICFBamBoolDefObj>(); } }); dataTable.getColumns().add(tableColumnNullString); tableColumnLookupDefSchema = new TableColumn<ICFBamBoolDefObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamBoolDefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamBoolDefObj, ICFBamSchemaDefObj> p) { ICFBamBoolDefObj 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<ICFBamBoolDefObj, ICFBamSchemaDefObj>, TableCell<ICFBamBoolDefObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamBoolDefObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamBoolDefObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamBoolDefObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamBoolDefObj>() { @Override public void changed(ObservableValue<? extends ICFBamBoolDefObj> observable, ICFBamBoolDefObj oldValue, ICFBamBoolDefObj 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.choseBoolDef(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"); } ICFBamBoolDefObj selectedInstance = getJavaFXFocusAsBoolDef(); invokeWhenChosen.choseBoolDef(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.CFBamJavaFXFloatColPickerPane.java
public CFBamJavaFXFloatColPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamFloatColObj argFocus, ICFBamTableObj argContainer, Collection<ICFBamFloatColObj> argDataCollection, ICFBamJavaFXFloatColChosen whenChosen) { super();//from w w w . j av a2s . c om final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } if (whenChosen == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6, "whenChosen"); } invokeWhenChosen = whenChosen; // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamFloatColObj>(); tableColumnId = new TableColumn<ICFBamFloatColObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamFloatColObj, 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<ICFBamFloatColObj, Long>, TableCell<ICFBamFloatColObj, Long>>() { @Override public TableCell<ICFBamFloatColObj, Long> call(TableColumn<ICFBamFloatColObj, Long> arg) { return new CFInt64TableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamFloatColObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamFloatColObj, 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<ICFBamFloatColObj, String>, TableCell<ICFBamFloatColObj, String>>() { @Override public TableCell<ICFBamFloatColObj, String> call(TableColumn<ICFBamFloatColObj, String> arg) { return new CFStringTableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamFloatColObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamFloatColObj, 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<ICFBamFloatColObj, String>, TableCell<ICFBamFloatColObj, String>>() { @Override public TableCell<ICFBamFloatColObj, String> call(TableColumn<ICFBamFloatColObj, String> arg) { return new CFStringTableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamFloatColObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamFloatColObj, 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<ICFBamFloatColObj, String>, TableCell<ICFBamFloatColObj, String>>() { @Override public TableCell<ICFBamFloatColObj, String> call(TableColumn<ICFBamFloatColObj, String> arg) { return new CFStringTableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamFloatColObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamFloatColObj, 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<ICFBamFloatColObj, String>, TableCell<ICFBamFloatColObj, String>>() { @Override public TableCell<ICFBamFloatColObj, String> call(TableColumn<ICFBamFloatColObj, String> arg) { return new CFStringTableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamFloatColObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamFloatColObj, 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<ICFBamFloatColObj, String>, TableCell<ICFBamFloatColObj, String>>() { @Override public TableCell<ICFBamFloatColObj, String> call(TableColumn<ICFBamFloatColObj, String> arg) { return new CFStringTableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamFloatColObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamFloatColObj, 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<ICFBamFloatColObj, Boolean>, TableCell<ICFBamFloatColObj, Boolean>>() { @Override public TableCell<ICFBamFloatColObj, Boolean> call(TableColumn<ICFBamFloatColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamFloatColObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamFloatColObj, 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<ICFBamFloatColObj, Boolean>, TableCell<ICFBamFloatColObj, Boolean>>() { @Override public TableCell<ICFBamFloatColObj, Boolean> call(TableColumn<ICFBamFloatColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamFloatColObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamFloatColObj, 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<ICFBamFloatColObj, Boolean>, TableCell<ICFBamFloatColObj, Boolean>>() { @Override public TableCell<ICFBamFloatColObj, Boolean> call(TableColumn<ICFBamFloatColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamFloatColObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamFloatColObj, 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<ICFBamFloatColObj, String>, TableCell<ICFBamFloatColObj, String>>() { @Override public TableCell<ICFBamFloatColObj, String> call(TableColumn<ICFBamFloatColObj, String> arg) { return new CFStringTableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamFloatColObj, Float>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, Float>, ObservableValue<Float>>() { public ObservableValue<Float> call(CellDataFeatures<ICFBamFloatColObj, Float> p) { ICFBamFloatDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Float value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<Float> observable = new ReadOnlyObjectWrapper<Float>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamFloatColObj, Float>, TableCell<ICFBamFloatColObj, Float>>() { @Override public TableCell<ICFBamFloatColObj, Float> call(TableColumn<ICFBamFloatColObj, Float> arg) { return new CFFloatTableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamFloatColObj, Float>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, Float>, ObservableValue<Float>>() { public ObservableValue<Float> call(CellDataFeatures<ICFBamFloatColObj, Float> p) { ICFBamFloatDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Float value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<Float> observable = new ReadOnlyObjectWrapper<Float>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamFloatColObj, Float>, TableCell<ICFBamFloatColObj, Float>>() { @Override public TableCell<ICFBamFloatColObj, Float> call(TableColumn<ICFBamFloatColObj, Float> arg) { return new CFFloatTableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamFloatColObj, Float>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, Float>, ObservableValue<Float>>() { public ObservableValue<Float> call(CellDataFeatures<ICFBamFloatColObj, Float> p) { ICFBamFloatDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Float value = obj.getOptionalMinValue(); ReadOnlyObjectWrapper<Float> observable = new ReadOnlyObjectWrapper<Float>(); observable.setValue(value); return (observable); } } }); tableColumnMinValue.setCellFactory( new Callback<TableColumn<ICFBamFloatColObj, Float>, TableCell<ICFBamFloatColObj, Float>>() { @Override public TableCell<ICFBamFloatColObj, Float> call(TableColumn<ICFBamFloatColObj, Float> arg) { return new CFFloatTableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamFloatColObj, Float>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, Float>, ObservableValue<Float>>() { public ObservableValue<Float> call(CellDataFeatures<ICFBamFloatColObj, Float> p) { ICFBamFloatDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Float value = obj.getOptionalMaxValue(); ReadOnlyObjectWrapper<Float> observable = new ReadOnlyObjectWrapper<Float>(); observable.setValue(value); return (observable); } } }); tableColumnMaxValue.setCellFactory( new Callback<TableColumn<ICFBamFloatColObj, Float>, TableCell<ICFBamFloatColObj, Float>>() { @Override public TableCell<ICFBamFloatColObj, Float> call(TableColumn<ICFBamFloatColObj, Float> arg) { return new CFFloatTableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamFloatColObj, Float>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, Float>, ObservableValue<Float>>() { public ObservableValue<Float> call(CellDataFeatures<ICFBamFloatColObj, Float> p) { ICFBamFloatDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Float value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<Float> observable = new ReadOnlyObjectWrapper<Float>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamFloatColObj, Float>, TableCell<ICFBamFloatColObj, Float>>() { @Override public TableCell<ICFBamFloatColObj, Float> call(TableColumn<ICFBamFloatColObj, Float> arg) { return new CFFloatTableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamFloatColObj, Float>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, Float>, ObservableValue<Float>>() { public ObservableValue<Float> call(CellDataFeatures<ICFBamFloatColObj, Float> p) { ICFBamFloatDefObj obj = p.getValue(); if (obj == null) { return (null); } else { Float value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<Float> observable = new ReadOnlyObjectWrapper<Float>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamFloatColObj, Float>, TableCell<ICFBamFloatColObj, Float>>() { @Override public TableCell<ICFBamFloatColObj, Float> call(TableColumn<ICFBamFloatColObj, Float> arg) { return new CFFloatTableCell<ICFBamFloatColObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamFloatColObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamFloatColObj, ICFBamSchemaDefObj> p) { ICFBamFloatColObj 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<ICFBamFloatColObj, ICFBamSchemaDefObj>, TableCell<ICFBamFloatColObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamFloatColObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamFloatColObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamFloatColObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamFloatColObj>() { @Override public void changed(ObservableValue<? extends ICFBamFloatColObj> observable, ICFBamFloatColObj oldValue, ICFBamFloatColObj 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.choseFloatCol(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"); } ICFBamFloatColObj selectedInstance = getJavaFXFocusAsFloatCol(); invokeWhenChosen.choseFloatCol(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.CFBamJavaFXInt16ColPickerPane.java
public CFBamJavaFXInt16ColPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamInt16ColObj argFocus, ICFBamTableObj argContainer, Collection<ICFBamInt16ColObj> argDataCollection, ICFBamJavaFXInt16ColChosen whenChosen) { super();//from w ww . ja v a 2 s .c o m final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } if (whenChosen == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6, "whenChosen"); } invokeWhenChosen = whenChosen; // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; javaFXFocus = argFocus; javafxContainer = argContainer; setJavaFXDataCollection(argDataCollection); dataTable = new TableView<ICFBamInt16ColObj>(); tableColumnId = new TableColumn<ICFBamInt16ColObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamInt16ColObj, 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<ICFBamInt16ColObj, Long>, TableCell<ICFBamInt16ColObj, Long>>() { @Override public TableCell<ICFBamInt16ColObj, Long> call(TableColumn<ICFBamInt16ColObj, Long> arg) { return new CFInt64TableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamInt16ColObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt16ColObj, 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<ICFBamInt16ColObj, String>, TableCell<ICFBamInt16ColObj, String>>() { @Override public TableCell<ICFBamInt16ColObj, String> call(TableColumn<ICFBamInt16ColObj, String> arg) { return new CFStringTableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamInt16ColObj, String>("Short Name"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt16ColObj, 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<ICFBamInt16ColObj, String>, TableCell<ICFBamInt16ColObj, String>>() { @Override public TableCell<ICFBamInt16ColObj, String> call(TableColumn<ICFBamInt16ColObj, String> arg) { return new CFStringTableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamInt16ColObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt16ColObj, 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<ICFBamInt16ColObj, String>, TableCell<ICFBamInt16ColObj, String>>() { @Override public TableCell<ICFBamInt16ColObj, String> call(TableColumn<ICFBamInt16ColObj, String> arg) { return new CFStringTableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamInt16ColObj, String>("Short Description"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt16ColObj, 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<ICFBamInt16ColObj, String>, TableCell<ICFBamInt16ColObj, String>>() { @Override public TableCell<ICFBamInt16ColObj, String> call(TableColumn<ICFBamInt16ColObj, String> arg) { return new CFStringTableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamInt16ColObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt16ColObj, 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<ICFBamInt16ColObj, String>, TableCell<ICFBamInt16ColObj, String>>() { @Override public TableCell<ICFBamInt16ColObj, String> call(TableColumn<ICFBamInt16ColObj, String> arg) { return new CFStringTableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamInt16ColObj, Boolean>("Is Nullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt16ColObj, 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<ICFBamInt16ColObj, Boolean>, TableCell<ICFBamInt16ColObj, Boolean>>() { @Override public TableCell<ICFBamInt16ColObj, Boolean> call(TableColumn<ICFBamInt16ColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamInt16ColObj, Boolean>("Generate Id"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt16ColObj, 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<ICFBamInt16ColObj, Boolean>, TableCell<ICFBamInt16ColObj, Boolean>>() { @Override public TableCell<ICFBamInt16ColObj, Boolean> call(TableColumn<ICFBamInt16ColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDefaultVisibility = new TableColumn<ICFBamInt16ColObj, Boolean>("Default Visibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt16ColObj, 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<ICFBamInt16ColObj, Boolean>, TableCell<ICFBamInt16ColObj, Boolean>>() { @Override public TableCell<ICFBamInt16ColObj, Boolean> call(TableColumn<ICFBamInt16ColObj, Boolean> arg) { return new CFBoolTableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamInt16ColObj, String>("Db Name"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamInt16ColObj, 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<ICFBamInt16ColObj, String>, TableCell<ICFBamInt16ColObj, String>>() { @Override public TableCell<ICFBamInt16ColObj, String> call(TableColumn<ICFBamInt16ColObj, String> arg) { return new CFStringTableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamInt16ColObj, Short>("Init. Value"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamInt16ColObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalInitValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnInitValue.setCellFactory( new Callback<TableColumn<ICFBamInt16ColObj, Short>, TableCell<ICFBamInt16ColObj, Short>>() { @Override public TableCell<ICFBamInt16ColObj, Short> call(TableColumn<ICFBamInt16ColObj, Short> arg) { return new CFInt16TableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamInt16ColObj, Short>("Default Value"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamInt16ColObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalDefaultValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnDefaultValue.setCellFactory( new Callback<TableColumn<ICFBamInt16ColObj, Short>, TableCell<ICFBamInt16ColObj, Short>>() { @Override public TableCell<ICFBamInt16ColObj, Short> call(TableColumn<ICFBamInt16ColObj, Short> arg) { return new CFInt16TableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamInt16ColObj, Short>("Min. Value"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamInt16ColObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalMinValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnMinValue.setCellFactory( new Callback<TableColumn<ICFBamInt16ColObj, Short>, TableCell<ICFBamInt16ColObj, Short>>() { @Override public TableCell<ICFBamInt16ColObj, Short> call(TableColumn<ICFBamInt16ColObj, Short> arg) { return new CFInt16TableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamInt16ColObj, Short>("Max. Value"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamInt16ColObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalMaxValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnMaxValue.setCellFactory( new Callback<TableColumn<ICFBamInt16ColObj, Short>, TableCell<ICFBamInt16ColObj, Short>>() { @Override public TableCell<ICFBamInt16ColObj, Short> call(TableColumn<ICFBamInt16ColObj, Short> arg) { return new CFInt16TableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamInt16ColObj, Short>("Null Value"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamInt16ColObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalNullValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnNullValue.setCellFactory( new Callback<TableColumn<ICFBamInt16ColObj, Short>, TableCell<ICFBamInt16ColObj, Short>>() { @Override public TableCell<ICFBamInt16ColObj, Short> call(TableColumn<ICFBamInt16ColObj, Short> arg) { return new CFInt16TableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamInt16ColObj, Short>("Unknown Value"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, Short>, ObservableValue<Short>>() { public ObservableValue<Short> call(CellDataFeatures<ICFBamInt16ColObj, Short> p) { ICFBamInt16DefObj obj = p.getValue(); if (obj == null) { return (null); } else { Short value = obj.getOptionalUnknownValue(); ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>(); observable.setValue(value); return (observable); } } }); tableColumnUnknownValue.setCellFactory( new Callback<TableColumn<ICFBamInt16ColObj, Short>, TableCell<ICFBamInt16ColObj, Short>>() { @Override public TableCell<ICFBamInt16ColObj, Short> call(TableColumn<ICFBamInt16ColObj, Short> arg) { return new CFInt16TableCell<ICFBamInt16ColObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamInt16ColObj, ICFBamSchemaDefObj>( "Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback<CellDataFeatures<ICFBamInt16ColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamInt16ColObj, ICFBamSchemaDefObj> p) { ICFBamInt16ColObj 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<ICFBamInt16ColObj, ICFBamSchemaDefObj>, TableCell<ICFBamInt16ColObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamInt16ColObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamInt16ColObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamInt16ColObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamInt16ColObj>() { @Override public void changed(ObservableValue<? extends ICFBamInt16ColObj> observable, ICFBamInt16ColObj oldValue, ICFBamInt16ColObj 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.choseInt16Col(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"); } ICFBamInt16ColObj selectedInstance = getJavaFXFocusAsInt16Col(); invokeWhenChosen.choseInt16Col(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); }