Example usage for javafx.event EventHandler EventHandler

List of usage examples for javafx.event EventHandler EventHandler

Introduction

In this page you can find the example usage for javafx.event EventHandler EventHandler.

Prototype

EventHandler

Source Link

Usage

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXInt64TypePickerPane.java

public CFBamJavaFXInt64TypePickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamInt64TypeObj argFocus, ICFBamSchemaDefObj argContainer,
        Collection<ICFBamInt64TypeObj> argDataCollection, ICFBamJavaFXInt64TypeChosen whenChosen) {
    super();/*from w  ww.  ja  v  a  2s. c o m*/
    final String S_ProcName = "construct-schema-focus";
    if (formManager == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "formManager");
    }
    cfFormManager = formManager;
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2,
                "argSchema");
    }
    if (whenChosen == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6,
                "whenChosen");
    }
    invokeWhenChosen = whenChosen;
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    javafxSchema = argSchema;
    javaFXFocus = argFocus;
    javafxContainer = argContainer;
    setJavaFXDataCollection(argDataCollection);
    dataTable = new TableView<ICFBamInt64TypeObj>();
    tableColumnObjKind = new TableColumn<ICFBamInt64TypeObj, String>("Class Code");
    tableColumnObjKind.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt64TypeObj, String>, ObservableValue<String>>() {
                @Override
                public ObservableValue<String> call(CellDataFeatures<ICFBamInt64TypeObj, String> p) {
                    ICFBamInt64TypeObj 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<ICFBamInt64TypeObj, String>, TableCell<ICFBamInt64TypeObj, String>>() {
                @Override
                public TableCell<ICFBamInt64TypeObj, String> call(TableColumn<ICFBamInt64TypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamInt64TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnObjKind);
    tableColumnId = new TableColumn<ICFBamInt64TypeObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt64TypeObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamInt64TypeObj, 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<ICFBamInt64TypeObj, Long>, TableCell<ICFBamInt64TypeObj, Long>>() {
                @Override
                public TableCell<ICFBamInt64TypeObj, Long> call(TableColumn<ICFBamInt64TypeObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamInt64TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamInt64TypeObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt64TypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamInt64TypeObj, 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<ICFBamInt64TypeObj, String>, TableCell<ICFBamInt64TypeObj, String>>() {
                @Override
                public TableCell<ICFBamInt64TypeObj, String> call(TableColumn<ICFBamInt64TypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamInt64TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamInt64TypeObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt64TypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamInt64TypeObj, 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<ICFBamInt64TypeObj, String>, TableCell<ICFBamInt64TypeObj, String>>() {
                @Override
                public TableCell<ICFBamInt64TypeObj, String> call(TableColumn<ICFBamInt64TypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamInt64TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamInt64TypeObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt64TypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamInt64TypeObj, 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<ICFBamInt64TypeObj, String>, TableCell<ICFBamInt64TypeObj, String>>() {
                @Override
                public TableCell<ICFBamInt64TypeObj, String> call(TableColumn<ICFBamInt64TypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamInt64TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamInt64TypeObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt64TypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamInt64TypeObj, 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<ICFBamInt64TypeObj, String>, TableCell<ICFBamInt64TypeObj, String>>() {
                @Override
                public TableCell<ICFBamInt64TypeObj, String> call(TableColumn<ICFBamInt64TypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamInt64TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamInt64TypeObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt64TypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamInt64TypeObj, 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<ICFBamInt64TypeObj, String>, TableCell<ICFBamInt64TypeObj, String>>() {
                @Override
                public TableCell<ICFBamInt64TypeObj, String> call(TableColumn<ICFBamInt64TypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamInt64TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnIsNullable = new TableColumn<ICFBamInt64TypeObj, Boolean>("Is Nullable");
    tableColumnIsNullable.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt64TypeObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt64TypeObj, 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<ICFBamInt64TypeObj, Boolean>, TableCell<ICFBamInt64TypeObj, Boolean>>() {
                @Override
                public TableCell<ICFBamInt64TypeObj, Boolean> call(
                        TableColumn<ICFBamInt64TypeObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamInt64TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsNullable);
    tableColumnGenerateId = new TableColumn<ICFBamInt64TypeObj, Boolean>("Generate Id");
    tableColumnGenerateId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt64TypeObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt64TypeObj, 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<ICFBamInt64TypeObj, Boolean>, TableCell<ICFBamInt64TypeObj, Boolean>>() {
                @Override
                public TableCell<ICFBamInt64TypeObj, Boolean> call(
                        TableColumn<ICFBamInt64TypeObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamInt64TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnGenerateId);
    tableColumnDefaultVisibility = new TableColumn<ICFBamInt64TypeObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt64TypeObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt64TypeObj, 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<ICFBamInt64TypeObj, Boolean>, TableCell<ICFBamInt64TypeObj, Boolean>>() {
                @Override
                public TableCell<ICFBamInt64TypeObj, Boolean> call(
                        TableColumn<ICFBamInt64TypeObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamInt64TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnDbName = new TableColumn<ICFBamInt64TypeObj, String>("Db Name");
    tableColumnDbName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt64TypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamInt64TypeObj, 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<ICFBamInt64TypeObj, String>, TableCell<ICFBamInt64TypeObj, String>>() {
                @Override
                public TableCell<ICFBamInt64TypeObj, String> call(TableColumn<ICFBamInt64TypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamInt64TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDbName);
    tableColumnInitValue = new TableColumn<ICFBamInt64TypeObj, Long>("Init. Value");
    tableColumnInitValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt64TypeObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamInt64TypeObj, 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<ICFBamInt64TypeObj, Long>, TableCell<ICFBamInt64TypeObj, Long>>() {
                @Override
                public TableCell<ICFBamInt64TypeObj, Long> call(TableColumn<ICFBamInt64TypeObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamInt64TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnInitValue);
    tableColumnDefaultValue = new TableColumn<ICFBamInt64TypeObj, Long>("Default Value");
    tableColumnDefaultValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt64TypeObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamInt64TypeObj, 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<ICFBamInt64TypeObj, Long>, TableCell<ICFBamInt64TypeObj, Long>>() {
                @Override
                public TableCell<ICFBamInt64TypeObj, Long> call(TableColumn<ICFBamInt64TypeObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamInt64TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultValue);
    tableColumnMinValue = new TableColumn<ICFBamInt64TypeObj, Long>("Min. Value");
    tableColumnMinValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt64TypeObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamInt64TypeObj, 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<ICFBamInt64TypeObj, Long>, TableCell<ICFBamInt64TypeObj, Long>>() {
                @Override
                public TableCell<ICFBamInt64TypeObj, Long> call(TableColumn<ICFBamInt64TypeObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamInt64TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnMinValue);
    tableColumnMaxValue = new TableColumn<ICFBamInt64TypeObj, Long>("Max. Value");
    tableColumnMaxValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt64TypeObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamInt64TypeObj, 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<ICFBamInt64TypeObj, Long>, TableCell<ICFBamInt64TypeObj, Long>>() {
                @Override
                public TableCell<ICFBamInt64TypeObj, Long> call(TableColumn<ICFBamInt64TypeObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamInt64TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnMaxValue);
    tableColumnNullValue = new TableColumn<ICFBamInt64TypeObj, Long>("Null Value");
    tableColumnNullValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt64TypeObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamInt64TypeObj, 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<ICFBamInt64TypeObj, Long>, TableCell<ICFBamInt64TypeObj, Long>>() {
                @Override
                public TableCell<ICFBamInt64TypeObj, Long> call(TableColumn<ICFBamInt64TypeObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamInt64TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnNullValue);
    tableColumnUnknownValue = new TableColumn<ICFBamInt64TypeObj, Long>("Unknown Value");
    tableColumnUnknownValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt64TypeObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamInt64TypeObj, 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<ICFBamInt64TypeObj, Long>, TableCell<ICFBamInt64TypeObj, Long>>() {
                @Override
                public TableCell<ICFBamInt64TypeObj, Long> call(TableColumn<ICFBamInt64TypeObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamInt64TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnUnknownValue);
    tableColumnLookupDefSchema = new TableColumn<ICFBamInt64TypeObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt64TypeObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamInt64TypeObj, ICFBamSchemaDefObj> p) {
                    ICFBamInt64TypeObj 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<ICFBamInt64TypeObj, ICFBamSchemaDefObj>, TableCell<ICFBamInt64TypeObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamInt64TypeObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamInt64TypeObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamInt64TypeObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamInt64TypeObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamInt64TypeObj> observable,
                ICFBamInt64TypeObj oldValue, ICFBamInt64TypeObj 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.choseInt64Type(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");
                }
                ICFBamInt64TypeObj selectedInstance = getJavaFXFocusAsInt64Type();
                invokeWhenChosen.choseInt64Type(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.CFBamJavaFXUInt32DefPickerPane.java

public CFBamJavaFXUInt32DefPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamUInt32DefObj argFocus, ICFBamScopeObj argContainer,
        Collection<ICFBamUInt32DefObj> argDataCollection, ICFBamJavaFXUInt32DefChosen whenChosen) {
    super();/*from w w  w .ja  v  a2  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<ICFBamUInt32DefObj>();
    tableColumnObjKind = new TableColumn<ICFBamUInt32DefObj, String>("Class Code");
    tableColumnObjKind.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt32DefObj, String>, ObservableValue<String>>() {
                @Override
                public ObservableValue<String> call(CellDataFeatures<ICFBamUInt32DefObj, String> p) {
                    ICFBamUInt32DefObj 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<ICFBamUInt32DefObj, String>, TableCell<ICFBamUInt32DefObj, String>>() {
                @Override
                public TableCell<ICFBamUInt32DefObj, String> call(TableColumn<ICFBamUInt32DefObj, String> arg) {
                    return new CFStringTableCell<ICFBamUInt32DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnObjKind);
    tableColumnId = new TableColumn<ICFBamUInt32DefObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt32DefObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamUInt32DefObj, 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<ICFBamUInt32DefObj, Long>, TableCell<ICFBamUInt32DefObj, Long>>() {
                @Override
                public TableCell<ICFBamUInt32DefObj, Long> call(TableColumn<ICFBamUInt32DefObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamUInt32DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamUInt32DefObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt32DefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamUInt32DefObj, 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<ICFBamUInt32DefObj, String>, TableCell<ICFBamUInt32DefObj, String>>() {
                @Override
                public TableCell<ICFBamUInt32DefObj, String> call(TableColumn<ICFBamUInt32DefObj, String> arg) {
                    return new CFStringTableCell<ICFBamUInt32DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamUInt32DefObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt32DefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamUInt32DefObj, 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<ICFBamUInt32DefObj, String>, TableCell<ICFBamUInt32DefObj, String>>() {
                @Override
                public TableCell<ICFBamUInt32DefObj, String> call(TableColumn<ICFBamUInt32DefObj, String> arg) {
                    return new CFStringTableCell<ICFBamUInt32DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamUInt32DefObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt32DefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamUInt32DefObj, 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<ICFBamUInt32DefObj, String>, TableCell<ICFBamUInt32DefObj, String>>() {
                @Override
                public TableCell<ICFBamUInt32DefObj, String> call(TableColumn<ICFBamUInt32DefObj, String> arg) {
                    return new CFStringTableCell<ICFBamUInt32DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamUInt32DefObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt32DefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamUInt32DefObj, 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<ICFBamUInt32DefObj, String>, TableCell<ICFBamUInt32DefObj, String>>() {
                @Override
                public TableCell<ICFBamUInt32DefObj, String> call(TableColumn<ICFBamUInt32DefObj, String> arg) {
                    return new CFStringTableCell<ICFBamUInt32DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamUInt32DefObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt32DefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamUInt32DefObj, 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<ICFBamUInt32DefObj, String>, TableCell<ICFBamUInt32DefObj, String>>() {
                @Override
                public TableCell<ICFBamUInt32DefObj, String> call(TableColumn<ICFBamUInt32DefObj, String> arg) {
                    return new CFStringTableCell<ICFBamUInt32DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnIsNullable = new TableColumn<ICFBamUInt32DefObj, Boolean>("Is Nullable");
    tableColumnIsNullable.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt32DefObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUInt32DefObj, 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<ICFBamUInt32DefObj, Boolean>, TableCell<ICFBamUInt32DefObj, Boolean>>() {
                @Override
                public TableCell<ICFBamUInt32DefObj, Boolean> call(
                        TableColumn<ICFBamUInt32DefObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamUInt32DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsNullable);
    tableColumnGenerateId = new TableColumn<ICFBamUInt32DefObj, Boolean>("Generate Id");
    tableColumnGenerateId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt32DefObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUInt32DefObj, 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<ICFBamUInt32DefObj, Boolean>, TableCell<ICFBamUInt32DefObj, Boolean>>() {
                @Override
                public TableCell<ICFBamUInt32DefObj, Boolean> call(
                        TableColumn<ICFBamUInt32DefObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamUInt32DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnGenerateId);
    tableColumnDefaultVisibility = new TableColumn<ICFBamUInt32DefObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt32DefObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUInt32DefObj, 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<ICFBamUInt32DefObj, Boolean>, TableCell<ICFBamUInt32DefObj, Boolean>>() {
                @Override
                public TableCell<ICFBamUInt32DefObj, Boolean> call(
                        TableColumn<ICFBamUInt32DefObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamUInt32DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnDbName = new TableColumn<ICFBamUInt32DefObj, String>("Db Name");
    tableColumnDbName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt32DefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamUInt32DefObj, 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<ICFBamUInt32DefObj, String>, TableCell<ICFBamUInt32DefObj, String>>() {
                @Override
                public TableCell<ICFBamUInt32DefObj, String> call(TableColumn<ICFBamUInt32DefObj, String> arg) {
                    return new CFStringTableCell<ICFBamUInt32DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDbName);
    tableColumnInitValue = new TableColumn<ICFBamUInt32DefObj, Long>("Init. Value");
    tableColumnInitValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt32DefObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamUInt32DefObj, Long> p) {
                    ICFBamUInt32DefObj 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<ICFBamUInt32DefObj, Long>, TableCell<ICFBamUInt32DefObj, Long>>() {
                @Override
                public TableCell<ICFBamUInt32DefObj, Long> call(TableColumn<ICFBamUInt32DefObj, Long> arg) {
                    return new CFUInt32TableCell<ICFBamUInt32DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnInitValue);
    tableColumnDefaultValue = new TableColumn<ICFBamUInt32DefObj, Long>("Default Value");
    tableColumnDefaultValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt32DefObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamUInt32DefObj, Long> p) {
                    ICFBamUInt32DefObj 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<ICFBamUInt32DefObj, Long>, TableCell<ICFBamUInt32DefObj, Long>>() {
                @Override
                public TableCell<ICFBamUInt32DefObj, Long> call(TableColumn<ICFBamUInt32DefObj, Long> arg) {
                    return new CFUInt32TableCell<ICFBamUInt32DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultValue);
    tableColumnMinValue = new TableColumn<ICFBamUInt32DefObj, Long>("Min. Value");
    tableColumnMinValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt32DefObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamUInt32DefObj, Long> p) {
                    ICFBamUInt32DefObj 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<ICFBamUInt32DefObj, Long>, TableCell<ICFBamUInt32DefObj, Long>>() {
                @Override
                public TableCell<ICFBamUInt32DefObj, Long> call(TableColumn<ICFBamUInt32DefObj, Long> arg) {
                    return new CFUInt32TableCell<ICFBamUInt32DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnMinValue);
    tableColumnMaxValue = new TableColumn<ICFBamUInt32DefObj, Long>("Max. Value");
    tableColumnMaxValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt32DefObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamUInt32DefObj, Long> p) {
                    ICFBamUInt32DefObj 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<ICFBamUInt32DefObj, Long>, TableCell<ICFBamUInt32DefObj, Long>>() {
                @Override
                public TableCell<ICFBamUInt32DefObj, Long> call(TableColumn<ICFBamUInt32DefObj, Long> arg) {
                    return new CFUInt32TableCell<ICFBamUInt32DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnMaxValue);
    tableColumnNullValue = new TableColumn<ICFBamUInt32DefObj, Long>("Null Value");
    tableColumnNullValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt32DefObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamUInt32DefObj, Long> p) {
                    ICFBamUInt32DefObj 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<ICFBamUInt32DefObj, Long>, TableCell<ICFBamUInt32DefObj, Long>>() {
                @Override
                public TableCell<ICFBamUInt32DefObj, Long> call(TableColumn<ICFBamUInt32DefObj, Long> arg) {
                    return new CFUInt32TableCell<ICFBamUInt32DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnNullValue);
    tableColumnUnknownValue = new TableColumn<ICFBamUInt32DefObj, Long>("Unknown Value");
    tableColumnUnknownValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt32DefObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamUInt32DefObj, Long> p) {
                    ICFBamUInt32DefObj 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<ICFBamUInt32DefObj, Long>, TableCell<ICFBamUInt32DefObj, Long>>() {
                @Override
                public TableCell<ICFBamUInt32DefObj, Long> call(TableColumn<ICFBamUInt32DefObj, Long> arg) {
                    return new CFUInt32TableCell<ICFBamUInt32DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnUnknownValue);
    tableColumnLookupDefSchema = new TableColumn<ICFBamUInt32DefObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt32DefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamUInt32DefObj, ICFBamSchemaDefObj> p) {
                    ICFBamUInt32DefObj 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<ICFBamUInt32DefObj, ICFBamSchemaDefObj>, TableCell<ICFBamUInt32DefObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamUInt32DefObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamUInt32DefObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamUInt32DefObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamUInt32DefObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamUInt32DefObj> observable,
                ICFBamUInt32DefObj oldValue, ICFBamUInt32DefObj 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.choseUInt32Def(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");
                }
                ICFBamUInt32DefObj selectedInstance = getJavaFXFocusAsUInt32Def();
                invokeWhenChosen.choseUInt32Def(selectedInstance);
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonChooseSelected);
    if (argFocus != null) {
        dataTable.getSelectionModel().select(argFocus);
    }
    setTop(hboxMenu);
    setCenter(dataTable);
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXTimestampTypePickerPane.java

public CFBamJavaFXTimestampTypePickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamTimestampTypeObj argFocus, ICFBamSchemaDefObj argContainer,
        Collection<ICFBamTimestampTypeObj> argDataCollection, ICFBamJavaFXTimestampTypeChosen whenChosen) {
    super();/*from w  ww.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");
    }
    if (whenChosen == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6,
                "whenChosen");
    }
    invokeWhenChosen = whenChosen;
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    javafxSchema = argSchema;
    javaFXFocus = argFocus;
    javafxContainer = argContainer;
    setJavaFXDataCollection(argDataCollection);
    dataTable = new TableView<ICFBamTimestampTypeObj>();
    tableColumnId = new TableColumn<ICFBamTimestampTypeObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampTypeObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamTimestampTypeObj, Long> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        long value = obj.getRequiredId();
                        Long wrapped = new Long(value);
                        ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnId.setCellFactory(
            new Callback<TableColumn<ICFBamTimestampTypeObj, Long>, TableCell<ICFBamTimestampTypeObj, Long>>() {
                @Override
                public TableCell<ICFBamTimestampTypeObj, Long> call(
                        TableColumn<ICFBamTimestampTypeObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamTimestampTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamTimestampTypeObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampTypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampTypeObj, String> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getRequiredName();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnName.setCellFactory(
            new Callback<TableColumn<ICFBamTimestampTypeObj, String>, TableCell<ICFBamTimestampTypeObj, String>>() {
                @Override
                public TableCell<ICFBamTimestampTypeObj, String> call(
                        TableColumn<ICFBamTimestampTypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamTimestampTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamTimestampTypeObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampTypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampTypeObj, String> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalShortName();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnShortName.setCellFactory(
            new Callback<TableColumn<ICFBamTimestampTypeObj, String>, TableCell<ICFBamTimestampTypeObj, String>>() {
                @Override
                public TableCell<ICFBamTimestampTypeObj, String> call(
                        TableColumn<ICFBamTimestampTypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamTimestampTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamTimestampTypeObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampTypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampTypeObj, String> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalLabel();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnLabel.setCellFactory(
            new Callback<TableColumn<ICFBamTimestampTypeObj, String>, TableCell<ICFBamTimestampTypeObj, String>>() {
                @Override
                public TableCell<ICFBamTimestampTypeObj, String> call(
                        TableColumn<ICFBamTimestampTypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamTimestampTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamTimestampTypeObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampTypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampTypeObj, String> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalShortDescription();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnShortDescription.setCellFactory(
            new Callback<TableColumn<ICFBamTimestampTypeObj, String>, TableCell<ICFBamTimestampTypeObj, String>>() {
                @Override
                public TableCell<ICFBamTimestampTypeObj, String> call(
                        TableColumn<ICFBamTimestampTypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamTimestampTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamTimestampTypeObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampTypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampTypeObj, String> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalDescription();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDescription.setCellFactory(
            new Callback<TableColumn<ICFBamTimestampTypeObj, String>, TableCell<ICFBamTimestampTypeObj, String>>() {
                @Override
                public TableCell<ICFBamTimestampTypeObj, String> call(
                        TableColumn<ICFBamTimestampTypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamTimestampTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnIsNullable = new TableColumn<ICFBamTimestampTypeObj, Boolean>("Is Nullable");
    tableColumnIsNullable.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampTypeObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimestampTypeObj, Boolean> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        boolean value = obj.getRequiredIsNullable();
                        Boolean wrapped = new Boolean(value);
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnIsNullable.setCellFactory(
            new Callback<TableColumn<ICFBamTimestampTypeObj, Boolean>, TableCell<ICFBamTimestampTypeObj, Boolean>>() {
                @Override
                public TableCell<ICFBamTimestampTypeObj, Boolean> call(
                        TableColumn<ICFBamTimestampTypeObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamTimestampTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsNullable);
    tableColumnGenerateId = new TableColumn<ICFBamTimestampTypeObj, Boolean>("Generate Id");
    tableColumnGenerateId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampTypeObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimestampTypeObj, Boolean> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Boolean value = obj.getOptionalGenerateId();
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnGenerateId.setCellFactory(
            new Callback<TableColumn<ICFBamTimestampTypeObj, Boolean>, TableCell<ICFBamTimestampTypeObj, Boolean>>() {
                @Override
                public TableCell<ICFBamTimestampTypeObj, Boolean> call(
                        TableColumn<ICFBamTimestampTypeObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamTimestampTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnGenerateId);
    tableColumnDefaultVisibility = new TableColumn<ICFBamTimestampTypeObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampTypeObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimestampTypeObj, Boolean> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        boolean value = obj.getRequiredDefaultVisibility();
                        Boolean wrapped = new Boolean(value);
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnDefaultVisibility.setCellFactory(
            new Callback<TableColumn<ICFBamTimestampTypeObj, Boolean>, TableCell<ICFBamTimestampTypeObj, Boolean>>() {
                @Override
                public TableCell<ICFBamTimestampTypeObj, Boolean> call(
                        TableColumn<ICFBamTimestampTypeObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamTimestampTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnDbName = new TableColumn<ICFBamTimestampTypeObj, String>("Db Name");
    tableColumnDbName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampTypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampTypeObj, String> p) {
                    ICFBamAtomObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalDbName();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDbName.setCellFactory(
            new Callback<TableColumn<ICFBamTimestampTypeObj, String>, TableCell<ICFBamTimestampTypeObj, String>>() {
                @Override
                public TableCell<ICFBamTimestampTypeObj, String> call(
                        TableColumn<ICFBamTimestampTypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamTimestampTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDbName);
    tableColumnInitValue = new TableColumn<ICFBamTimestampTypeObj, Calendar>("Init. Value");
    tableColumnInitValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampTypeObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampTypeObj, Calendar> p) {
                    ICFBamTimestampDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Calendar value = obj.getOptionalInitValue();
                        ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnInitValue.setCellFactory(
            new Callback<TableColumn<ICFBamTimestampTypeObj, Calendar>, TableCell<ICFBamTimestampTypeObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTimestampTypeObj, Calendar> call(
                        TableColumn<ICFBamTimestampTypeObj, Calendar> arg) {
                    return new CFTimestampTableCell<ICFBamTimestampTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnInitValue);
    tableColumnDefaultValue = new TableColumn<ICFBamTimestampTypeObj, Calendar>("Default Value");
    tableColumnDefaultValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampTypeObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampTypeObj, Calendar> p) {
                    ICFBamTimestampDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Calendar value = obj.getOptionalDefaultValue();
                        ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDefaultValue.setCellFactory(
            new Callback<TableColumn<ICFBamTimestampTypeObj, Calendar>, TableCell<ICFBamTimestampTypeObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTimestampTypeObj, Calendar> call(
                        TableColumn<ICFBamTimestampTypeObj, Calendar> arg) {
                    return new CFTimestampTableCell<ICFBamTimestampTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultValue);
    tableColumnMinValue = new TableColumn<ICFBamTimestampTypeObj, Calendar>("Min. Value");
    tableColumnMinValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampTypeObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampTypeObj, Calendar> p) {
                    ICFBamTimestampDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Calendar value = obj.getOptionalMinValue();
                        ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnMinValue.setCellFactory(
            new Callback<TableColumn<ICFBamTimestampTypeObj, Calendar>, TableCell<ICFBamTimestampTypeObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTimestampTypeObj, Calendar> call(
                        TableColumn<ICFBamTimestampTypeObj, Calendar> arg) {
                    return new CFTimestampTableCell<ICFBamTimestampTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnMinValue);
    tableColumnMaxValue = new TableColumn<ICFBamTimestampTypeObj, Calendar>("Max. Value");
    tableColumnMaxValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampTypeObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampTypeObj, Calendar> p) {
                    ICFBamTimestampDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Calendar value = obj.getOptionalMaxValue();
                        ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnMaxValue.setCellFactory(
            new Callback<TableColumn<ICFBamTimestampTypeObj, Calendar>, TableCell<ICFBamTimestampTypeObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTimestampTypeObj, Calendar> call(
                        TableColumn<ICFBamTimestampTypeObj, Calendar> arg) {
                    return new CFTimestampTableCell<ICFBamTimestampTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnMaxValue);
    tableColumnNullValue = new TableColumn<ICFBamTimestampTypeObj, Calendar>("Null Value");
    tableColumnNullValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampTypeObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampTypeObj, Calendar> p) {
                    ICFBamTimestampDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Calendar value = obj.getOptionalNullValue();
                        ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnNullValue.setCellFactory(
            new Callback<TableColumn<ICFBamTimestampTypeObj, Calendar>, TableCell<ICFBamTimestampTypeObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTimestampTypeObj, Calendar> call(
                        TableColumn<ICFBamTimestampTypeObj, Calendar> arg) {
                    return new CFTimestampTableCell<ICFBamTimestampTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnNullValue);
    tableColumnUnknownValue = new TableColumn<ICFBamTimestampTypeObj, Calendar>("Unknown Value");
    tableColumnUnknownValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampTypeObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampTypeObj, Calendar> p) {
                    ICFBamTimestampDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Calendar value = obj.getOptionalUnknownValue();
                        ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnUnknownValue.setCellFactory(
            new Callback<TableColumn<ICFBamTimestampTypeObj, Calendar>, TableCell<ICFBamTimestampTypeObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTimestampTypeObj, Calendar> call(
                        TableColumn<ICFBamTimestampTypeObj, Calendar> arg) {
                    return new CFTimestampTableCell<ICFBamTimestampTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnUnknownValue);
    tableColumnLookupDefSchema = new TableColumn<ICFBamTimestampTypeObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampTypeObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamTimestampTypeObj, ICFBamSchemaDefObj> p) {
                    ICFBamTimestampTypeObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema();
                        ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupDefSchema.setCellFactory(
            new Callback<TableColumn<ICFBamTimestampTypeObj, ICFBamSchemaDefObj>, TableCell<ICFBamTimestampTypeObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamTimestampTypeObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamTimestampTypeObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamTimestampTypeObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty()
            .addListener(new ChangeListener<ICFBamTimestampTypeObj>() {
                @Override
                public void changed(ObservableValue<? extends ICFBamTimestampTypeObj> observable,
                        ICFBamTimestampTypeObj oldValue, ICFBamTimestampTypeObj newValue) {
                    setJavaFXFocus(newValue);
                    if (buttonChooseSelected != null) {
                        if (newValue != null) {
                            buttonChooseSelected.setDisable(false);
                        } else {
                            buttonChooseSelected.setDisable(true);
                        }
                    }
                }
            });
    hboxMenu = new CFHBox(10);
    buttonCancel = new CFButton();
    buttonCancel.setMinWidth(200);
    buttonCancel.setText("Cancel");
    buttonCancel.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonCancel);
    buttonChooseNone = new CFButton();
    buttonChooseNone.setMinWidth(200);
    buttonChooseNone.setText("ChooseNone");
    buttonChooseNone.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                if (schemaObj == null) {
                    throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                            "schemaObj");
                }
                invokeWhenChosen.choseTimestampType(null);
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonChooseNone);
    buttonChooseSelected = new CFButton();
    buttonChooseSelected.setMinWidth(200);
    buttonChooseSelected.setText("ChooseSelected");
    buttonChooseSelected.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                if (schemaObj == null) {
                    throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                            "schemaObj");
                }
                ICFBamTimestampTypeObj selectedInstance = getJavaFXFocusAsTimestampType();
                invokeWhenChosen.choseTimestampType(selectedInstance);
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonChooseSelected);
    if (argFocus != null) {
        dataTable.getSelectionModel().select(argFocus);
    }
    setTop(hboxMenu);
    setCenter(dataTable);
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXInt16TypePickerPane.java

public CFBamJavaFXInt16TypePickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamInt16TypeObj argFocus, ICFBamSchemaDefObj argContainer,
        Collection<ICFBamInt16TypeObj> argDataCollection, ICFBamJavaFXInt16TypeChosen whenChosen) {
    super();// ww  w. j av a  2  s  . c om
    final String S_ProcName = "construct-schema-focus";
    if (formManager == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "formManager");
    }
    cfFormManager = formManager;
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2,
                "argSchema");
    }
    if (whenChosen == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6,
                "whenChosen");
    }
    invokeWhenChosen = whenChosen;
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    javafxSchema = argSchema;
    javaFXFocus = argFocus;
    javafxContainer = argContainer;
    setJavaFXDataCollection(argDataCollection);
    dataTable = new TableView<ICFBamInt16TypeObj>();
    tableColumnObjKind = new TableColumn<ICFBamInt16TypeObj, String>("Class Code");
    tableColumnObjKind.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt16TypeObj, String>, ObservableValue<String>>() {
                @Override
                public ObservableValue<String> call(CellDataFeatures<ICFBamInt16TypeObj, String> p) {
                    ICFBamInt16TypeObj 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<ICFBamInt16TypeObj, String>, TableCell<ICFBamInt16TypeObj, String>>() {
                @Override
                public TableCell<ICFBamInt16TypeObj, String> call(TableColumn<ICFBamInt16TypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamInt16TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnObjKind);
    tableColumnId = new TableColumn<ICFBamInt16TypeObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt16TypeObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamInt16TypeObj, 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<ICFBamInt16TypeObj, Long>, TableCell<ICFBamInt16TypeObj, Long>>() {
                @Override
                public TableCell<ICFBamInt16TypeObj, Long> call(TableColumn<ICFBamInt16TypeObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamInt16TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamInt16TypeObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt16TypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamInt16TypeObj, 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<ICFBamInt16TypeObj, String>, TableCell<ICFBamInt16TypeObj, String>>() {
                @Override
                public TableCell<ICFBamInt16TypeObj, String> call(TableColumn<ICFBamInt16TypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamInt16TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamInt16TypeObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt16TypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamInt16TypeObj, 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<ICFBamInt16TypeObj, String>, TableCell<ICFBamInt16TypeObj, String>>() {
                @Override
                public TableCell<ICFBamInt16TypeObj, String> call(TableColumn<ICFBamInt16TypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamInt16TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamInt16TypeObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt16TypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamInt16TypeObj, 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<ICFBamInt16TypeObj, String>, TableCell<ICFBamInt16TypeObj, String>>() {
                @Override
                public TableCell<ICFBamInt16TypeObj, String> call(TableColumn<ICFBamInt16TypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamInt16TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamInt16TypeObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt16TypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamInt16TypeObj, 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<ICFBamInt16TypeObj, String>, TableCell<ICFBamInt16TypeObj, String>>() {
                @Override
                public TableCell<ICFBamInt16TypeObj, String> call(TableColumn<ICFBamInt16TypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamInt16TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamInt16TypeObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt16TypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamInt16TypeObj, 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<ICFBamInt16TypeObj, String>, TableCell<ICFBamInt16TypeObj, String>>() {
                @Override
                public TableCell<ICFBamInt16TypeObj, String> call(TableColumn<ICFBamInt16TypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamInt16TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnIsNullable = new TableColumn<ICFBamInt16TypeObj, Boolean>("Is Nullable");
    tableColumnIsNullable.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt16TypeObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt16TypeObj, 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<ICFBamInt16TypeObj, Boolean>, TableCell<ICFBamInt16TypeObj, Boolean>>() {
                @Override
                public TableCell<ICFBamInt16TypeObj, Boolean> call(
                        TableColumn<ICFBamInt16TypeObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamInt16TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsNullable);
    tableColumnGenerateId = new TableColumn<ICFBamInt16TypeObj, Boolean>("Generate Id");
    tableColumnGenerateId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt16TypeObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt16TypeObj, 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<ICFBamInt16TypeObj, Boolean>, TableCell<ICFBamInt16TypeObj, Boolean>>() {
                @Override
                public TableCell<ICFBamInt16TypeObj, Boolean> call(
                        TableColumn<ICFBamInt16TypeObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamInt16TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnGenerateId);
    tableColumnDefaultVisibility = new TableColumn<ICFBamInt16TypeObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt16TypeObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt16TypeObj, 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<ICFBamInt16TypeObj, Boolean>, TableCell<ICFBamInt16TypeObj, Boolean>>() {
                @Override
                public TableCell<ICFBamInt16TypeObj, Boolean> call(
                        TableColumn<ICFBamInt16TypeObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamInt16TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnDbName = new TableColumn<ICFBamInt16TypeObj, String>("Db Name");
    tableColumnDbName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt16TypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamInt16TypeObj, 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<ICFBamInt16TypeObj, String>, TableCell<ICFBamInt16TypeObj, String>>() {
                @Override
                public TableCell<ICFBamInt16TypeObj, String> call(TableColumn<ICFBamInt16TypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamInt16TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDbName);
    tableColumnInitValue = new TableColumn<ICFBamInt16TypeObj, Short>("Init. Value");
    tableColumnInitValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt16TypeObj, Short>, ObservableValue<Short>>() {
                public ObservableValue<Short> call(CellDataFeatures<ICFBamInt16TypeObj, 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<ICFBamInt16TypeObj, Short>, TableCell<ICFBamInt16TypeObj, Short>>() {
                @Override
                public TableCell<ICFBamInt16TypeObj, Short> call(TableColumn<ICFBamInt16TypeObj, Short> arg) {
                    return new CFInt16TableCell<ICFBamInt16TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnInitValue);
    tableColumnDefaultValue = new TableColumn<ICFBamInt16TypeObj, Short>("Default Value");
    tableColumnDefaultValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt16TypeObj, Short>, ObservableValue<Short>>() {
                public ObservableValue<Short> call(CellDataFeatures<ICFBamInt16TypeObj, 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<ICFBamInt16TypeObj, Short>, TableCell<ICFBamInt16TypeObj, Short>>() {
                @Override
                public TableCell<ICFBamInt16TypeObj, Short> call(TableColumn<ICFBamInt16TypeObj, Short> arg) {
                    return new CFInt16TableCell<ICFBamInt16TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultValue);
    tableColumnMinValue = new TableColumn<ICFBamInt16TypeObj, Short>("Min. Value");
    tableColumnMinValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt16TypeObj, Short>, ObservableValue<Short>>() {
                public ObservableValue<Short> call(CellDataFeatures<ICFBamInt16TypeObj, 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<ICFBamInt16TypeObj, Short>, TableCell<ICFBamInt16TypeObj, Short>>() {
                @Override
                public TableCell<ICFBamInt16TypeObj, Short> call(TableColumn<ICFBamInt16TypeObj, Short> arg) {
                    return new CFInt16TableCell<ICFBamInt16TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnMinValue);
    tableColumnMaxValue = new TableColumn<ICFBamInt16TypeObj, Short>("Max. Value");
    tableColumnMaxValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt16TypeObj, Short>, ObservableValue<Short>>() {
                public ObservableValue<Short> call(CellDataFeatures<ICFBamInt16TypeObj, 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<ICFBamInt16TypeObj, Short>, TableCell<ICFBamInt16TypeObj, Short>>() {
                @Override
                public TableCell<ICFBamInt16TypeObj, Short> call(TableColumn<ICFBamInt16TypeObj, Short> arg) {
                    return new CFInt16TableCell<ICFBamInt16TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnMaxValue);
    tableColumnNullValue = new TableColumn<ICFBamInt16TypeObj, Short>("Null Value");
    tableColumnNullValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt16TypeObj, Short>, ObservableValue<Short>>() {
                public ObservableValue<Short> call(CellDataFeatures<ICFBamInt16TypeObj, 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<ICFBamInt16TypeObj, Short>, TableCell<ICFBamInt16TypeObj, Short>>() {
                @Override
                public TableCell<ICFBamInt16TypeObj, Short> call(TableColumn<ICFBamInt16TypeObj, Short> arg) {
                    return new CFInt16TableCell<ICFBamInt16TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnNullValue);
    tableColumnUnknownValue = new TableColumn<ICFBamInt16TypeObj, Short>("Unknown Value");
    tableColumnUnknownValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt16TypeObj, Short>, ObservableValue<Short>>() {
                public ObservableValue<Short> call(CellDataFeatures<ICFBamInt16TypeObj, 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<ICFBamInt16TypeObj, Short>, TableCell<ICFBamInt16TypeObj, Short>>() {
                @Override
                public TableCell<ICFBamInt16TypeObj, Short> call(TableColumn<ICFBamInt16TypeObj, Short> arg) {
                    return new CFInt16TableCell<ICFBamInt16TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnUnknownValue);
    tableColumnLookupDefSchema = new TableColumn<ICFBamInt16TypeObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt16TypeObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamInt16TypeObj, ICFBamSchemaDefObj> p) {
                    ICFBamInt16TypeObj 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<ICFBamInt16TypeObj, ICFBamSchemaDefObj>, TableCell<ICFBamInt16TypeObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamInt16TypeObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamInt16TypeObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamInt16TypeObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamInt16TypeObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamInt16TypeObj> observable,
                ICFBamInt16TypeObj oldValue, ICFBamInt16TypeObj 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.choseInt16Type(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");
                }
                ICFBamInt16TypeObj selectedInstance = getJavaFXFocusAsInt16Type();
                invokeWhenChosen.choseInt16Type(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:org.wandora.application.gui.topicpanels.webview.WebViewPanel.java

private void initFX(final JFXPanel fxPanel) {
    Group group = new Group();
    Scene scene = new Scene(group);
    fxPanel.setScene(scene);//from   w w w .j a v a  2s.c o  m

    webView = new WebView();

    if (javaFXVersionInt >= 8) {
        webView.setScaleX(1.0);
        webView.setScaleY(1.0);
        //webView.setFitToHeight(false);
        //webView.setFitToWidth(false);
        //webView.setZoom(javafx.stage.Screen.getPrimary().getDpi() / 96);
    }

    group.getChildren().add(webView);

    int w = this.getWidth();
    int h = this.getHeight() - 34;

    webView.setMinSize(w, h);
    webView.setMaxSize(w, h);
    webView.setPrefSize(w, h);

    // Obtain the webEngine to navigate
    webEngine = webView.getEngine();

    webEngine.locationProperty().addListener(new ChangeListener<String>() {
        @Override
        public void changed(ObservableValue<? extends String> observable, String oldValue,
                final String newValue) {
            if (newValue.endsWith(".pdf")) {
                try {
                    int a = WandoraOptionPane.showConfirmDialog(Wandora.getWandora(),
                            "Open PDF document in external application?",
                            "Open PDF document in external application?", WandoraOptionPane.YES_NO_OPTION);
                    if (a == WandoraOptionPane.YES_OPTION) {
                        Desktop dt = Desktop.getDesktop();
                        dt.browse(new URI(newValue));
                    }
                } catch (Exception e) {
                }
            } else {
                SwingUtilities.invokeLater(new Runnable() {
                    @Override
                    public void run() {
                        urlTextField.setText(newValue);
                    }
                });
            }
        }
    });
    webEngine.titleProperty().addListener(new ChangeListener<String>() {
        @Override
        public void changed(ObservableValue<? extends String> observable, String oldValue,
                final String newValue) {
            SwingUtilities.invokeLater(new Runnable() {
                @Override
                public void run() {
                    title = newValue;
                }
            });
        }
    });
    webEngine.setOnAlert(new EventHandler<WebEvent<java.lang.String>>() {
        @Override
        public void handle(WebEvent<String> t) {
            if (t != null) {
                String str = t.getData();
                if (str != null && str.length() > 0) {
                    WandoraOptionPane.showMessageDialog(Wandora.getWandora(), str, "Javascript Alert",
                            WandoraOptionPane.PLAIN_MESSAGE);
                }
            }
        }
    });
    webEngine.setConfirmHandler(new Callback<String, Boolean>() {
        @Override
        public Boolean call(String msg) {
            int a = WandoraOptionPane.showConfirmDialog(Wandora.getWandora(), msg, "Javascript Alert",
                    WandoraOptionPane.YES_NO_OPTION);
            return (a == WandoraOptionPane.YES_OPTION);
        }
    });
    webEngine.setPromptHandler(new Callback<PromptData, String>() {
        @Override
        public String call(PromptData data) {
            String a = WandoraOptionPane.showInputDialog(Wandora.getWandora(), data.getMessage(),
                    data.getDefaultValue(), "Javascript Alert", WandoraOptionPane.QUESTION_MESSAGE);
            return a;
        }
    });

    webEngine.setCreatePopupHandler(new Callback<PopupFeatures, WebEngine>() {
        @Override
        public WebEngine call(PopupFeatures features) {
            if (informPopupBlocking) {
                WandoraOptionPane.showMessageDialog(Wandora.getWandora(),
                        "A javascript popup has been blocked. Wandora doesn't allow javascript popups in Webview topic panel.",
                        "Javascript popup blocked", WandoraOptionPane.PLAIN_MESSAGE);
            }
            informPopupBlocking = false;
            return null;
        }
    });
    webEngine.setOnVisibilityChanged(new EventHandler<WebEvent<Boolean>>() {
        @Override
        public void handle(WebEvent<Boolean> t) {
            if (t != null) {
                Boolean b = t.getData();
                if (informVisibilityChanges) {
                    WandoraOptionPane.showMessageDialog(Wandora.getWandora(),
                            "A browser window visibility change has been blocked. Wandora doesn't allow visibility changes of windows in Webview topic panel.",
                            "Javascript visibility chnage blocked", WandoraOptionPane.PLAIN_MESSAGE);
                    informVisibilityChanges = false;
                }
            }
        }
    });
    webEngine.getLoadWorker().stateProperty().addListener(new ChangeListener<State>() {
        @Override
        public void changed(ObservableValue ov, State oldState, State newState) {
            if (newState == Worker.State.SCHEDULED) {
                //System.out.println("Scheduled!");
                startLoadingAnimation();
            }
            if (newState == Worker.State.SUCCEEDED) {
                Document doc = webEngine.getDocument();
                try {
                    Transformer transformer = TransformerFactory.newInstance().newTransformer();
                    //transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "no");
                    transformer.setOutputProperty(OutputKeys.METHOD, "xml");
                    transformer.setOutputProperty(OutputKeys.INDENT, "yes");
                    transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
                    transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");

                    // transformer.transform(new DOMSource(doc), new StreamResult(new OutputStreamWriter(System.out, "UTF-8")));

                    StringWriter stringWriter = new StringWriter();
                    transformer.transform(new DOMSource(doc), new StreamResult(stringWriter));
                    webSource = stringWriter.toString();
                } catch (Exception ex) {
                    ex.printStackTrace();
                }
                stopLoadingAnimation();
            } else if (newState == Worker.State.CANCELLED) {
                //System.out.println("Cancelled!");
                stopLoadingAnimation();
            } else if (newState == Worker.State.FAILED) {
                webEngine.loadContent(failedToOpenMessage);
                stopLoadingAnimation();
            }
        }
    });

}

From source file:condorclient.CreateJobDialogController.java

public void configAvailMachinesPane() {

    URL collector_url = null;//from w w w .  j a v a  2 s . com
    XMLHandler handler = new XMLHandler();
    String collectorStr = handler.getURL("collector");
    try {
        collector_url = new URL(collectorStr);
    } catch (MalformedURLException e3) {
        // TODO Auto-generated catch block
        e3.printStackTrace();
    }
    ClassAd ad = null;//birdbath.ClassAd;

    ClassAdStructAttr[][] startdAdsArray = null;

    Collector c = null;
    try {
        c = new Collector(collector_url);
    } catch (ServiceException ex) {
        Logger.getLogger(CondorClient.class.getName()).log(Level.SEVERE, null, ex);
    }
    try {
        startdAdsArray = c.queryStartdAds("");//owner==\"lianxiang\"
    } catch (RemoteException ex) {
        Logger.getLogger(CondorClient.class.getName()).log(Level.SEVERE, null, ex);
    }

    String ip = null;
    String slotName = null;
    resourcesClassAds.clear();
    map.clear();

    for (ClassAdStructAttr[] x : startdAdsArray) {

        ad = new ClassAd(x);

        ip = ad.get("MyAddress");
        String ipStr = ip.substring(ip.indexOf("<") + 1, ip.indexOf(":"));
        // System.out.println(ad.toString());
        ObservableList<String> slotlist;

        slotlist = FXCollections.<String>observableArrayList();
        slotName = ad.get("Name");//

        if (!map.containsKey(ipStr)) {

            map.put(ipStr, slotlist);
        }

        map.get(ipStr).add(slotName);

        //PublicClaimId
    }

    showBoxNum = map.size();
    nodeNum = showBoxNum;
    selectedMachine = new int[nodeNum];
    //  vb=new VBox();
    //  machineBox.setSpacing(3);
    int i = 0;
    for (String s : map.keySet()) {
        CheckBox n = new CheckBox();
        String boxId = "box" + i;
        n.setId(boxId);
        n.setText(s);
        slotNum = slotNum + map.get(s).size();
        n.setOnAction(new EventHandler<ActionEvent>() {

            @Override
            public void handle(ActionEvent event) {
                String s = event.getTarget().toString();
                // System.out.println(s);
                String id = s.substring(s.indexOf("=box") + 4, s.indexOf(","));
                System.out.println("boxid" + id);
                //String ip = s.substring(s.indexOf("]'") + 2, s.indexOf("'"));
                int intid = Integer.parseInt(id);//Integer.getInteger(id);
                //  System.out.println(intid + "id" + id);
                // CheckBox sbox = (CheckBox) availMachines.getChildren().get(intid);
                CheckBox sbox = (CheckBox) machineBox.getChildren().get(intid);
                if (sbox.isSelected()) {
                    selectedMachine[intid] = 1;
                    // System.out.println(selectedMachine[intid]);
                    apponitmap.putIfAbsent(sbox.getText().trim(), map.get(sbox.getText().trim()));//?ipslots
                    appointslotNum = appointslotNum + map.get(sbox.getText().trim()).size();//

                    System.out.println("machine id " + sbox.getText().trim() + "machine size"
                            + map.get(sbox.getText().trim()).size());
                } else {
                    selectedMachine[intid] = 0;
                    System.out.println("weixuanzhoong:" + selectedMachine[intid]);
                    if (apponitmap.containsKey(sbox.getText())) {
                        apponitmap.remove(sbox.getText());
                    }
                    appointslotNum = appointslotNum - map.get(sbox.getText().trim()).size();//
                }
                otherError.setText("");
                availCpuNumText.setText("");
                availCpuNumText.setText("" + appointslotNum);
                availCpuNumText.setDisable(true);
                availNodeNumText.setText("");
                availNodeNumText.setText("" + apponitmap.size());
                availNodeNumText.setDisable(true);
                // System.out.println("apponitmap.size():" + apponitmap.size() + "apponitmap.values().size():" + apponitmap.values().size());

            }
        });

        //availMachines.getChildren().add(n);
        machineBox.getChildren().add(n);

        //  boxContainer.getChildren().get(showBoxNum - 1).setVisible(true);
        i++;

    }
    // availMachines.getChildren().add(vb);

}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXDoubleDefPickerPane.java

public CFBamJavaFXDoubleDefPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamDoubleDefObj argFocus, ICFBamScopeObj argContainer,
        Collection<ICFBamDoubleDefObj> argDataCollection, ICFBamJavaFXDoubleDefChosen whenChosen) {
    super();//from  w  w w  .  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<ICFBamDoubleDefObj>();
    tableColumnObjKind = new TableColumn<ICFBamDoubleDefObj, String>("Class Code");
    tableColumnObjKind.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDoubleDefObj, String>, ObservableValue<String>>() {
                @Override
                public ObservableValue<String> call(CellDataFeatures<ICFBamDoubleDefObj, String> p) {
                    ICFBamDoubleDefObj 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<ICFBamDoubleDefObj, String>, TableCell<ICFBamDoubleDefObj, String>>() {
                @Override
                public TableCell<ICFBamDoubleDefObj, String> call(TableColumn<ICFBamDoubleDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamDoubleDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnObjKind);
    tableColumnId = new TableColumn<ICFBamDoubleDefObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDoubleDefObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamDoubleDefObj, 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<ICFBamDoubleDefObj, Long>, TableCell<ICFBamDoubleDefObj, Long>>() {
                @Override
                public TableCell<ICFBamDoubleDefObj, Long> call(TableColumn<ICFBamDoubleDefObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamDoubleDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamDoubleDefObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDoubleDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamDoubleDefObj, 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<ICFBamDoubleDefObj, String>, TableCell<ICFBamDoubleDefObj, String>>() {
                @Override
                public TableCell<ICFBamDoubleDefObj, String> call(TableColumn<ICFBamDoubleDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamDoubleDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamDoubleDefObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDoubleDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamDoubleDefObj, 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<ICFBamDoubleDefObj, String>, TableCell<ICFBamDoubleDefObj, String>>() {
                @Override
                public TableCell<ICFBamDoubleDefObj, String> call(TableColumn<ICFBamDoubleDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamDoubleDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamDoubleDefObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDoubleDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamDoubleDefObj, 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<ICFBamDoubleDefObj, String>, TableCell<ICFBamDoubleDefObj, String>>() {
                @Override
                public TableCell<ICFBamDoubleDefObj, String> call(TableColumn<ICFBamDoubleDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamDoubleDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamDoubleDefObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDoubleDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamDoubleDefObj, 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<ICFBamDoubleDefObj, String>, TableCell<ICFBamDoubleDefObj, String>>() {
                @Override
                public TableCell<ICFBamDoubleDefObj, String> call(TableColumn<ICFBamDoubleDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamDoubleDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamDoubleDefObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDoubleDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamDoubleDefObj, 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<ICFBamDoubleDefObj, String>, TableCell<ICFBamDoubleDefObj, String>>() {
                @Override
                public TableCell<ICFBamDoubleDefObj, String> call(TableColumn<ICFBamDoubleDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamDoubleDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnIsNullable = new TableColumn<ICFBamDoubleDefObj, Boolean>("Is Nullable");
    tableColumnIsNullable.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDoubleDefObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamDoubleDefObj, 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<ICFBamDoubleDefObj, Boolean>, TableCell<ICFBamDoubleDefObj, Boolean>>() {
                @Override
                public TableCell<ICFBamDoubleDefObj, Boolean> call(
                        TableColumn<ICFBamDoubleDefObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamDoubleDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsNullable);
    tableColumnGenerateId = new TableColumn<ICFBamDoubleDefObj, Boolean>("Generate Id");
    tableColumnGenerateId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDoubleDefObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamDoubleDefObj, 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<ICFBamDoubleDefObj, Boolean>, TableCell<ICFBamDoubleDefObj, Boolean>>() {
                @Override
                public TableCell<ICFBamDoubleDefObj, Boolean> call(
                        TableColumn<ICFBamDoubleDefObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamDoubleDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnGenerateId);
    tableColumnDefaultVisibility = new TableColumn<ICFBamDoubleDefObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDoubleDefObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamDoubleDefObj, 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<ICFBamDoubleDefObj, Boolean>, TableCell<ICFBamDoubleDefObj, Boolean>>() {
                @Override
                public TableCell<ICFBamDoubleDefObj, Boolean> call(
                        TableColumn<ICFBamDoubleDefObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamDoubleDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnDbName = new TableColumn<ICFBamDoubleDefObj, String>("Db Name");
    tableColumnDbName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDoubleDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamDoubleDefObj, 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<ICFBamDoubleDefObj, String>, TableCell<ICFBamDoubleDefObj, String>>() {
                @Override
                public TableCell<ICFBamDoubleDefObj, String> call(TableColumn<ICFBamDoubleDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamDoubleDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDbName);
    tableColumnInitValue = new TableColumn<ICFBamDoubleDefObj, Double>("Init. Value");
    tableColumnInitValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDoubleDefObj, Double>, ObservableValue<Double>>() {
                public ObservableValue<Double> call(CellDataFeatures<ICFBamDoubleDefObj, Double> p) {
                    ICFBamDoubleDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Double value = obj.getOptionalInitValue();
                        ReadOnlyObjectWrapper<Double> observable = new ReadOnlyObjectWrapper<Double>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnInitValue.setCellFactory(
            new Callback<TableColumn<ICFBamDoubleDefObj, Double>, TableCell<ICFBamDoubleDefObj, Double>>() {
                @Override
                public TableCell<ICFBamDoubleDefObj, Double> call(TableColumn<ICFBamDoubleDefObj, Double> arg) {
                    return new CFDoubleTableCell<ICFBamDoubleDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnInitValue);
    tableColumnDefaultValue = new TableColumn<ICFBamDoubleDefObj, Double>("Default Value");
    tableColumnDefaultValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDoubleDefObj, Double>, ObservableValue<Double>>() {
                public ObservableValue<Double> call(CellDataFeatures<ICFBamDoubleDefObj, Double> p) {
                    ICFBamDoubleDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Double value = obj.getOptionalDefaultValue();
                        ReadOnlyObjectWrapper<Double> observable = new ReadOnlyObjectWrapper<Double>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDefaultValue.setCellFactory(
            new Callback<TableColumn<ICFBamDoubleDefObj, Double>, TableCell<ICFBamDoubleDefObj, Double>>() {
                @Override
                public TableCell<ICFBamDoubleDefObj, Double> call(TableColumn<ICFBamDoubleDefObj, Double> arg) {
                    return new CFDoubleTableCell<ICFBamDoubleDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultValue);
    tableColumnMinValue = new TableColumn<ICFBamDoubleDefObj, Double>("Min. Value");
    tableColumnMinValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDoubleDefObj, Double>, ObservableValue<Double>>() {
                public ObservableValue<Double> call(CellDataFeatures<ICFBamDoubleDefObj, Double> p) {
                    ICFBamDoubleDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Double value = obj.getOptionalMinValue();
                        ReadOnlyObjectWrapper<Double> observable = new ReadOnlyObjectWrapper<Double>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnMinValue.setCellFactory(
            new Callback<TableColumn<ICFBamDoubleDefObj, Double>, TableCell<ICFBamDoubleDefObj, Double>>() {
                @Override
                public TableCell<ICFBamDoubleDefObj, Double> call(TableColumn<ICFBamDoubleDefObj, Double> arg) {
                    return new CFDoubleTableCell<ICFBamDoubleDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnMinValue);
    tableColumnMaxValue = new TableColumn<ICFBamDoubleDefObj, Double>("Max. Value");
    tableColumnMaxValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDoubleDefObj, Double>, ObservableValue<Double>>() {
                public ObservableValue<Double> call(CellDataFeatures<ICFBamDoubleDefObj, Double> p) {
                    ICFBamDoubleDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Double value = obj.getOptionalMaxValue();
                        ReadOnlyObjectWrapper<Double> observable = new ReadOnlyObjectWrapper<Double>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnMaxValue.setCellFactory(
            new Callback<TableColumn<ICFBamDoubleDefObj, Double>, TableCell<ICFBamDoubleDefObj, Double>>() {
                @Override
                public TableCell<ICFBamDoubleDefObj, Double> call(TableColumn<ICFBamDoubleDefObj, Double> arg) {
                    return new CFDoubleTableCell<ICFBamDoubleDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnMaxValue);
    tableColumnNullValue = new TableColumn<ICFBamDoubleDefObj, Double>("Null Value");
    tableColumnNullValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDoubleDefObj, Double>, ObservableValue<Double>>() {
                public ObservableValue<Double> call(CellDataFeatures<ICFBamDoubleDefObj, Double> p) {
                    ICFBamDoubleDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Double value = obj.getOptionalNullValue();
                        ReadOnlyObjectWrapper<Double> observable = new ReadOnlyObjectWrapper<Double>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnNullValue.setCellFactory(
            new Callback<TableColumn<ICFBamDoubleDefObj, Double>, TableCell<ICFBamDoubleDefObj, Double>>() {
                @Override
                public TableCell<ICFBamDoubleDefObj, Double> call(TableColumn<ICFBamDoubleDefObj, Double> arg) {
                    return new CFDoubleTableCell<ICFBamDoubleDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnNullValue);
    tableColumnUnknownValue = new TableColumn<ICFBamDoubleDefObj, Double>("Unknown Value");
    tableColumnUnknownValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDoubleDefObj, Double>, ObservableValue<Double>>() {
                public ObservableValue<Double> call(CellDataFeatures<ICFBamDoubleDefObj, Double> p) {
                    ICFBamDoubleDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Double value = obj.getOptionalUnknownValue();
                        ReadOnlyObjectWrapper<Double> observable = new ReadOnlyObjectWrapper<Double>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnUnknownValue.setCellFactory(
            new Callback<TableColumn<ICFBamDoubleDefObj, Double>, TableCell<ICFBamDoubleDefObj, Double>>() {
                @Override
                public TableCell<ICFBamDoubleDefObj, Double> call(TableColumn<ICFBamDoubleDefObj, Double> arg) {
                    return new CFDoubleTableCell<ICFBamDoubleDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnUnknownValue);
    tableColumnLookupDefSchema = new TableColumn<ICFBamDoubleDefObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamDoubleDefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamDoubleDefObj, ICFBamSchemaDefObj> p) {
                    ICFBamDoubleDefObj 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<ICFBamDoubleDefObj, ICFBamSchemaDefObj>, TableCell<ICFBamDoubleDefObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamDoubleDefObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamDoubleDefObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamDoubleDefObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamDoubleDefObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamDoubleDefObj> observable,
                ICFBamDoubleDefObj oldValue, ICFBamDoubleDefObj 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.choseDoubleDef(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");
                }
                ICFBamDoubleDefObj selectedInstance = getJavaFXFocusAsDoubleDef();
                invokeWhenChosen.choseDoubleDef(selectedInstance);
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonChooseSelected);
    if (argFocus != null) {
        dataTable.getSelectionModel().select(argFocus);
    }
    setTop(hboxMenu);
    setCenter(dataTable);
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXTZTimestampColPickerPane.java

public CFBamJavaFXTZTimestampColPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamTZTimestampColObj argFocus, ICFBamTableObj argContainer,
        Collection<ICFBamTZTimestampColObj> argDataCollection, ICFBamJavaFXTZTimestampColChosen whenChosen) {
    super();/*from www .j  a  v a2  s  .  co  m*/
    final String S_ProcName = "construct-schema-focus";
    if (formManager == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "formManager");
    }
    cfFormManager = formManager;
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2,
                "argSchema");
    }
    if (whenChosen == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6,
                "whenChosen");
    }
    invokeWhenChosen = whenChosen;
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    javafxSchema = argSchema;
    javaFXFocus = argFocus;
    javafxContainer = argContainer;
    setJavaFXDataCollection(argDataCollection);
    dataTable = new TableView<ICFBamTZTimestampColObj>();
    tableColumnId = new TableColumn<ICFBamTZTimestampColObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampColObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamTZTimestampColObj, Long> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        long value = obj.getRequiredId();
                        Long wrapped = new Long(value);
                        ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnId.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimestampColObj, Long>, TableCell<ICFBamTZTimestampColObj, Long>>() {
                @Override
                public TableCell<ICFBamTZTimestampColObj, Long> call(
                        TableColumn<ICFBamTZTimestampColObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamTZTimestampColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamTZTimestampColObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampColObj, String> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getRequiredName();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnName.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimestampColObj, String>, TableCell<ICFBamTZTimestampColObj, String>>() {
                @Override
                public TableCell<ICFBamTZTimestampColObj, String> call(
                        TableColumn<ICFBamTZTimestampColObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZTimestampColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamTZTimestampColObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampColObj, String> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalShortName();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnShortName.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimestampColObj, String>, TableCell<ICFBamTZTimestampColObj, String>>() {
                @Override
                public TableCell<ICFBamTZTimestampColObj, String> call(
                        TableColumn<ICFBamTZTimestampColObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZTimestampColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamTZTimestampColObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampColObj, String> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalLabel();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnLabel.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimestampColObj, String>, TableCell<ICFBamTZTimestampColObj, String>>() {
                @Override
                public TableCell<ICFBamTZTimestampColObj, String> call(
                        TableColumn<ICFBamTZTimestampColObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZTimestampColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamTZTimestampColObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampColObj, String> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalShortDescription();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnShortDescription.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimestampColObj, String>, TableCell<ICFBamTZTimestampColObj, String>>() {
                @Override
                public TableCell<ICFBamTZTimestampColObj, String> call(
                        TableColumn<ICFBamTZTimestampColObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZTimestampColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamTZTimestampColObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampColObj, String> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalDescription();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDescription.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimestampColObj, String>, TableCell<ICFBamTZTimestampColObj, String>>() {
                @Override
                public TableCell<ICFBamTZTimestampColObj, String> call(
                        TableColumn<ICFBamTZTimestampColObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZTimestampColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnIsNullable = new TableColumn<ICFBamTZTimestampColObj, Boolean>("Is Nullable");
    tableColumnIsNullable.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampColObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimestampColObj, Boolean> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        boolean value = obj.getRequiredIsNullable();
                        Boolean wrapped = new Boolean(value);
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnIsNullable.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimestampColObj, Boolean>, TableCell<ICFBamTZTimestampColObj, Boolean>>() {
                @Override
                public TableCell<ICFBamTZTimestampColObj, Boolean> call(
                        TableColumn<ICFBamTZTimestampColObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamTZTimestampColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsNullable);
    tableColumnGenerateId = new TableColumn<ICFBamTZTimestampColObj, Boolean>("Generate Id");
    tableColumnGenerateId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampColObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimestampColObj, Boolean> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Boolean value = obj.getOptionalGenerateId();
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnGenerateId.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimestampColObj, Boolean>, TableCell<ICFBamTZTimestampColObj, Boolean>>() {
                @Override
                public TableCell<ICFBamTZTimestampColObj, Boolean> call(
                        TableColumn<ICFBamTZTimestampColObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamTZTimestampColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnGenerateId);
    tableColumnDefaultVisibility = new TableColumn<ICFBamTZTimestampColObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampColObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimestampColObj, Boolean> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        boolean value = obj.getRequiredDefaultVisibility();
                        Boolean wrapped = new Boolean(value);
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnDefaultVisibility.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimestampColObj, Boolean>, TableCell<ICFBamTZTimestampColObj, Boolean>>() {
                @Override
                public TableCell<ICFBamTZTimestampColObj, Boolean> call(
                        TableColumn<ICFBamTZTimestampColObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamTZTimestampColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnDbName = new TableColumn<ICFBamTZTimestampColObj, String>("Db Name");
    tableColumnDbName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampColObj, String> p) {
                    ICFBamAtomObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalDbName();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDbName.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimestampColObj, String>, TableCell<ICFBamTZTimestampColObj, String>>() {
                @Override
                public TableCell<ICFBamTZTimestampColObj, String> call(
                        TableColumn<ICFBamTZTimestampColObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZTimestampColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDbName);
    tableColumnInitValue = new TableColumn<ICFBamTZTimestampColObj, Calendar>("Init. Value");
    tableColumnInitValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampColObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampColObj, Calendar> p) {
                    ICFBamTZTimestampDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Calendar value = obj.getOptionalInitValue();
                        ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnInitValue.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimestampColObj, Calendar>, TableCell<ICFBamTZTimestampColObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTZTimestampColObj, Calendar> call(
                        TableColumn<ICFBamTZTimestampColObj, Calendar> arg) {
                    return new CFTZTimestampTableCell<ICFBamTZTimestampColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnInitValue);
    tableColumnDefaultValue = new TableColumn<ICFBamTZTimestampColObj, Calendar>("Default Value");
    tableColumnDefaultValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampColObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampColObj, Calendar> p) {
                    ICFBamTZTimestampDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Calendar value = obj.getOptionalDefaultValue();
                        ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDefaultValue.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimestampColObj, Calendar>, TableCell<ICFBamTZTimestampColObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTZTimestampColObj, Calendar> call(
                        TableColumn<ICFBamTZTimestampColObj, Calendar> arg) {
                    return new CFTZTimestampTableCell<ICFBamTZTimestampColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultValue);
    tableColumnMinValue = new TableColumn<ICFBamTZTimestampColObj, Calendar>("Min. Value");
    tableColumnMinValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampColObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampColObj, Calendar> p) {
                    ICFBamTZTimestampDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Calendar value = obj.getOptionalMinValue();
                        ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnMinValue.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimestampColObj, Calendar>, TableCell<ICFBamTZTimestampColObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTZTimestampColObj, Calendar> call(
                        TableColumn<ICFBamTZTimestampColObj, Calendar> arg) {
                    return new CFTZTimestampTableCell<ICFBamTZTimestampColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnMinValue);
    tableColumnMaxValue = new TableColumn<ICFBamTZTimestampColObj, Calendar>("Max. Value");
    tableColumnMaxValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampColObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampColObj, Calendar> p) {
                    ICFBamTZTimestampDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Calendar value = obj.getOptionalMaxValue();
                        ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnMaxValue.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimestampColObj, Calendar>, TableCell<ICFBamTZTimestampColObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTZTimestampColObj, Calendar> call(
                        TableColumn<ICFBamTZTimestampColObj, Calendar> arg) {
                    return new CFTZTimestampTableCell<ICFBamTZTimestampColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnMaxValue);
    tableColumnNullValue = new TableColumn<ICFBamTZTimestampColObj, Calendar>("Null Value");
    tableColumnNullValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampColObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampColObj, Calendar> p) {
                    ICFBamTZTimestampDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Calendar value = obj.getOptionalNullValue();
                        ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnNullValue.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimestampColObj, Calendar>, TableCell<ICFBamTZTimestampColObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTZTimestampColObj, Calendar> call(
                        TableColumn<ICFBamTZTimestampColObj, Calendar> arg) {
                    return new CFTZTimestampTableCell<ICFBamTZTimestampColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnNullValue);
    tableColumnUnknownValue = new TableColumn<ICFBamTZTimestampColObj, Calendar>("Unknown Value");
    tableColumnUnknownValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampColObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampColObj, Calendar> p) {
                    ICFBamTZTimestampDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Calendar value = obj.getOptionalUnknownValue();
                        ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnUnknownValue.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimestampColObj, Calendar>, TableCell<ICFBamTZTimestampColObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTZTimestampColObj, Calendar> call(
                        TableColumn<ICFBamTZTimestampColObj, Calendar> arg) {
                    return new CFTZTimestampTableCell<ICFBamTZTimestampColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnUnknownValue);
    tableColumnLookupDefSchema = new TableColumn<ICFBamTZTimestampColObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamTZTimestampColObj, ICFBamSchemaDefObj> p) {
                    ICFBamTZTimestampColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema();
                        ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupDefSchema.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimestampColObj, ICFBamSchemaDefObj>, TableCell<ICFBamTZTimestampColObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamTZTimestampColObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamTZTimestampColObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamTZTimestampColObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty()
            .addListener(new ChangeListener<ICFBamTZTimestampColObj>() {
                @Override
                public void changed(ObservableValue<? extends ICFBamTZTimestampColObj> observable,
                        ICFBamTZTimestampColObj oldValue, ICFBamTZTimestampColObj newValue) {
                    setJavaFXFocus(newValue);
                    if (buttonChooseSelected != null) {
                        if (newValue != null) {
                            buttonChooseSelected.setDisable(false);
                        } else {
                            buttonChooseSelected.setDisable(true);
                        }
                    }
                }
            });
    hboxMenu = new CFHBox(10);
    buttonCancel = new CFButton();
    buttonCancel.setMinWidth(200);
    buttonCancel.setText("Cancel");
    buttonCancel.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonCancel);
    buttonChooseNone = new CFButton();
    buttonChooseNone.setMinWidth(200);
    buttonChooseNone.setText("ChooseNone");
    buttonChooseNone.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                if (schemaObj == null) {
                    throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                            "schemaObj");
                }
                invokeWhenChosen.choseTZTimestampCol(null);
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonChooseNone);
    buttonChooseSelected = new CFButton();
    buttonChooseSelected.setMinWidth(200);
    buttonChooseSelected.setText("ChooseSelected");
    buttonChooseSelected.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            final String S_ProcName = "handle";
            try {
                ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                if (schemaObj == null) {
                    throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                            "schemaObj");
                }
                ICFBamTZTimestampColObj selectedInstance = getJavaFXFocusAsTZTimestampCol();
                invokeWhenChosen.choseTZTimestampCol(selectedInstance);
                cfFormManager.closeCurrentForm();
            } catch (Throwable t) {
                CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
            }
        }
    });
    hboxMenu.getChildren().add(buttonChooseSelected);
    if (argFocus != null) {
        dataTable.getSelectionModel().select(argFocus);
    }
    setTop(hboxMenu);
    setCenter(dataTable);
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXStringDefPickerPane.java

public CFBamJavaFXStringDefPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamStringDefObj argFocus, ICFBamScopeObj argContainer,
        Collection<ICFBamStringDefObj> argDataCollection, ICFBamJavaFXStringDefChosen whenChosen) {
    super();//from   w  ww. j  a va 2 s . co  m
    final String S_ProcName = "construct-schema-focus";
    if (formManager == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "formManager");
    }
    cfFormManager = formManager;
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2,
                "argSchema");
    }
    if (whenChosen == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6,
                "whenChosen");
    }
    invokeWhenChosen = whenChosen;
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    javafxSchema = argSchema;
    javaFXFocus = argFocus;
    javafxContainer = argContainer;
    setJavaFXDataCollection(argDataCollection);
    dataTable = new TableView<ICFBamStringDefObj>();
    tableColumnObjKind = new TableColumn<ICFBamStringDefObj, String>("Class Code");
    tableColumnObjKind.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamStringDefObj, String>, ObservableValue<String>>() {
                @Override
                public ObservableValue<String> call(CellDataFeatures<ICFBamStringDefObj, String> p) {
                    ICFBamStringDefObj 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<ICFBamStringDefObj, String>, TableCell<ICFBamStringDefObj, String>>() {
                @Override
                public TableCell<ICFBamStringDefObj, String> call(TableColumn<ICFBamStringDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamStringDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnObjKind);
    tableColumnId = new TableColumn<ICFBamStringDefObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamStringDefObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamStringDefObj, 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<ICFBamStringDefObj, Long>, TableCell<ICFBamStringDefObj, Long>>() {
                @Override
                public TableCell<ICFBamStringDefObj, Long> call(TableColumn<ICFBamStringDefObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamStringDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamStringDefObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamStringDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamStringDefObj, 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<ICFBamStringDefObj, String>, TableCell<ICFBamStringDefObj, String>>() {
                @Override
                public TableCell<ICFBamStringDefObj, String> call(TableColumn<ICFBamStringDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamStringDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamStringDefObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamStringDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamStringDefObj, 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<ICFBamStringDefObj, String>, TableCell<ICFBamStringDefObj, String>>() {
                @Override
                public TableCell<ICFBamStringDefObj, String> call(TableColumn<ICFBamStringDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamStringDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamStringDefObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamStringDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamStringDefObj, 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<ICFBamStringDefObj, String>, TableCell<ICFBamStringDefObj, String>>() {
                @Override
                public TableCell<ICFBamStringDefObj, String> call(TableColumn<ICFBamStringDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamStringDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamStringDefObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamStringDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamStringDefObj, 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<ICFBamStringDefObj, String>, TableCell<ICFBamStringDefObj, String>>() {
                @Override
                public TableCell<ICFBamStringDefObj, String> call(TableColumn<ICFBamStringDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamStringDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamStringDefObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamStringDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamStringDefObj, 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<ICFBamStringDefObj, String>, TableCell<ICFBamStringDefObj, String>>() {
                @Override
                public TableCell<ICFBamStringDefObj, String> call(TableColumn<ICFBamStringDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamStringDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnIsNullable = new TableColumn<ICFBamStringDefObj, Boolean>("Is Nullable");
    tableColumnIsNullable.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamStringDefObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamStringDefObj, 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<ICFBamStringDefObj, Boolean>, TableCell<ICFBamStringDefObj, Boolean>>() {
                @Override
                public TableCell<ICFBamStringDefObj, Boolean> call(
                        TableColumn<ICFBamStringDefObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamStringDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsNullable);
    tableColumnGenerateId = new TableColumn<ICFBamStringDefObj, Boolean>("Generate Id");
    tableColumnGenerateId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamStringDefObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamStringDefObj, 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<ICFBamStringDefObj, Boolean>, TableCell<ICFBamStringDefObj, Boolean>>() {
                @Override
                public TableCell<ICFBamStringDefObj, Boolean> call(
                        TableColumn<ICFBamStringDefObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamStringDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnGenerateId);
    tableColumnDefaultVisibility = new TableColumn<ICFBamStringDefObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamStringDefObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamStringDefObj, 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<ICFBamStringDefObj, Boolean>, TableCell<ICFBamStringDefObj, Boolean>>() {
                @Override
                public TableCell<ICFBamStringDefObj, Boolean> call(
                        TableColumn<ICFBamStringDefObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamStringDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnDbName = new TableColumn<ICFBamStringDefObj, String>("Db Name");
    tableColumnDbName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamStringDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamStringDefObj, 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<ICFBamStringDefObj, String>, TableCell<ICFBamStringDefObj, String>>() {
                @Override
                public TableCell<ICFBamStringDefObj, String> call(TableColumn<ICFBamStringDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamStringDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDbName);
    tableColumnMaxLen = new TableColumn<ICFBamStringDefObj, Integer>("Max. Length");
    tableColumnMaxLen.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamStringDefObj, Integer>, ObservableValue<Integer>>() {
                public ObservableValue<Integer> call(CellDataFeatures<ICFBamStringDefObj, Integer> p) {
                    ICFBamStringDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        int value = obj.getRequiredMaxLen();
                        Integer wrapped = new Integer(value);
                        ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnMaxLen.setCellFactory(
            new Callback<TableColumn<ICFBamStringDefObj, Integer>, TableCell<ICFBamStringDefObj, Integer>>() {
                @Override
                public TableCell<ICFBamStringDefObj, Integer> call(
                        TableColumn<ICFBamStringDefObj, Integer> arg) {
                    return new CFInt32TableCell<ICFBamStringDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnMaxLen);
    tableColumnShowLines = new TableColumn<ICFBamStringDefObj, Short>("Show Lines");
    tableColumnShowLines.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamStringDefObj, Short>, ObservableValue<Short>>() {
                public ObservableValue<Short> call(CellDataFeatures<ICFBamStringDefObj, Short> p) {
                    ICFBamStringDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        short value = obj.getRequiredShowLines();
                        Short wrapped = new Short(value);
                        ReadOnlyObjectWrapper<Short> observable = new ReadOnlyObjectWrapper<Short>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnShowLines.setCellFactory(
            new Callback<TableColumn<ICFBamStringDefObj, Short>, TableCell<ICFBamStringDefObj, Short>>() {
                @Override
                public TableCell<ICFBamStringDefObj, Short> call(TableColumn<ICFBamStringDefObj, Short> arg) {
                    return new CFInt16TableCell<ICFBamStringDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShowLines);
    tableColumnInitValue = new TableColumn<ICFBamStringDefObj, String>("Init. Value");
    tableColumnInitValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamStringDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamStringDefObj, String> p) {
                    ICFBamStringDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalInitValue();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnInitValue.setCellFactory(
            new Callback<TableColumn<ICFBamStringDefObj, String>, TableCell<ICFBamStringDefObj, String>>() {
                @Override
                public TableCell<ICFBamStringDefObj, String> call(TableColumn<ICFBamStringDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamStringDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnInitValue);
    tableColumnDefaultValue = new TableColumn<ICFBamStringDefObj, String>("Default Value");
    tableColumnDefaultValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamStringDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamStringDefObj, String> p) {
                    ICFBamStringDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalDefaultValue();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDefaultValue.setCellFactory(
            new Callback<TableColumn<ICFBamStringDefObj, String>, TableCell<ICFBamStringDefObj, String>>() {
                @Override
                public TableCell<ICFBamStringDefObj, String> call(TableColumn<ICFBamStringDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamStringDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultValue);
    tableColumnNullValue = new TableColumn<ICFBamStringDefObj, String>("Null Value");
    tableColumnNullValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamStringDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamStringDefObj, String> p) {
                    ICFBamStringDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalNullValue();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnNullValue.setCellFactory(
            new Callback<TableColumn<ICFBamStringDefObj, String>, TableCell<ICFBamStringDefObj, String>>() {
                @Override
                public TableCell<ICFBamStringDefObj, String> call(TableColumn<ICFBamStringDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamStringDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnNullValue);
    tableColumnUnknownValue = new TableColumn<ICFBamStringDefObj, String>("Unknown Value");
    tableColumnUnknownValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamStringDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamStringDefObj, String> p) {
                    ICFBamStringDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalUnknownValue();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnUnknownValue.setCellFactory(
            new Callback<TableColumn<ICFBamStringDefObj, String>, TableCell<ICFBamStringDefObj, String>>() {
                @Override
                public TableCell<ICFBamStringDefObj, String> call(TableColumn<ICFBamStringDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamStringDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnUnknownValue);
    tableColumnLookupDefSchema = new TableColumn<ICFBamStringDefObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamStringDefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamStringDefObj, ICFBamSchemaDefObj> p) {
                    ICFBamStringDefObj 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<ICFBamStringDefObj, ICFBamSchemaDefObj>, TableCell<ICFBamStringDefObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamStringDefObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamStringDefObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamStringDefObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamStringDefObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamStringDefObj> observable,
                ICFBamStringDefObj oldValue, ICFBamStringDefObj 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.choseStringDef(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");
                }
                ICFBamStringDefObj selectedInstance = getJavaFXFocusAsStringDef();
                invokeWhenChosen.choseStringDef(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.CFBamJavaFXInt32TypePickerPane.java

public CFBamJavaFXInt32TypePickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamInt32TypeObj argFocus, ICFBamSchemaDefObj argContainer,
        Collection<ICFBamInt32TypeObj> argDataCollection, ICFBamJavaFXInt32TypeChosen whenChosen) {
    super();/*from w  w  w.  j a v  a2 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<ICFBamInt32TypeObj>();
    tableColumnObjKind = new TableColumn<ICFBamInt32TypeObj, String>("Class Code");
    tableColumnObjKind.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt32TypeObj, String>, ObservableValue<String>>() {
                @Override
                public ObservableValue<String> call(CellDataFeatures<ICFBamInt32TypeObj, String> p) {
                    ICFBamInt32TypeObj 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<ICFBamInt32TypeObj, String>, TableCell<ICFBamInt32TypeObj, String>>() {
                @Override
                public TableCell<ICFBamInt32TypeObj, String> call(TableColumn<ICFBamInt32TypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamInt32TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnObjKind);
    tableColumnId = new TableColumn<ICFBamInt32TypeObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt32TypeObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamInt32TypeObj, 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<ICFBamInt32TypeObj, Long>, TableCell<ICFBamInt32TypeObj, Long>>() {
                @Override
                public TableCell<ICFBamInt32TypeObj, Long> call(TableColumn<ICFBamInt32TypeObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamInt32TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamInt32TypeObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt32TypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamInt32TypeObj, 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<ICFBamInt32TypeObj, String>, TableCell<ICFBamInt32TypeObj, String>>() {
                @Override
                public TableCell<ICFBamInt32TypeObj, String> call(TableColumn<ICFBamInt32TypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamInt32TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamInt32TypeObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt32TypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamInt32TypeObj, 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<ICFBamInt32TypeObj, String>, TableCell<ICFBamInt32TypeObj, String>>() {
                @Override
                public TableCell<ICFBamInt32TypeObj, String> call(TableColumn<ICFBamInt32TypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamInt32TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamInt32TypeObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt32TypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamInt32TypeObj, 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<ICFBamInt32TypeObj, String>, TableCell<ICFBamInt32TypeObj, String>>() {
                @Override
                public TableCell<ICFBamInt32TypeObj, String> call(TableColumn<ICFBamInt32TypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamInt32TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamInt32TypeObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt32TypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamInt32TypeObj, 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<ICFBamInt32TypeObj, String>, TableCell<ICFBamInt32TypeObj, String>>() {
                @Override
                public TableCell<ICFBamInt32TypeObj, String> call(TableColumn<ICFBamInt32TypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamInt32TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamInt32TypeObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt32TypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamInt32TypeObj, 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<ICFBamInt32TypeObj, String>, TableCell<ICFBamInt32TypeObj, String>>() {
                @Override
                public TableCell<ICFBamInt32TypeObj, String> call(TableColumn<ICFBamInt32TypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamInt32TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnIsNullable = new TableColumn<ICFBamInt32TypeObj, Boolean>("Is Nullable");
    tableColumnIsNullable.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt32TypeObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt32TypeObj, 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<ICFBamInt32TypeObj, Boolean>, TableCell<ICFBamInt32TypeObj, Boolean>>() {
                @Override
                public TableCell<ICFBamInt32TypeObj, Boolean> call(
                        TableColumn<ICFBamInt32TypeObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamInt32TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsNullable);
    tableColumnGenerateId = new TableColumn<ICFBamInt32TypeObj, Boolean>("Generate Id");
    tableColumnGenerateId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt32TypeObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt32TypeObj, 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<ICFBamInt32TypeObj, Boolean>, TableCell<ICFBamInt32TypeObj, Boolean>>() {
                @Override
                public TableCell<ICFBamInt32TypeObj, Boolean> call(
                        TableColumn<ICFBamInt32TypeObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamInt32TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnGenerateId);
    tableColumnDefaultVisibility = new TableColumn<ICFBamInt32TypeObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt32TypeObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamInt32TypeObj, 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<ICFBamInt32TypeObj, Boolean>, TableCell<ICFBamInt32TypeObj, Boolean>>() {
                @Override
                public TableCell<ICFBamInt32TypeObj, Boolean> call(
                        TableColumn<ICFBamInt32TypeObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamInt32TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnDbName = new TableColumn<ICFBamInt32TypeObj, String>("Db Name");
    tableColumnDbName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt32TypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamInt32TypeObj, 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<ICFBamInt32TypeObj, String>, TableCell<ICFBamInt32TypeObj, String>>() {
                @Override
                public TableCell<ICFBamInt32TypeObj, String> call(TableColumn<ICFBamInt32TypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamInt32TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDbName);
    tableColumnInitValue = new TableColumn<ICFBamInt32TypeObj, Integer>("Init. Value");
    tableColumnInitValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt32TypeObj, Integer>, ObservableValue<Integer>>() {
                public ObservableValue<Integer> call(CellDataFeatures<ICFBamInt32TypeObj, Integer> p) {
                    ICFBamInt32DefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Integer value = obj.getOptionalInitValue();
                        ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnInitValue.setCellFactory(
            new Callback<TableColumn<ICFBamInt32TypeObj, Integer>, TableCell<ICFBamInt32TypeObj, Integer>>() {
                @Override
                public TableCell<ICFBamInt32TypeObj, Integer> call(
                        TableColumn<ICFBamInt32TypeObj, Integer> arg) {
                    return new CFInt32TableCell<ICFBamInt32TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnInitValue);
    tableColumnDefaultValue = new TableColumn<ICFBamInt32TypeObj, Integer>("Default Value");
    tableColumnDefaultValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt32TypeObj, Integer>, ObservableValue<Integer>>() {
                public ObservableValue<Integer> call(CellDataFeatures<ICFBamInt32TypeObj, Integer> p) {
                    ICFBamInt32DefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Integer value = obj.getOptionalDefaultValue();
                        ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDefaultValue.setCellFactory(
            new Callback<TableColumn<ICFBamInt32TypeObj, Integer>, TableCell<ICFBamInt32TypeObj, Integer>>() {
                @Override
                public TableCell<ICFBamInt32TypeObj, Integer> call(
                        TableColumn<ICFBamInt32TypeObj, Integer> arg) {
                    return new CFInt32TableCell<ICFBamInt32TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultValue);
    tableColumnMinValue = new TableColumn<ICFBamInt32TypeObj, Integer>("Min. Value");
    tableColumnMinValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt32TypeObj, Integer>, ObservableValue<Integer>>() {
                public ObservableValue<Integer> call(CellDataFeatures<ICFBamInt32TypeObj, Integer> p) {
                    ICFBamInt32DefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Integer value = obj.getOptionalMinValue();
                        ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnMinValue.setCellFactory(
            new Callback<TableColumn<ICFBamInt32TypeObj, Integer>, TableCell<ICFBamInt32TypeObj, Integer>>() {
                @Override
                public TableCell<ICFBamInt32TypeObj, Integer> call(
                        TableColumn<ICFBamInt32TypeObj, Integer> arg) {
                    return new CFInt32TableCell<ICFBamInt32TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnMinValue);
    tableColumnMaxValue = new TableColumn<ICFBamInt32TypeObj, Integer>("Max. Value");
    tableColumnMaxValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt32TypeObj, Integer>, ObservableValue<Integer>>() {
                public ObservableValue<Integer> call(CellDataFeatures<ICFBamInt32TypeObj, Integer> p) {
                    ICFBamInt32DefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Integer value = obj.getOptionalMaxValue();
                        ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnMaxValue.setCellFactory(
            new Callback<TableColumn<ICFBamInt32TypeObj, Integer>, TableCell<ICFBamInt32TypeObj, Integer>>() {
                @Override
                public TableCell<ICFBamInt32TypeObj, Integer> call(
                        TableColumn<ICFBamInt32TypeObj, Integer> arg) {
                    return new CFInt32TableCell<ICFBamInt32TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnMaxValue);
    tableColumnNullValue = new TableColumn<ICFBamInt32TypeObj, Integer>("Null Value");
    tableColumnNullValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt32TypeObj, Integer>, ObservableValue<Integer>>() {
                public ObservableValue<Integer> call(CellDataFeatures<ICFBamInt32TypeObj, Integer> p) {
                    ICFBamInt32DefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Integer value = obj.getOptionalNullValue();
                        ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnNullValue.setCellFactory(
            new Callback<TableColumn<ICFBamInt32TypeObj, Integer>, TableCell<ICFBamInt32TypeObj, Integer>>() {
                @Override
                public TableCell<ICFBamInt32TypeObj, Integer> call(
                        TableColumn<ICFBamInt32TypeObj, Integer> arg) {
                    return new CFInt32TableCell<ICFBamInt32TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnNullValue);
    tableColumnUnknownValue = new TableColumn<ICFBamInt32TypeObj, Integer>("Unknown Value");
    tableColumnUnknownValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt32TypeObj, Integer>, ObservableValue<Integer>>() {
                public ObservableValue<Integer> call(CellDataFeatures<ICFBamInt32TypeObj, Integer> p) {
                    ICFBamInt32DefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Integer value = obj.getOptionalUnknownValue();
                        ReadOnlyObjectWrapper<Integer> observable = new ReadOnlyObjectWrapper<Integer>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnUnknownValue.setCellFactory(
            new Callback<TableColumn<ICFBamInt32TypeObj, Integer>, TableCell<ICFBamInt32TypeObj, Integer>>() {
                @Override
                public TableCell<ICFBamInt32TypeObj, Integer> call(
                        TableColumn<ICFBamInt32TypeObj, Integer> arg) {
                    return new CFInt32TableCell<ICFBamInt32TypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnUnknownValue);
    tableColumnLookupDefSchema = new TableColumn<ICFBamInt32TypeObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamInt32TypeObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamInt32TypeObj, ICFBamSchemaDefObj> p) {
                    ICFBamInt32TypeObj 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<ICFBamInt32TypeObj, ICFBamSchemaDefObj>, TableCell<ICFBamInt32TypeObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamInt32TypeObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamInt32TypeObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamInt32TypeObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamInt32TypeObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamInt32TypeObj> observable,
                ICFBamInt32TypeObj oldValue, ICFBamInt32TypeObj 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.choseInt32Type(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");
                }
                ICFBamInt32TypeObj selectedInstance = getJavaFXFocusAsInt32Type();
                invokeWhenChosen.choseInt32Type(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);
}