public CFHBox getHBoxMenu() { if (hboxMenu == null) { hboxMenu = new CFHBox(10); buttonSave = new CFButton(); buttonSave.setMinWidth(200); buttonSave.setText("Save"); buttonSave.setOnAction( new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamInt32ColObj focus = getJavaFXFocusAsInt32Col(); if (focus != null) { ICFBamInt32ColEditObj editObj = (ICFBamInt32ColEditObj) (focus.getEdit()); if (editObj != null) { setPaneMode(CFPane.PaneMode.Update); } else { throw CFLib.getDefaultExceptionFactory() .newUsageException( getClass(), S_ProcName, "Cannot save an object that isn't being edited"); } } // If an object was added, the focus will change to the persisted instance focus = getJavaFXFocusAsInt32Col(); CFBorderPane frame = javafxSchema .getInt32ColFactory() .newViewEditForm(cfFormManager, focus, formClosedCallback, true); ((ICFBamJavaFXInt32ColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.closeCurrentForm(); cfFormManager.pushForm(frame); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); if (allowSave) { hboxMenu.getChildren().add(buttonSave); } buttonClose = new CFButton(); buttonClose.setMinWidth(200); buttonClose.setText("Close"); buttonClose.setOnAction( new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamInt32ColObj focus = getJavaFXFocusAsInt32Col(); if (focus != null) { ICFBamInt32ColEditObj editObj = (ICFBamInt32ColEditObj) (focus.getEdit()); if (editObj != null) { setPaneMode(CFPane.PaneMode.Update); } else { throw CFLib.getDefaultExceptionFactory() .newUsageException( getClass(), S_ProcName, "Cannot save an object that isn't being edited"); } } // If an object was added, the focus will change to the persisted instance focus = getJavaFXFocusAsInt32Col(); cfFormManager.closeCurrentForm(); if (formClosedCallback != null) { formClosedCallback.formClosed(focus); } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonClose); 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 { ICFBamInt32ColObj focus = getJavaFXFocusAsInt32Col(); if (focus != null) { ICFBamInt32ColEditObj editObj = (ICFBamInt32ColEditObj) focus.getEdit(); if (editObj != null) { if (editObj.getIsNew()) { editObj.endEdit(); setJavaFXFocus(null); setPaneMode(CFPane.PaneMode.Unknown); } else { editObj.endEdit(); setPaneMode(CFPane.PaneMode.View); } } } cfFormManager.closeCurrentForm(); if (formClosedCallback != null) { formClosedCallback.formClosed(null); } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonCancel); } return (hboxMenu); }
public CFBamJavaFXFloatDefPickerPane( ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamFloatDefObj argFocus, ICFBamScopeObj argContainer, Collection<ICFBamFloatDefObj> argDataCollection, ICFBamJavaFXFloatDefChosen whenChosen) { super(); 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<ICFBamFloatDefObj>(); tableColumnObjKind = new TableColumn<ICFBamFloatDefObj, String>("Class Code"); tableColumnObjKind.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatDefObj, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<ICFBamFloatDefObj, String> p) { ICFBamFloatDefObj 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<ICFBamFloatDefObj, String>, TableCell<ICFBamFloatDefObj, String>>() { @Override public TableCell<ICFBamFloatDefObj, String> call( TableColumn<ICFBamFloatDefObj, String> arg) { return new CFStringTableCell<ICFBamFloatDefObj>(); } }); dataTable.getColumns().add(tableColumnObjKind); tableColumnId = new TableColumn<ICFBamFloatDefObj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatDefObj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamFloatDefObj, 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<ICFBamFloatDefObj, Long>, TableCell<ICFBamFloatDefObj, Long>>() { @Override public TableCell<ICFBamFloatDefObj, Long> call(TableColumn<ICFBamFloatDefObj, Long> arg) { return new CFInt64TableCell<ICFBamFloatDefObj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamFloatDefObj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamFloatDefObj, 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<ICFBamFloatDefObj, String>, TableCell<ICFBamFloatDefObj, String>>() { @Override public TableCell<ICFBamFloatDefObj, String> call( TableColumn<ICFBamFloatDefObj, String> arg) { return new CFStringTableCell<ICFBamFloatDefObj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnShortName = new TableColumn<ICFBamFloatDefObj, String>("ShortName"); tableColumnShortName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamFloatDefObj, 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<ICFBamFloatDefObj, String>, TableCell<ICFBamFloatDefObj, String>>() { @Override public TableCell<ICFBamFloatDefObj, String> call( TableColumn<ICFBamFloatDefObj, String> arg) { return new CFStringTableCell<ICFBamFloatDefObj>(); } }); dataTable.getColumns().add(tableColumnShortName); tableColumnLabel = new TableColumn<ICFBamFloatDefObj, String>("Label"); tableColumnLabel.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamFloatDefObj, 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<ICFBamFloatDefObj, String>, TableCell<ICFBamFloatDefObj, String>>() { @Override public TableCell<ICFBamFloatDefObj, String> call( TableColumn<ICFBamFloatDefObj, String> arg) { return new CFStringTableCell<ICFBamFloatDefObj>(); } }); dataTable.getColumns().add(tableColumnLabel); tableColumnShortDescription = new TableColumn<ICFBamFloatDefObj, String>("ShortDescription"); tableColumnShortDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamFloatDefObj, 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<ICFBamFloatDefObj, String>, TableCell<ICFBamFloatDefObj, String>>() { @Override public TableCell<ICFBamFloatDefObj, String> call( TableColumn<ICFBamFloatDefObj, String> arg) { return new CFStringTableCell<ICFBamFloatDefObj>(); } }); dataTable.getColumns().add(tableColumnShortDescription); tableColumnDescription = new TableColumn<ICFBamFloatDefObj, String>("Description"); tableColumnDescription.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamFloatDefObj, 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<ICFBamFloatDefObj, String>, TableCell<ICFBamFloatDefObj, String>>() { @Override public TableCell<ICFBamFloatDefObj, String> call( TableColumn<ICFBamFloatDefObj, String> arg) { return new CFStringTableCell<ICFBamFloatDefObj>(); } }); dataTable.getColumns().add(tableColumnDescription); tableColumnIsNullable = new TableColumn<ICFBamFloatDefObj, Boolean>("IsNullable"); tableColumnIsNullable.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamFloatDefObj, 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<ICFBamFloatDefObj, Boolean>, TableCell<ICFBamFloatDefObj, Boolean>>() { @Override public TableCell<ICFBamFloatDefObj, Boolean> call( TableColumn<ICFBamFloatDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamFloatDefObj>(); } }); dataTable.getColumns().add(tableColumnIsNullable); tableColumnGenerateId = new TableColumn<ICFBamFloatDefObj, Boolean>("GenerateId"); tableColumnGenerateId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamFloatDefObj, 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<ICFBamFloatDefObj, Boolean>, TableCell<ICFBamFloatDefObj, Boolean>>() { @Override public TableCell<ICFBamFloatDefObj, Boolean> call( TableColumn<ICFBamFloatDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamFloatDefObj>(); } }); dataTable.getColumns().add(tableColumnGenerateId); tableColumnDataScope = new TableColumn<ICFBamFloatDefObj, ICFBamSchema.DataScopeEnum>("DataScope"); tableColumnDataScope.setCellValueFactory( new Callback< CellDataFeatures<ICFBamFloatDefObj, ICFBamSchema.DataScopeEnum>, ObservableValue<ICFBamSchema.DataScopeEnum>>() { public ObservableValue<ICFBamSchema.DataScopeEnum> call( CellDataFeatures<ICFBamFloatDefObj, ICFBamSchema.DataScopeEnum> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchema.DataScopeEnum value = obj.getOptionalDataScope(); ReadOnlyObjectWrapper<ICFBamSchema.DataScopeEnum> observable = new ReadOnlyObjectWrapper<ICFBamSchema.DataScopeEnum>(); observable.setValue(value); return (observable); } } }); tableColumnDataScope.setCellFactory( new Callback< TableColumn<ICFBamFloatDefObj, ICFBamSchema.DataScopeEnum>, TableCell<ICFBamFloatDefObj, ICFBamSchema.DataScopeEnum>>() { @Override public TableCell<ICFBamFloatDefObj, ICFBamSchema.DataScopeEnum> call( TableColumn<ICFBamFloatDefObj, ICFBamSchema.DataScopeEnum> arg) { return new CFEnumTableCell<ICFBamFloatDefObj, ICFBamSchema.DataScopeEnum>(); } }); dataTable.getColumns().add(tableColumnDataScope); tableColumnViewAccessSecurity = new TableColumn<ICFBamFloatDefObj, ICFBamSchema.AccessSecurityEnum>("ViewAccessSecurity"); tableColumnViewAccessSecurity.setCellValueFactory( new Callback< CellDataFeatures<ICFBamFloatDefObj, ICFBamSchema.AccessSecurityEnum>, ObservableValue<ICFBamSchema.AccessSecurityEnum>>() { public ObservableValue<ICFBamSchema.AccessSecurityEnum> call( CellDataFeatures<ICFBamFloatDefObj, ICFBamSchema.AccessSecurityEnum> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchema.AccessSecurityEnum value = obj.getOptionalViewAccessSecurity(); ReadOnlyObjectWrapper<ICFBamSchema.AccessSecurityEnum> observable = new ReadOnlyObjectWrapper<ICFBamSchema.AccessSecurityEnum>(); observable.setValue(value); return (observable); } } }); tableColumnViewAccessSecurity.setCellFactory( new Callback< TableColumn<ICFBamFloatDefObj, ICFBamSchema.AccessSecurityEnum>, TableCell<ICFBamFloatDefObj, ICFBamSchema.AccessSecurityEnum>>() { @Override public TableCell<ICFBamFloatDefObj, ICFBamSchema.AccessSecurityEnum> call( TableColumn<ICFBamFloatDefObj, ICFBamSchema.AccessSecurityEnum> arg) { return new CFEnumTableCell<ICFBamFloatDefObj, ICFBamSchema.AccessSecurityEnum>(); } }); dataTable.getColumns().add(tableColumnViewAccessSecurity); tableColumnEditAccessSecurity = new TableColumn<ICFBamFloatDefObj, ICFBamSchema.AccessSecurityEnum>("EditAccessSecurity"); tableColumnEditAccessSecurity.setCellValueFactory( new Callback< CellDataFeatures<ICFBamFloatDefObj, ICFBamSchema.AccessSecurityEnum>, ObservableValue<ICFBamSchema.AccessSecurityEnum>>() { public ObservableValue<ICFBamSchema.AccessSecurityEnum> call( CellDataFeatures<ICFBamFloatDefObj, ICFBamSchema.AccessSecurityEnum> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchema.AccessSecurityEnum value = obj.getOptionalEditAccessSecurity(); ReadOnlyObjectWrapper<ICFBamSchema.AccessSecurityEnum> observable = new ReadOnlyObjectWrapper<ICFBamSchema.AccessSecurityEnum>(); observable.setValue(value); return (observable); } } }); tableColumnEditAccessSecurity.setCellFactory( new Callback< TableColumn<ICFBamFloatDefObj, ICFBamSchema.AccessSecurityEnum>, TableCell<ICFBamFloatDefObj, ICFBamSchema.AccessSecurityEnum>>() { @Override public TableCell<ICFBamFloatDefObj, ICFBamSchema.AccessSecurityEnum> call( TableColumn<ICFBamFloatDefObj, ICFBamSchema.AccessSecurityEnum> arg) { return new CFEnumTableCell<ICFBamFloatDefObj, ICFBamSchema.AccessSecurityEnum>(); } }); dataTable.getColumns().add(tableColumnEditAccessSecurity); tableColumnViewAccessFrequency = new TableColumn<ICFBamFloatDefObj, ICFBamSchema.AccessFrequencyEnum>("ViewAccessFrequency"); tableColumnViewAccessFrequency.setCellValueFactory( new Callback< CellDataFeatures<ICFBamFloatDefObj, ICFBamSchema.AccessFrequencyEnum>, ObservableValue<ICFBamSchema.AccessFrequencyEnum>>() { public ObservableValue<ICFBamSchema.AccessFrequencyEnum> call( CellDataFeatures<ICFBamFloatDefObj, ICFBamSchema.AccessFrequencyEnum> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchema.AccessFrequencyEnum value = obj.getOptionalViewAccessFrequency(); ReadOnlyObjectWrapper<ICFBamSchema.AccessFrequencyEnum> observable = new ReadOnlyObjectWrapper<ICFBamSchema.AccessFrequencyEnum>(); observable.setValue(value); return (observable); } } }); tableColumnViewAccessFrequency.setCellFactory( new Callback< TableColumn<ICFBamFloatDefObj, ICFBamSchema.AccessFrequencyEnum>, TableCell<ICFBamFloatDefObj, ICFBamSchema.AccessFrequencyEnum>>() { @Override public TableCell<ICFBamFloatDefObj, ICFBamSchema.AccessFrequencyEnum> call( TableColumn<ICFBamFloatDefObj, ICFBamSchema.AccessFrequencyEnum> arg) { return new CFEnumTableCell<ICFBamFloatDefObj, ICFBamSchema.AccessFrequencyEnum>(); } }); dataTable.getColumns().add(tableColumnViewAccessFrequency); tableColumnEditAccessFrequency = new TableColumn<ICFBamFloatDefObj, ICFBamSchema.AccessFrequencyEnum>("EditAccessFrequency"); tableColumnEditAccessFrequency.setCellValueFactory( new Callback< CellDataFeatures<ICFBamFloatDefObj, ICFBamSchema.AccessFrequencyEnum>, ObservableValue<ICFBamSchema.AccessFrequencyEnum>>() { public ObservableValue<ICFBamSchema.AccessFrequencyEnum> call( CellDataFeatures<ICFBamFloatDefObj, ICFBamSchema.AccessFrequencyEnum> p) { ICFBamValueObj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchema.AccessFrequencyEnum value = obj.getOptionalEditAccessFrequency(); ReadOnlyObjectWrapper<ICFBamSchema.AccessFrequencyEnum> observable = new ReadOnlyObjectWrapper<ICFBamSchema.AccessFrequencyEnum>(); observable.setValue(value); return (observable); } } }); tableColumnEditAccessFrequency.setCellFactory( new Callback< TableColumn<ICFBamFloatDefObj, ICFBamSchema.AccessFrequencyEnum>, TableCell<ICFBamFloatDefObj, ICFBamSchema.AccessFrequencyEnum>>() { @Override public TableCell<ICFBamFloatDefObj, ICFBamSchema.AccessFrequencyEnum> call( TableColumn<ICFBamFloatDefObj, ICFBamSchema.AccessFrequencyEnum> arg) { return new CFEnumTableCell<ICFBamFloatDefObj, ICFBamSchema.AccessFrequencyEnum>(); } }); dataTable.getColumns().add(tableColumnEditAccessFrequency); tableColumnDefaultVisibility = new TableColumn<ICFBamFloatDefObj, Boolean>("DefaultVisibility"); tableColumnDefaultVisibility.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatDefObj, Boolean>, ObservableValue<Boolean>>() { public ObservableValue<Boolean> call(CellDataFeatures<ICFBamFloatDefObj, 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<ICFBamFloatDefObj, Boolean>, TableCell<ICFBamFloatDefObj, Boolean>>() { @Override public TableCell<ICFBamFloatDefObj, Boolean> call( TableColumn<ICFBamFloatDefObj, Boolean> arg) { return new CFBoolTableCell<ICFBamFloatDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultVisibility); tableColumnDbName = new TableColumn<ICFBamFloatDefObj, String>("DbName"); tableColumnDbName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatDefObj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamFloatDefObj, 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<ICFBamFloatDefObj, String>, TableCell<ICFBamFloatDefObj, String>>() { @Override public TableCell<ICFBamFloatDefObj, String> call( TableColumn<ICFBamFloatDefObj, String> arg) { return new CFStringTableCell<ICFBamFloatDefObj>(); } }); dataTable.getColumns().add(tableColumnDbName); tableColumnInitValue = new TableColumn<ICFBamFloatDefObj, Float>("InitValue"); tableColumnInitValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatDefObj, Float>, ObservableValue<Float>>() { public ObservableValue<Float> call(CellDataFeatures<ICFBamFloatDefObj, 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<ICFBamFloatDefObj, Float>, TableCell<ICFBamFloatDefObj, Float>>() { @Override public TableCell<ICFBamFloatDefObj, Float> call( TableColumn<ICFBamFloatDefObj, Float> arg) { return new CFFloatTableCell<ICFBamFloatDefObj>(); } }); dataTable.getColumns().add(tableColumnInitValue); tableColumnDefaultValue = new TableColumn<ICFBamFloatDefObj, Float>("DefaultValue"); tableColumnDefaultValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatDefObj, Float>, ObservableValue<Float>>() { public ObservableValue<Float> call(CellDataFeatures<ICFBamFloatDefObj, 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<ICFBamFloatDefObj, Float>, TableCell<ICFBamFloatDefObj, Float>>() { @Override public TableCell<ICFBamFloatDefObj, Float> call( TableColumn<ICFBamFloatDefObj, Float> arg) { return new CFFloatTableCell<ICFBamFloatDefObj>(); } }); dataTable.getColumns().add(tableColumnDefaultValue); tableColumnMinValue = new TableColumn<ICFBamFloatDefObj, Float>("MinValue"); tableColumnMinValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatDefObj, Float>, ObservableValue<Float>>() { public ObservableValue<Float> call(CellDataFeatures<ICFBamFloatDefObj, 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<ICFBamFloatDefObj, Float>, TableCell<ICFBamFloatDefObj, Float>>() { @Override public TableCell<ICFBamFloatDefObj, Float> call( TableColumn<ICFBamFloatDefObj, Float> arg) { return new CFFloatTableCell<ICFBamFloatDefObj>(); } }); dataTable.getColumns().add(tableColumnMinValue); tableColumnMaxValue = new TableColumn<ICFBamFloatDefObj, Float>("MaxValue"); tableColumnMaxValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatDefObj, Float>, ObservableValue<Float>>() { public ObservableValue<Float> call(CellDataFeatures<ICFBamFloatDefObj, 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<ICFBamFloatDefObj, Float>, TableCell<ICFBamFloatDefObj, Float>>() { @Override public TableCell<ICFBamFloatDefObj, Float> call( TableColumn<ICFBamFloatDefObj, Float> arg) { return new CFFloatTableCell<ICFBamFloatDefObj>(); } }); dataTable.getColumns().add(tableColumnMaxValue); tableColumnNullValue = new TableColumn<ICFBamFloatDefObj, Float>("NullValue"); tableColumnNullValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatDefObj, Float>, ObservableValue<Float>>() { public ObservableValue<Float> call(CellDataFeatures<ICFBamFloatDefObj, 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<ICFBamFloatDefObj, Float>, TableCell<ICFBamFloatDefObj, Float>>() { @Override public TableCell<ICFBamFloatDefObj, Float> call( TableColumn<ICFBamFloatDefObj, Float> arg) { return new CFFloatTableCell<ICFBamFloatDefObj>(); } }); dataTable.getColumns().add(tableColumnNullValue); tableColumnUnknownValue = new TableColumn<ICFBamFloatDefObj, Float>("UnknownValue"); tableColumnUnknownValue.setCellValueFactory( new Callback<CellDataFeatures<ICFBamFloatDefObj, Float>, ObservableValue<Float>>() { public ObservableValue<Float> call(CellDataFeatures<ICFBamFloatDefObj, 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<ICFBamFloatDefObj, Float>, TableCell<ICFBamFloatDefObj, Float>>() { @Override public TableCell<ICFBamFloatDefObj, Float> call( TableColumn<ICFBamFloatDefObj, Float> arg) { return new CFFloatTableCell<ICFBamFloatDefObj>(); } }); dataTable.getColumns().add(tableColumnUnknownValue); tableColumnLookupDefSchema = new TableColumn<ICFBamFloatDefObj, ICFBamSchemaDefObj>("Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback< CellDataFeatures<ICFBamFloatDefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamFloatDefObj, ICFBamSchemaDefObj> p) { ICFBamFloatDefObj 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<ICFBamFloatDefObj, ICFBamSchemaDefObj>, TableCell<ICFBamFloatDefObj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamFloatDefObj, ICFBamSchemaDefObj> call( TableColumn<ICFBamFloatDefObj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamFloatDefObj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable .getSelectionModel() .selectedItemProperty() .addListener( new ChangeListener<ICFBamFloatDefObj>() { @Override public void changed( ObservableValue<? extends ICFBamFloatDefObj> observable, ICFBamFloatDefObj oldValue, ICFBamFloatDefObj 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.choseFloatDef(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"); } ICFBamFloatDefObj selectedInstance = getJavaFXFocusAsFloatDef(); invokeWhenChosen.choseFloatDef(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); }
public CFHBox getHBoxMenu() { if (hboxMenu == null) { hboxMenu = new CFHBox(10); buttonEdit = new CFButton(); buttonEdit.setMinWidth(200); buttonEdit.setText("Edit"); buttonEdit.setOnAction( new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { if (getJavaFXFocusAsTokenCol() != null) { if (null == getJavaFXFocusAsTokenCol().getEdit()) { setPaneMode(CFPane.PaneMode.Edit); } else { throw CFLib.getDefaultExceptionFactory() .newUsageException( getClass(), S_ProcName, "Cannot begin an edit of an object already edited by another window instance"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } adjustButtons(); } }); hboxMenu.getChildren().add(buttonEdit); buttonSave = new CFButton(); buttonSave.setMinWidth(200); buttonSave.setText("Save"); buttonSave.setOnAction( new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamTokenColObj focus = getJavaFXFocusAsTokenCol(); if (focus != null) { ICFBamTokenColEditObj editObj = (ICFBamTokenColEditObj) (focus.getEdit()); if (editObj == null) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "editObj"); } CFPane.PaneMode oldMode = getPaneMode(); try { setPaneMode(CFPane.PaneMode.Update); setPaneMode(CFPane.PaneMode.View); } catch (Throwable t) { setPaneMode(oldMode); throw t; } } else { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "focus"); } dataChanged = true; } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } adjustButtons(); } }); hboxMenu.getChildren().add(buttonSave); buttonClose = new CFButton(); buttonClose.setMinWidth(200); buttonClose.setText("Close"); buttonClose.setOnAction( new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamTokenColObj focus = getJavaFXFocusAsTokenCol(); if (focus != null) { ICFBamTokenColEditObj editObj = (ICFBamTokenColEditObj) (focus.getEdit()); if (editObj == null) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "editObj"); } CFPane.PaneMode oldMode = getPaneMode(); try { setPaneMode(CFPane.PaneMode.Update); } catch (Throwable t) { setPaneMode(oldMode); throw t; } dataChanged = true; } else { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "focus"); } cfFormManager.closeCurrentForm(); if (formClosedCallback != null) { focus = getJavaFXFocusAsTokenCol(); formClosedCallback.formClosed(focus); } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonClose); 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 { ICFBamTokenColObj focus = getJavaFXFocusAsTokenCol(); if (focus != null) { ICFBamTokenColEditObj editObj = (ICFBamTokenColEditObj) focus.getEdit(); if (editObj != null) { if (editObj.getIsNew()) { editObj.endEdit(); setJavaFXFocus(null); setPaneMode(CFPane.PaneMode.Unknown); } else { editObj.endEdit(); setPaneMode(CFPane.PaneMode.View); } } } cfFormManager.closeCurrentForm(); if (formClosedCallback != null) { if (dataChanged) { focus = getJavaFXFocusAsTokenCol(); } else { focus = null; } formClosedCallback.formClosed(focus); } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonCancel); } return (hboxMenu); }
public CFBamJavaFXDelSubDep1PickerPane( ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamDelSubDep1Obj argFocus, ICFBamDelTopDepObj argContainer, Collection<ICFBamDelSubDep1Obj> argDataCollection, ICFBamJavaFXDelSubDep1Chosen whenChosen) { super(); 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<ICFBamDelSubDep1Obj>(); tableColumnId = new TableColumn<ICFBamDelSubDep1Obj, Long>("Id"); tableColumnId.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDelSubDep1Obj, Long>, ObservableValue<Long>>() { public ObservableValue<Long> call(CellDataFeatures<ICFBamDelSubDep1Obj, Long> p) { ICFBamScopeObj obj = p.getValue(); if (obj == null) { return (null); } else { long value = obj.getRequiredId(); Long wrapped = new Long(value); ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>(); observable.setValue(wrapped); return (observable); } } }); tableColumnId.setCellFactory( new Callback< TableColumn<ICFBamDelSubDep1Obj, Long>, TableCell<ICFBamDelSubDep1Obj, Long>>() { @Override public TableCell<ICFBamDelSubDep1Obj, Long> call( TableColumn<ICFBamDelSubDep1Obj, Long> arg) { return new CFInt64TableCell<ICFBamDelSubDep1Obj>(); } }); dataTable.getColumns().add(tableColumnId); tableColumnName = new TableColumn<ICFBamDelSubDep1Obj, String>("Name"); tableColumnName.setCellValueFactory( new Callback<CellDataFeatures<ICFBamDelSubDep1Obj, String>, ObservableValue<String>>() { public ObservableValue<String> call(CellDataFeatures<ICFBamDelSubDep1Obj, String> p) { ICFBamDelSubDep1Obj obj = p.getValue(); if (obj == null) { return (null); } else { String value = obj.getRequiredName(); ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>(); observable.setValue(value); return (observable); } } }); tableColumnName.setCellFactory( new Callback< TableColumn<ICFBamDelSubDep1Obj, String>, TableCell<ICFBamDelSubDep1Obj, String>>() { @Override public TableCell<ICFBamDelSubDep1Obj, String> call( TableColumn<ICFBamDelSubDep1Obj, String> arg) { return new CFStringTableCell<ICFBamDelSubDep1Obj>(); } }); dataTable.getColumns().add(tableColumnName); tableColumnLookupRelation = new TableColumn<ICFBamDelSubDep1Obj, ICFBamRelationObj>("Relation"); tableColumnLookupRelation.setCellValueFactory( new Callback< CellDataFeatures<ICFBamDelSubDep1Obj, ICFBamRelationObj>, ObservableValue<ICFBamRelationObj>>() { public ObservableValue<ICFBamRelationObj> call( CellDataFeatures<ICFBamDelSubDep1Obj, ICFBamRelationObj> p) { ICFBamDelSubDep1Obj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamRelationObj ref = obj.getRequiredLookupRelation(); ReadOnlyObjectWrapper<ICFBamRelationObj> observable = new ReadOnlyObjectWrapper<ICFBamRelationObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupRelation.setCellFactory( new Callback< TableColumn<ICFBamDelSubDep1Obj, ICFBamRelationObj>, TableCell<ICFBamDelSubDep1Obj, ICFBamRelationObj>>() { @Override public TableCell<ICFBamDelSubDep1Obj, ICFBamRelationObj> call( TableColumn<ICFBamDelSubDep1Obj, ICFBamRelationObj> arg) { return new CFReferenceTableCell<ICFBamDelSubDep1Obj, ICFBamRelationObj>(); } }); dataTable.getColumns().add(tableColumnLookupRelation); tableColumnLookupDefSchema = new TableColumn<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj>("Defining Schema Definition"); tableColumnLookupDefSchema.setCellValueFactory( new Callback< CellDataFeatures<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() { public ObservableValue<ICFBamSchemaDefObj> call( CellDataFeatures<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj> p) { ICFBamDelSubDep1Obj obj = p.getValue(); if (obj == null) { return (null); } else { ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema(); ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>(); observable.setValue(ref); return (observable); } } }); tableColumnLookupDefSchema.setCellFactory( new Callback< TableColumn<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj>, TableCell<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj>>() { @Override public TableCell<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj> call( TableColumn<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj> arg) { return new CFReferenceTableCell<ICFBamDelSubDep1Obj, ICFBamSchemaDefObj>(); } }); dataTable.getColumns().add(tableColumnLookupDefSchema); dataTable .getSelectionModel() .selectedItemProperty() .addListener( new ChangeListener<ICFBamDelSubDep1Obj>() { @Override public void changed( ObservableValue<? extends ICFBamDelSubDep1Obj> observable, ICFBamDelSubDep1Obj oldValue, ICFBamDelSubDep1Obj newValue) { setJavaFXFocus(newValue); 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.choseDelSubDep1(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"); } ICFBamDelSubDep1Obj selectedInstance = getJavaFXFocusAsDelSubDep1(); invokeWhenChosen.choseDelSubDep1(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); }
public CFBamJavaFXUInt64ColAskDeleteForm( ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamUInt64ColObj argFocus, ICFDeleteCallback callback) { super(); 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; deleteCallback = callback; // Construct the various objects textAreaMessage = new CFTextArea(); textAreaMessage.setText("Are you sure you want to delete this UInt64Col?"); hboxButtons = new CFHBox(10); buttonOk = new CFButton(); buttonOk.setMinWidth(200); buttonOk.setText("Ok"); buttonOk.setOnAction( new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "actionOkPerformed"; try { ICFBamUInt64ColObj obj = getJavaFXFocusAsUInt64Col(); ICFBamUInt64ColEditObj editObj = (ICFBamUInt64ColEditObj) obj.beginEdit(); editObj.delete(); editObj.endEdit(); cfFormManager.closeCurrentForm(); if (deleteCallback != null) { deleteCallback.formClosed(null); deleteCallback.deleted(obj); } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); buttonCancel = new CFButton(); buttonCancel.setMinWidth(200); buttonCancel.setText("Cancel"); buttonCancel.setOnAction( new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "actionCancelPerformed"; try { cfFormManager.closeCurrentForm(); if (deleteCallback != null) { deleteCallback.formClosed(null); } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxButtons.getChildren().addAll(buttonOk, buttonCancel); attrPane = argSchema.getUInt64ColFactory().newAttrPane(cfFormManager, argFocus); scrollPane = new ScrollPane(); scrollPane.setFitToWidth(true); scrollPane.setHbarPolicy(ScrollBarPolicy.NEVER); scrollPane.setVbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollPane.setContent(attrPane); setTop(textAreaMessage); setCenter(scrollPane); setBottom(hboxButtons); }
public CFHBox getPanelHBoxMenu() { if (hboxMenu == null) { hboxMenu = new CFHBox(10); buttonAddFloatType = new CFButton(); buttonAddFloatType.setMinWidth(200); buttonAddFloatType.setText("Add FloatType"); buttonAddFloatType.setOnAction( new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { final String S_ProcName = "handle"; try { ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema(); ICFBamFloatTypeObj obj = (ICFBamFloatTypeObj) schemaObj.getFloatTypeTableObj().newInstance(); ICFBamFloatTypeEditObj edit = (ICFBamFloatTypeEditObj) (obj.beginEdit()); if (edit == null) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "edit"); } ICFSecurityTenantObj secTenant = schemaObj.getSecTenant(); edit.setRequiredOwnerTenant(secTenant); ICFBamSchemaDefObj container = (ICFBamSchemaDefObj) (getJavaFXContainer()); if (container == null) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "JavaFXContainer"); } edit.setRequiredContainerSchemaDef(container); CFBorderPane frame = javafxSchema .getFloatTypeFactory() .newAddForm(cfFormManager, obj, getViewEditClosedCallback(), true); ICFBamJavaFXFloatTypePaneCommon jpanelCommon = (ICFBamJavaFXFloatTypePaneCommon) frame; jpanelCommon.setJavaFXFocus(obj); jpanelCommon.setPaneMode(CFPane.PaneMode.Add); cfFormManager.pushForm(frame); } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonAddFloatType); buttonViewSelected = new CFButton(); buttonViewSelected.setMinWidth(200); buttonViewSelected.setText("View Selected"); buttonViewSelected.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"); } ICFBamFloatTypeObj selectedInstance = getJavaFXFocusAsFloatType(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("FLTT".equals(classCode)) { CFBorderPane frame = javafxSchema .getFloatTypeFactory() .newViewEditForm( cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXFloatTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory() .newUnsupportedClassException( getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamFloatTypeObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonViewSelected); buttonEditSelected = new CFButton(); buttonEditSelected.setMinWidth(200); buttonEditSelected.setText("Edit Selected"); buttonEditSelected.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"); } ICFBamFloatTypeObj selectedInstance = getJavaFXFocusAsFloatType(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("FLTT".equals(classCode)) { CFBorderPane frame = javafxSchema .getFloatTypeFactory() .newViewEditForm( cfFormManager, selectedInstance, getViewEditClosedCallback(), false); ((ICFBamJavaFXFloatTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory() .newUnsupportedClassException( getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamFloatTypeObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonEditSelected); buttonDeleteSelected = new CFButton(); buttonDeleteSelected.setMinWidth(200); buttonDeleteSelected.setText("Delete Selected"); buttonDeleteSelected.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"); } ICFBamFloatTypeObj selectedInstance = getJavaFXFocusAsFloatType(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("FLTT".equals(classCode)) { CFBorderPane frame = javafxSchema .getFloatTypeFactory() .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback()); ((ICFBamJavaFXFloatTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View); cfFormManager.pushForm(frame); } else { throw CFLib.getDefaultExceptionFactory() .newUnsupportedClassException( getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFBamFloatTypeObj"); } } } catch (Throwable t) { CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t); } } }); hboxMenu.getChildren().add(buttonDeleteSelected); } return (hboxMenu); }