Example usage for javafx.event ActionEvent getSource

List of usage examples for javafx.event ActionEvent getSource

Introduction

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

Prototype

public Object getSource() 

Source Link

Document

The object on which the Event initially occurred.

Usage

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();/*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<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();// w w  w. j  a  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<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);
}

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

public CFBamJavaFXTZDateDefPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamTZDateDefObj argFocus, ICFBamScopeObj argContainer,
        Collection<ICFBamTZDateDefObj> argDataCollection, ICFBamJavaFXTZDateDefChosen whenChosen) {
    super();/*from w  w  w  .  j  ava  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<ICFBamTZDateDefObj>();
    tableColumnObjKind = new TableColumn<ICFBamTZDateDefObj, String>("Class Code");
    tableColumnObjKind.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZDateDefObj, String>, ObservableValue<String>>() {
                @Override
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZDateDefObj, String> p) {
                    ICFBamTZDateDefObj 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<ICFBamTZDateDefObj, String>, TableCell<ICFBamTZDateDefObj, String>>() {
                @Override
                public TableCell<ICFBamTZDateDefObj, String> call(TableColumn<ICFBamTZDateDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZDateDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnObjKind);
    tableColumnId = new TableColumn<ICFBamTZDateDefObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZDateDefObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamTZDateDefObj, 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<ICFBamTZDateDefObj, Long>, TableCell<ICFBamTZDateDefObj, Long>>() {
                @Override
                public TableCell<ICFBamTZDateDefObj, Long> call(TableColumn<ICFBamTZDateDefObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamTZDateDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamTZDateDefObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZDateDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZDateDefObj, 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<ICFBamTZDateDefObj, String>, TableCell<ICFBamTZDateDefObj, String>>() {
                @Override
                public TableCell<ICFBamTZDateDefObj, String> call(TableColumn<ICFBamTZDateDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZDateDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamTZDateDefObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZDateDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZDateDefObj, 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<ICFBamTZDateDefObj, String>, TableCell<ICFBamTZDateDefObj, String>>() {
                @Override
                public TableCell<ICFBamTZDateDefObj, String> call(TableColumn<ICFBamTZDateDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZDateDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamTZDateDefObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZDateDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZDateDefObj, 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<ICFBamTZDateDefObj, String>, TableCell<ICFBamTZDateDefObj, String>>() {
                @Override
                public TableCell<ICFBamTZDateDefObj, String> call(TableColumn<ICFBamTZDateDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZDateDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamTZDateDefObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZDateDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZDateDefObj, 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<ICFBamTZDateDefObj, String>, TableCell<ICFBamTZDateDefObj, String>>() {
                @Override
                public TableCell<ICFBamTZDateDefObj, String> call(TableColumn<ICFBamTZDateDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZDateDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamTZDateDefObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZDateDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZDateDefObj, 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<ICFBamTZDateDefObj, String>, TableCell<ICFBamTZDateDefObj, String>>() {
                @Override
                public TableCell<ICFBamTZDateDefObj, String> call(TableColumn<ICFBamTZDateDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZDateDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnIsNullable = new TableColumn<ICFBamTZDateDefObj, Boolean>("Is Nullable");
    tableColumnIsNullable.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZDateDefObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZDateDefObj, 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<ICFBamTZDateDefObj, Boolean>, TableCell<ICFBamTZDateDefObj, Boolean>>() {
                @Override
                public TableCell<ICFBamTZDateDefObj, Boolean> call(
                        TableColumn<ICFBamTZDateDefObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamTZDateDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsNullable);
    tableColumnGenerateId = new TableColumn<ICFBamTZDateDefObj, Boolean>("Generate Id");
    tableColumnGenerateId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZDateDefObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZDateDefObj, 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<ICFBamTZDateDefObj, Boolean>, TableCell<ICFBamTZDateDefObj, Boolean>>() {
                @Override
                public TableCell<ICFBamTZDateDefObj, Boolean> call(
                        TableColumn<ICFBamTZDateDefObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamTZDateDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnGenerateId);
    tableColumnDefaultVisibility = new TableColumn<ICFBamTZDateDefObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZDateDefObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZDateDefObj, 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<ICFBamTZDateDefObj, Boolean>, TableCell<ICFBamTZDateDefObj, Boolean>>() {
                @Override
                public TableCell<ICFBamTZDateDefObj, Boolean> call(
                        TableColumn<ICFBamTZDateDefObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamTZDateDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnDbName = new TableColumn<ICFBamTZDateDefObj, String>("Db Name");
    tableColumnDbName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZDateDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZDateDefObj, 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<ICFBamTZDateDefObj, String>, TableCell<ICFBamTZDateDefObj, String>>() {
                @Override
                public TableCell<ICFBamTZDateDefObj, String> call(TableColumn<ICFBamTZDateDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZDateDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDbName);
    tableColumnInitValue = new TableColumn<ICFBamTZDateDefObj, Calendar>("Init. Value");
    tableColumnInitValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZDateDefObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZDateDefObj, Calendar> p) {
                    ICFBamTZDateDefObj 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<ICFBamTZDateDefObj, Calendar>, TableCell<ICFBamTZDateDefObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTZDateDefObj, Calendar> call(
                        TableColumn<ICFBamTZDateDefObj, Calendar> arg) {
                    return new CFTZDateTableCell<ICFBamTZDateDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnInitValue);
    tableColumnDefaultValue = new TableColumn<ICFBamTZDateDefObj, Calendar>("Default Value");
    tableColumnDefaultValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZDateDefObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZDateDefObj, Calendar> p) {
                    ICFBamTZDateDefObj 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<ICFBamTZDateDefObj, Calendar>, TableCell<ICFBamTZDateDefObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTZDateDefObj, Calendar> call(
                        TableColumn<ICFBamTZDateDefObj, Calendar> arg) {
                    return new CFTZDateTableCell<ICFBamTZDateDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultValue);
    tableColumnMinValue = new TableColumn<ICFBamTZDateDefObj, Calendar>("Min. Value");
    tableColumnMinValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZDateDefObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZDateDefObj, Calendar> p) {
                    ICFBamTZDateDefObj 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<ICFBamTZDateDefObj, Calendar>, TableCell<ICFBamTZDateDefObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTZDateDefObj, Calendar> call(
                        TableColumn<ICFBamTZDateDefObj, Calendar> arg) {
                    return new CFTZDateTableCell<ICFBamTZDateDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnMinValue);
    tableColumnMaxValue = new TableColumn<ICFBamTZDateDefObj, Calendar>("Max. Value");
    tableColumnMaxValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZDateDefObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZDateDefObj, Calendar> p) {
                    ICFBamTZDateDefObj 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<ICFBamTZDateDefObj, Calendar>, TableCell<ICFBamTZDateDefObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTZDateDefObj, Calendar> call(
                        TableColumn<ICFBamTZDateDefObj, Calendar> arg) {
                    return new CFTZDateTableCell<ICFBamTZDateDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnMaxValue);
    tableColumnNullValue = new TableColumn<ICFBamTZDateDefObj, Calendar>("Null Value");
    tableColumnNullValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZDateDefObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZDateDefObj, Calendar> p) {
                    ICFBamTZDateDefObj 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<ICFBamTZDateDefObj, Calendar>, TableCell<ICFBamTZDateDefObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTZDateDefObj, Calendar> call(
                        TableColumn<ICFBamTZDateDefObj, Calendar> arg) {
                    return new CFTZDateTableCell<ICFBamTZDateDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnNullValue);
    tableColumnUnknownValue = new TableColumn<ICFBamTZDateDefObj, Calendar>("Unknown Value");
    tableColumnUnknownValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZDateDefObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZDateDefObj, Calendar> p) {
                    ICFBamTZDateDefObj 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<ICFBamTZDateDefObj, Calendar>, TableCell<ICFBamTZDateDefObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTZDateDefObj, Calendar> call(
                        TableColumn<ICFBamTZDateDefObj, Calendar> arg) {
                    return new CFTZDateTableCell<ICFBamTZDateDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnUnknownValue);
    tableColumnLookupDefSchema = new TableColumn<ICFBamTZDateDefObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZDateDefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamTZDateDefObj, ICFBamSchemaDefObj> p) {
                    ICFBamTZDateDefObj 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<ICFBamTZDateDefObj, ICFBamSchemaDefObj>, TableCell<ICFBamTZDateDefObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamTZDateDefObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamTZDateDefObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamTZDateDefObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamTZDateDefObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamTZDateDefObj> observable,
                ICFBamTZDateDefObj oldValue, ICFBamTZDateDefObj 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.choseTZDateDef(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");
                }
                ICFBamTZDateDefObj selectedInstance = getJavaFXFocusAsTZDateDef();
                invokeWhenChosen.choseTZDateDef(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.CFBamJavaFXUInt16DefPickerPane.java

public CFBamJavaFXUInt16DefPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamUInt16DefObj argFocus, ICFBamScopeObj argContainer,
        Collection<ICFBamUInt16DefObj> argDataCollection, ICFBamJavaFXUInt16DefChosen whenChosen) {
    super();/*from ww  w.j a v a  2  s. co  m*/
    final String S_ProcName = "construct-schema-focus";
    if (formManager == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "formManager");
    }
    cfFormManager = formManager;
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2,
                "argSchema");
    }
    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<ICFBamUInt16DefObj>();
    tableColumnObjKind = new TableColumn<ICFBamUInt16DefObj, String>("Class Code");
    tableColumnObjKind.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt16DefObj, String>, ObservableValue<String>>() {
                @Override
                public ObservableValue<String> call(CellDataFeatures<ICFBamUInt16DefObj, String> p) {
                    ICFBamUInt16DefObj 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<ICFBamUInt16DefObj, String>, TableCell<ICFBamUInt16DefObj, String>>() {
                @Override
                public TableCell<ICFBamUInt16DefObj, String> call(TableColumn<ICFBamUInt16DefObj, String> arg) {
                    return new CFStringTableCell<ICFBamUInt16DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnObjKind);
    tableColumnId = new TableColumn<ICFBamUInt16DefObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt16DefObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamUInt16DefObj, 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<ICFBamUInt16DefObj, Long>, TableCell<ICFBamUInt16DefObj, Long>>() {
                @Override
                public TableCell<ICFBamUInt16DefObj, Long> call(TableColumn<ICFBamUInt16DefObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamUInt16DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamUInt16DefObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt16DefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamUInt16DefObj, 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<ICFBamUInt16DefObj, String>, TableCell<ICFBamUInt16DefObj, String>>() {
                @Override
                public TableCell<ICFBamUInt16DefObj, String> call(TableColumn<ICFBamUInt16DefObj, String> arg) {
                    return new CFStringTableCell<ICFBamUInt16DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamUInt16DefObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt16DefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamUInt16DefObj, 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<ICFBamUInt16DefObj, String>, TableCell<ICFBamUInt16DefObj, String>>() {
                @Override
                public TableCell<ICFBamUInt16DefObj, String> call(TableColumn<ICFBamUInt16DefObj, String> arg) {
                    return new CFStringTableCell<ICFBamUInt16DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamUInt16DefObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt16DefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamUInt16DefObj, 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<ICFBamUInt16DefObj, String>, TableCell<ICFBamUInt16DefObj, String>>() {
                @Override
                public TableCell<ICFBamUInt16DefObj, String> call(TableColumn<ICFBamUInt16DefObj, String> arg) {
                    return new CFStringTableCell<ICFBamUInt16DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamUInt16DefObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt16DefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamUInt16DefObj, 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<ICFBamUInt16DefObj, String>, TableCell<ICFBamUInt16DefObj, String>>() {
                @Override
                public TableCell<ICFBamUInt16DefObj, String> call(TableColumn<ICFBamUInt16DefObj, String> arg) {
                    return new CFStringTableCell<ICFBamUInt16DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamUInt16DefObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt16DefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamUInt16DefObj, 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<ICFBamUInt16DefObj, String>, TableCell<ICFBamUInt16DefObj, String>>() {
                @Override
                public TableCell<ICFBamUInt16DefObj, String> call(TableColumn<ICFBamUInt16DefObj, String> arg) {
                    return new CFStringTableCell<ICFBamUInt16DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnIsNullable = new TableColumn<ICFBamUInt16DefObj, Boolean>("Is Nullable");
    tableColumnIsNullable.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt16DefObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUInt16DefObj, 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<ICFBamUInt16DefObj, Boolean>, TableCell<ICFBamUInt16DefObj, Boolean>>() {
                @Override
                public TableCell<ICFBamUInt16DefObj, Boolean> call(
                        TableColumn<ICFBamUInt16DefObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamUInt16DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsNullable);
    tableColumnGenerateId = new TableColumn<ICFBamUInt16DefObj, Boolean>("Generate Id");
    tableColumnGenerateId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt16DefObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUInt16DefObj, 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<ICFBamUInt16DefObj, Boolean>, TableCell<ICFBamUInt16DefObj, Boolean>>() {
                @Override
                public TableCell<ICFBamUInt16DefObj, Boolean> call(
                        TableColumn<ICFBamUInt16DefObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamUInt16DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnGenerateId);
    tableColumnDefaultVisibility = new TableColumn<ICFBamUInt16DefObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt16DefObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUInt16DefObj, 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<ICFBamUInt16DefObj, Boolean>, TableCell<ICFBamUInt16DefObj, Boolean>>() {
                @Override
                public TableCell<ICFBamUInt16DefObj, Boolean> call(
                        TableColumn<ICFBamUInt16DefObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamUInt16DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnDbName = new TableColumn<ICFBamUInt16DefObj, String>("Db Name");
    tableColumnDbName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt16DefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamUInt16DefObj, 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<ICFBamUInt16DefObj, String>, TableCell<ICFBamUInt16DefObj, String>>() {
                @Override
                public TableCell<ICFBamUInt16DefObj, String> call(TableColumn<ICFBamUInt16DefObj, String> arg) {
                    return new CFStringTableCell<ICFBamUInt16DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDbName);
    tableColumnInitValue = new TableColumn<ICFBamUInt16DefObj, Integer>("Init. Value");
    tableColumnInitValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt16DefObj, Integer>, ObservableValue<Integer>>() {
                public ObservableValue<Integer> call(CellDataFeatures<ICFBamUInt16DefObj, Integer> p) {
                    ICFBamUInt16DefObj 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<ICFBamUInt16DefObj, Integer>, TableCell<ICFBamUInt16DefObj, Integer>>() {
                @Override
                public TableCell<ICFBamUInt16DefObj, Integer> call(
                        TableColumn<ICFBamUInt16DefObj, Integer> arg) {
                    return new CFUInt16TableCell<ICFBamUInt16DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnInitValue);
    tableColumnDefaultValue = new TableColumn<ICFBamUInt16DefObj, Integer>("Default Value");
    tableColumnDefaultValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt16DefObj, Integer>, ObservableValue<Integer>>() {
                public ObservableValue<Integer> call(CellDataFeatures<ICFBamUInt16DefObj, Integer> p) {
                    ICFBamUInt16DefObj 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<ICFBamUInt16DefObj, Integer>, TableCell<ICFBamUInt16DefObj, Integer>>() {
                @Override
                public TableCell<ICFBamUInt16DefObj, Integer> call(
                        TableColumn<ICFBamUInt16DefObj, Integer> arg) {
                    return new CFUInt16TableCell<ICFBamUInt16DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultValue);
    tableColumnMinValue = new TableColumn<ICFBamUInt16DefObj, Integer>("Min. Value");
    tableColumnMinValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt16DefObj, Integer>, ObservableValue<Integer>>() {
                public ObservableValue<Integer> call(CellDataFeatures<ICFBamUInt16DefObj, Integer> p) {
                    ICFBamUInt16DefObj 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<ICFBamUInt16DefObj, Integer>, TableCell<ICFBamUInt16DefObj, Integer>>() {
                @Override
                public TableCell<ICFBamUInt16DefObj, Integer> call(
                        TableColumn<ICFBamUInt16DefObj, Integer> arg) {
                    return new CFUInt16TableCell<ICFBamUInt16DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnMinValue);
    tableColumnMaxValue = new TableColumn<ICFBamUInt16DefObj, Integer>("Max. Value");
    tableColumnMaxValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt16DefObj, Integer>, ObservableValue<Integer>>() {
                public ObservableValue<Integer> call(CellDataFeatures<ICFBamUInt16DefObj, Integer> p) {
                    ICFBamUInt16DefObj 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<ICFBamUInt16DefObj, Integer>, TableCell<ICFBamUInt16DefObj, Integer>>() {
                @Override
                public TableCell<ICFBamUInt16DefObj, Integer> call(
                        TableColumn<ICFBamUInt16DefObj, Integer> arg) {
                    return new CFUInt16TableCell<ICFBamUInt16DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnMaxValue);
    tableColumnNullValue = new TableColumn<ICFBamUInt16DefObj, Integer>("Null Value");
    tableColumnNullValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt16DefObj, Integer>, ObservableValue<Integer>>() {
                public ObservableValue<Integer> call(CellDataFeatures<ICFBamUInt16DefObj, Integer> p) {
                    ICFBamUInt16DefObj 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<ICFBamUInt16DefObj, Integer>, TableCell<ICFBamUInt16DefObj, Integer>>() {
                @Override
                public TableCell<ICFBamUInt16DefObj, Integer> call(
                        TableColumn<ICFBamUInt16DefObj, Integer> arg) {
                    return new CFUInt16TableCell<ICFBamUInt16DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnNullValue);
    tableColumnUnknownValue = new TableColumn<ICFBamUInt16DefObj, Integer>("Unknown Value");
    tableColumnUnknownValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt16DefObj, Integer>, ObservableValue<Integer>>() {
                public ObservableValue<Integer> call(CellDataFeatures<ICFBamUInt16DefObj, Integer> p) {
                    ICFBamUInt16DefObj 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<ICFBamUInt16DefObj, Integer>, TableCell<ICFBamUInt16DefObj, Integer>>() {
                @Override
                public TableCell<ICFBamUInt16DefObj, Integer> call(
                        TableColumn<ICFBamUInt16DefObj, Integer> arg) {
                    return new CFUInt16TableCell<ICFBamUInt16DefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnUnknownValue);
    tableColumnLookupDefSchema = new TableColumn<ICFBamUInt16DefObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUInt16DefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamUInt16DefObj, ICFBamSchemaDefObj> p) {
                    ICFBamUInt16DefObj 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<ICFBamUInt16DefObj, ICFBamSchemaDefObj>, TableCell<ICFBamUInt16DefObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamUInt16DefObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamUInt16DefObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamUInt16DefObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamUInt16DefObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamUInt16DefObj> observable,
                ICFBamUInt16DefObj oldValue, ICFBamUInt16DefObj 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.choseUInt16Def(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");
                }
                ICFBamUInt16DefObj selectedInstance = getJavaFXFocusAsUInt16Def();
                invokeWhenChosen.choseUInt16Def(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.CFBamJavaFXUInt64DefPickerPane.java

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

public CFBamJavaFXRelationPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamRelationObj argFocus, ICFBamTableObj argContainer,
        Collection<ICFBamRelationObj> argDataCollection, ICFBamJavaFXRelationChosen whenChosen) {
    super();//ww w  .  j  a v  a2  s  .  co  m
    final String S_ProcName = "construct-schema-focus";
    if (formManager == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "formManager");
    }
    cfFormManager = formManager;
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2,
                "argSchema");
    }
    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<ICFBamRelationObj>();
    tableColumnId = new TableColumn<ICFBamRelationObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamRelationObj, Long> p) {
                    ICFBamScopeObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        long value = obj.getRequiredId();
                        Long wrapped = new Long(value);
                        ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnId.setCellFactory(
            new Callback<TableColumn<ICFBamRelationObj, Long>, TableCell<ICFBamRelationObj, Long>>() {
                @Override
                public TableCell<ICFBamRelationObj, Long> call(TableColumn<ICFBamRelationObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamRelationObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamRelationObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamRelationObj, String> p) {
                    ICFBamRelationObj 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<ICFBamRelationObj, String>, TableCell<ICFBamRelationObj, String>>() {
                @Override
                public TableCell<ICFBamRelationObj, String> call(TableColumn<ICFBamRelationObj, String> arg) {
                    return new CFStringTableCell<ICFBamRelationObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamRelationObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamRelationObj, String> p) {
                    ICFBamRelationObj 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<ICFBamRelationObj, String>, TableCell<ICFBamRelationObj, String>>() {
                @Override
                public TableCell<ICFBamRelationObj, String> call(TableColumn<ICFBamRelationObj, String> arg) {
                    return new CFStringTableCell<ICFBamRelationObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamRelationObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamRelationObj, String> p) {
                    ICFBamRelationObj 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<ICFBamRelationObj, String>, TableCell<ICFBamRelationObj, String>>() {
                @Override
                public TableCell<ICFBamRelationObj, String> call(TableColumn<ICFBamRelationObj, String> arg) {
                    return new CFStringTableCell<ICFBamRelationObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamRelationObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamRelationObj, String> p) {
                    ICFBamRelationObj 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<ICFBamRelationObj, String>, TableCell<ICFBamRelationObj, String>>() {
                @Override
                public TableCell<ICFBamRelationObj, String> call(TableColumn<ICFBamRelationObj, String> arg) {
                    return new CFStringTableCell<ICFBamRelationObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamRelationObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamRelationObj, String> p) {
                    ICFBamRelationObj 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<ICFBamRelationObj, String>, TableCell<ICFBamRelationObj, String>>() {
                @Override
                public TableCell<ICFBamRelationObj, String> call(TableColumn<ICFBamRelationObj, String> arg) {
                    return new CFStringTableCell<ICFBamRelationObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnRelationType = new TableColumn<ICFBamRelationObj, ICFBamSchema.RelationTypeEnum>("RelationType");
    tableColumnRelationType.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationObj, ICFBamSchema.RelationTypeEnum>, ObservableValue<ICFBamSchema.RelationTypeEnum>>() {
                public ObservableValue<ICFBamSchema.RelationTypeEnum> call(
                        CellDataFeatures<ICFBamRelationObj, ICFBamSchema.RelationTypeEnum> p) {
                    ICFBamRelationObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamSchema.RelationTypeEnum value = obj.getRequiredRelationType();
                        ReadOnlyObjectWrapper<ICFBamSchema.RelationTypeEnum> observable = new ReadOnlyObjectWrapper<ICFBamSchema.RelationTypeEnum>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnRelationType.setCellFactory(
            new Callback<TableColumn<ICFBamRelationObj, ICFBamSchema.RelationTypeEnum>, TableCell<ICFBamRelationObj, ICFBamSchema.RelationTypeEnum>>() {
                @Override
                public TableCell<ICFBamRelationObj, ICFBamSchema.RelationTypeEnum> call(
                        TableColumn<ICFBamRelationObj, ICFBamSchema.RelationTypeEnum> arg) {
                    return new CFEnumTableCell<ICFBamRelationObj, ICFBamSchema.RelationTypeEnum>();
                }
            });
    dataTable.getColumns().add(tableColumnRelationType);
    tableColumnDbName = new TableColumn<ICFBamRelationObj, String>("Db Name");
    tableColumnDbName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamRelationObj, String> p) {
                    ICFBamRelationObj 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<ICFBamRelationObj, String>, TableCell<ICFBamRelationObj, String>>() {
                @Override
                public TableCell<ICFBamRelationObj, String> call(TableColumn<ICFBamRelationObj, String> arg) {
                    return new CFStringTableCell<ICFBamRelationObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDbName);
    tableColumnSuffix = new TableColumn<ICFBamRelationObj, String>("Suffix");
    tableColumnSuffix.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamRelationObj, String> p) {
                    ICFBamRelationObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalSuffix();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnSuffix.setCellFactory(
            new Callback<TableColumn<ICFBamRelationObj, String>, TableCell<ICFBamRelationObj, String>>() {
                @Override
                public TableCell<ICFBamRelationObj, String> call(TableColumn<ICFBamRelationObj, String> arg) {
                    return new CFStringTableCell<ICFBamRelationObj>();
                }
            });
    dataTable.getColumns().add(tableColumnSuffix);
    tableColumnIsRequired = new TableColumn<ICFBamRelationObj, Boolean>("Is Required");
    tableColumnIsRequired.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamRelationObj, Boolean> p) {
                    ICFBamRelationObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        boolean value = obj.getRequiredIsRequired();
                        Boolean wrapped = new Boolean(value);
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnIsRequired.setCellFactory(
            new Callback<TableColumn<ICFBamRelationObj, Boolean>, TableCell<ICFBamRelationObj, Boolean>>() {
                @Override
                public TableCell<ICFBamRelationObj, Boolean> call(TableColumn<ICFBamRelationObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamRelationObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsRequired);
    tableColumnIsAbstract = new TableColumn<ICFBamRelationObj, Boolean>("Is Abstract");
    tableColumnIsAbstract.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamRelationObj, Boolean> p) {
                    ICFBamRelationObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        boolean value = obj.getRequiredIsAbstract();
                        Boolean wrapped = new Boolean(value);
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnIsAbstract.setCellFactory(
            new Callback<TableColumn<ICFBamRelationObj, Boolean>, TableCell<ICFBamRelationObj, Boolean>>() {
                @Override
                public TableCell<ICFBamRelationObj, Boolean> call(TableColumn<ICFBamRelationObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamRelationObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsAbstract);
    tableColumnIsXsdContainer = new TableColumn<ICFBamRelationObj, Boolean>("Is XSD Container");
    tableColumnIsXsdContainer.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamRelationObj, Boolean> p) {
                    ICFBamRelationObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        boolean value = obj.getRequiredIsXsdContainer();
                        Boolean wrapped = new Boolean(value);
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnIsXsdContainer.setCellFactory(
            new Callback<TableColumn<ICFBamRelationObj, Boolean>, TableCell<ICFBamRelationObj, Boolean>>() {
                @Override
                public TableCell<ICFBamRelationObj, Boolean> call(TableColumn<ICFBamRelationObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamRelationObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsXsdContainer);
    tableColumnDefaultVisibility = new TableColumn<ICFBamRelationObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamRelationObj, Boolean> p) {
                    ICFBamRelationObj 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<ICFBamRelationObj, Boolean>, TableCell<ICFBamRelationObj, Boolean>>() {
                @Override
                public TableCell<ICFBamRelationObj, Boolean> call(TableColumn<ICFBamRelationObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamRelationObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnLookupDefSchema = new TableColumn<ICFBamRelationObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamRelationObj, ICFBamSchemaDefObj> p) {
                    ICFBamRelationObj 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<ICFBamRelationObj, ICFBamSchemaDefObj>, TableCell<ICFBamRelationObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamRelationObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamRelationObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamRelationObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    tableColumnLookupFromIndex = new TableColumn<ICFBamRelationObj, ICFBamIndexObj>("From Index");
    tableColumnLookupFromIndex.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationObj, ICFBamIndexObj>, ObservableValue<ICFBamIndexObj>>() {
                public ObservableValue<ICFBamIndexObj> call(
                        CellDataFeatures<ICFBamRelationObj, ICFBamIndexObj> p) {
                    ICFBamRelationObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamIndexObj ref = obj.getRequiredLookupFromIndex();
                        ReadOnlyObjectWrapper<ICFBamIndexObj> observable = new ReadOnlyObjectWrapper<ICFBamIndexObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupFromIndex.setCellFactory(
            new Callback<TableColumn<ICFBamRelationObj, ICFBamIndexObj>, TableCell<ICFBamRelationObj, ICFBamIndexObj>>() {
                @Override
                public TableCell<ICFBamRelationObj, ICFBamIndexObj> call(
                        TableColumn<ICFBamRelationObj, ICFBamIndexObj> arg) {
                    return new CFReferenceTableCell<ICFBamRelationObj, ICFBamIndexObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupFromIndex);
    tableColumnLookupToTable = new TableColumn<ICFBamRelationObj, ICFBamTableObj>("To Table");
    tableColumnLookupToTable.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationObj, ICFBamTableObj>, ObservableValue<ICFBamTableObj>>() {
                public ObservableValue<ICFBamTableObj> call(
                        CellDataFeatures<ICFBamRelationObj, ICFBamTableObj> p) {
                    ICFBamRelationObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamTableObj ref = obj.getRequiredLookupToTable();
                        ReadOnlyObjectWrapper<ICFBamTableObj> observable = new ReadOnlyObjectWrapper<ICFBamTableObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupToTable.setCellFactory(
            new Callback<TableColumn<ICFBamRelationObj, ICFBamTableObj>, TableCell<ICFBamRelationObj, ICFBamTableObj>>() {
                @Override
                public TableCell<ICFBamRelationObj, ICFBamTableObj> call(
                        TableColumn<ICFBamRelationObj, ICFBamTableObj> arg) {
                    return new CFReferenceTableCell<ICFBamRelationObj, ICFBamTableObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupToTable);
    tableColumnLookupToIndex = new TableColumn<ICFBamRelationObj, ICFBamIndexObj>("To Index");
    tableColumnLookupToIndex.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationObj, ICFBamIndexObj>, ObservableValue<ICFBamIndexObj>>() {
                public ObservableValue<ICFBamIndexObj> call(
                        CellDataFeatures<ICFBamRelationObj, ICFBamIndexObj> p) {
                    ICFBamRelationObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamIndexObj ref = obj.getRequiredLookupToIndex();
                        ReadOnlyObjectWrapper<ICFBamIndexObj> observable = new ReadOnlyObjectWrapper<ICFBamIndexObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupToIndex.setCellFactory(
            new Callback<TableColumn<ICFBamRelationObj, ICFBamIndexObj>, TableCell<ICFBamRelationObj, ICFBamIndexObj>>() {
                @Override
                public TableCell<ICFBamRelationObj, ICFBamIndexObj> call(
                        TableColumn<ICFBamRelationObj, ICFBamIndexObj> arg) {
                    return new CFReferenceTableCell<ICFBamRelationObj, ICFBamIndexObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupToIndex);
    tableColumnLookupNarrowed = new TableColumn<ICFBamRelationObj, ICFBamRelationObj>("Narrowed Relation");
    tableColumnLookupNarrowed.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamRelationObj, ICFBamRelationObj>, ObservableValue<ICFBamRelationObj>>() {
                public ObservableValue<ICFBamRelationObj> call(
                        CellDataFeatures<ICFBamRelationObj, ICFBamRelationObj> p) {
                    ICFBamRelationObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamRelationObj ref = obj.getOptionalLookupNarrowed();
                        ReadOnlyObjectWrapper<ICFBamRelationObj> observable = new ReadOnlyObjectWrapper<ICFBamRelationObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupNarrowed.setCellFactory(
            new Callback<TableColumn<ICFBamRelationObj, ICFBamRelationObj>, TableCell<ICFBamRelationObj, ICFBamRelationObj>>() {
                @Override
                public TableCell<ICFBamRelationObj, ICFBamRelationObj> call(
                        TableColumn<ICFBamRelationObj, ICFBamRelationObj> arg) {
                    return new CFReferenceTableCell<ICFBamRelationObj, ICFBamRelationObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupNarrowed);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamRelationObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamRelationObj> observable, ICFBamRelationObj oldValue,
                ICFBamRelationObj 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.choseRelation(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");
                }
                ICFBamRelationObj selectedInstance = getJavaFXFocusAsRelation();
                invokeWhenChosen.choseRelation(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.CFBamJavaFXNmTokenDefPickerPane.java

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

public CFBamJavaFXTimestampDefPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamTimestampDefObj argFocus, ICFBamScopeObj argContainer,
        Collection<ICFBamTimestampDefObj> argDataCollection, ICFBamJavaFXTimestampDefChosen whenChosen) {
    super();/* w w w .  j  av a2s.  c  o m*/
    final String S_ProcName = "construct-schema-focus";
    if (formManager == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "formManager");
    }
    cfFormManager = formManager;
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2,
                "argSchema");
    }
    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<ICFBamTimestampDefObj>();
    tableColumnObjKind = new TableColumn<ICFBamTimestampDefObj, String>("Class Code");
    tableColumnObjKind.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampDefObj, String>, ObservableValue<String>>() {
                @Override
                public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampDefObj, String> p) {
                    ICFBamTimestampDefObj 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<ICFBamTimestampDefObj, String>, TableCell<ICFBamTimestampDefObj, String>>() {
                @Override
                public TableCell<ICFBamTimestampDefObj, String> call(
                        TableColumn<ICFBamTimestampDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnObjKind);
    tableColumnId = new TableColumn<ICFBamTimestampDefObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampDefObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, Long>, TableCell<ICFBamTimestampDefObj, Long>>() {
                @Override
                public TableCell<ICFBamTimestampDefObj, Long> call(
                        TableColumn<ICFBamTimestampDefObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamTimestampDefObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, String>, TableCell<ICFBamTimestampDefObj, String>>() {
                @Override
                public TableCell<ICFBamTimestampDefObj, String> call(
                        TableColumn<ICFBamTimestampDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamTimestampDefObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, String>, TableCell<ICFBamTimestampDefObj, String>>() {
                @Override
                public TableCell<ICFBamTimestampDefObj, String> call(
                        TableColumn<ICFBamTimestampDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamTimestampDefObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, String>, TableCell<ICFBamTimestampDefObj, String>>() {
                @Override
                public TableCell<ICFBamTimestampDefObj, String> call(
                        TableColumn<ICFBamTimestampDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamTimestampDefObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, String>, TableCell<ICFBamTimestampDefObj, String>>() {
                @Override
                public TableCell<ICFBamTimestampDefObj, String> call(
                        TableColumn<ICFBamTimestampDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamTimestampDefObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, String>, TableCell<ICFBamTimestampDefObj, String>>() {
                @Override
                public TableCell<ICFBamTimestampDefObj, String> call(
                        TableColumn<ICFBamTimestampDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnIsNullable = new TableColumn<ICFBamTimestampDefObj, Boolean>("Is Nullable");
    tableColumnIsNullable.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampDefObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, Boolean>, TableCell<ICFBamTimestampDefObj, Boolean>>() {
                @Override
                public TableCell<ICFBamTimestampDefObj, Boolean> call(
                        TableColumn<ICFBamTimestampDefObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsNullable);
    tableColumnGenerateId = new TableColumn<ICFBamTimestampDefObj, Boolean>("Generate Id");
    tableColumnGenerateId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampDefObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, Boolean>, TableCell<ICFBamTimestampDefObj, Boolean>>() {
                @Override
                public TableCell<ICFBamTimestampDefObj, Boolean> call(
                        TableColumn<ICFBamTimestampDefObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnGenerateId);
    tableColumnDefaultVisibility = new TableColumn<ICFBamTimestampDefObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampDefObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, Boolean>, TableCell<ICFBamTimestampDefObj, Boolean>>() {
                @Override
                public TableCell<ICFBamTimestampDefObj, Boolean> call(
                        TableColumn<ICFBamTimestampDefObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnDbName = new TableColumn<ICFBamTimestampDefObj, String>("Db Name");
    tableColumnDbName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, String>, TableCell<ICFBamTimestampDefObj, String>>() {
                @Override
                public TableCell<ICFBamTimestampDefObj, String> call(
                        TableColumn<ICFBamTimestampDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDbName);
    tableColumnInitValue = new TableColumn<ICFBamTimestampDefObj, Calendar>("Init. Value");
    tableColumnInitValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampDefObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, Calendar>, TableCell<ICFBamTimestampDefObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTimestampDefObj, Calendar> call(
                        TableColumn<ICFBamTimestampDefObj, Calendar> arg) {
                    return new CFTimestampTableCell<ICFBamTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnInitValue);
    tableColumnDefaultValue = new TableColumn<ICFBamTimestampDefObj, Calendar>("Default Value");
    tableColumnDefaultValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampDefObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, Calendar>, TableCell<ICFBamTimestampDefObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTimestampDefObj, Calendar> call(
                        TableColumn<ICFBamTimestampDefObj, Calendar> arg) {
                    return new CFTimestampTableCell<ICFBamTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultValue);
    tableColumnMinValue = new TableColumn<ICFBamTimestampDefObj, Calendar>("Min. Value");
    tableColumnMinValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampDefObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, Calendar>, TableCell<ICFBamTimestampDefObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTimestampDefObj, Calendar> call(
                        TableColumn<ICFBamTimestampDefObj, Calendar> arg) {
                    return new CFTimestampTableCell<ICFBamTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnMinValue);
    tableColumnMaxValue = new TableColumn<ICFBamTimestampDefObj, Calendar>("Max. Value");
    tableColumnMaxValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampDefObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, Calendar>, TableCell<ICFBamTimestampDefObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTimestampDefObj, Calendar> call(
                        TableColumn<ICFBamTimestampDefObj, Calendar> arg) {
                    return new CFTimestampTableCell<ICFBamTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnMaxValue);
    tableColumnNullValue = new TableColumn<ICFBamTimestampDefObj, Calendar>("Null Value");
    tableColumnNullValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampDefObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, Calendar>, TableCell<ICFBamTimestampDefObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTimestampDefObj, Calendar> call(
                        TableColumn<ICFBamTimestampDefObj, Calendar> arg) {
                    return new CFTimestampTableCell<ICFBamTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnNullValue);
    tableColumnUnknownValue = new TableColumn<ICFBamTimestampDefObj, Calendar>("Unknown Value");
    tableColumnUnknownValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampDefObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimestampDefObj, 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<ICFBamTimestampDefObj, Calendar>, TableCell<ICFBamTimestampDefObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTimestampDefObj, Calendar> call(
                        TableColumn<ICFBamTimestampDefObj, Calendar> arg) {
                    return new CFTimestampTableCell<ICFBamTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnUnknownValue);
    tableColumnLookupDefSchema = new TableColumn<ICFBamTimestampDefObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimestampDefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamTimestampDefObj, ICFBamSchemaDefObj> p) {
                    ICFBamTimestampDefObj 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<ICFBamTimestampDefObj, ICFBamSchemaDefObj>, TableCell<ICFBamTimestampDefObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamTimestampDefObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamTimestampDefObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamTimestampDefObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty()
            .addListener(new ChangeListener<ICFBamTimestampDefObj>() {
                @Override
                public void changed(ObservableValue<? extends ICFBamTimestampDefObj> observable,
                        ICFBamTimestampDefObj oldValue, ICFBamTimestampDefObj 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.choseTimestampDef(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");
                }
                ICFBamTimestampDefObj selectedInstance = getJavaFXFocusAsTimestampDef();
                invokeWhenChosen.choseTimestampDef(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.CFBamJavaFXTZTimestampDefPickerPane.java

public CFBamJavaFXTZTimestampDefPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamTZTimestampDefObj argFocus, ICFBamScopeObj argContainer,
        Collection<ICFBamTZTimestampDefObj> argDataCollection, ICFBamJavaFXTZTimestampDefChosen whenChosen) {
    super();/*from   w  w w.  j  ava2 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<ICFBamTZTimestampDefObj>();
    tableColumnObjKind = new TableColumn<ICFBamTZTimestampDefObj, String>("Class Code");
    tableColumnObjKind.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, String>, ObservableValue<String>>() {
                @Override
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampDefObj, String> p) {
                    ICFBamTZTimestampDefObj 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<ICFBamTZTimestampDefObj, String>, TableCell<ICFBamTZTimestampDefObj, String>>() {
                @Override
                public TableCell<ICFBamTZTimestampDefObj, String> call(
                        TableColumn<ICFBamTZTimestampDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnObjKind);
    tableColumnId = new TableColumn<ICFBamTZTimestampDefObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamTZTimestampDefObj, 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<ICFBamTZTimestampDefObj, Long>, TableCell<ICFBamTZTimestampDefObj, Long>>() {
                @Override
                public TableCell<ICFBamTZTimestampDefObj, Long> call(
                        TableColumn<ICFBamTZTimestampDefObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamTZTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamTZTimestampDefObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampDefObj, 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<ICFBamTZTimestampDefObj, String>, TableCell<ICFBamTZTimestampDefObj, String>>() {
                @Override
                public TableCell<ICFBamTZTimestampDefObj, String> call(
                        TableColumn<ICFBamTZTimestampDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamTZTimestampDefObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampDefObj, 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<ICFBamTZTimestampDefObj, String>, TableCell<ICFBamTZTimestampDefObj, String>>() {
                @Override
                public TableCell<ICFBamTZTimestampDefObj, String> call(
                        TableColumn<ICFBamTZTimestampDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamTZTimestampDefObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampDefObj, 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<ICFBamTZTimestampDefObj, String>, TableCell<ICFBamTZTimestampDefObj, String>>() {
                @Override
                public TableCell<ICFBamTZTimestampDefObj, String> call(
                        TableColumn<ICFBamTZTimestampDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamTZTimestampDefObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampDefObj, 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<ICFBamTZTimestampDefObj, String>, TableCell<ICFBamTZTimestampDefObj, String>>() {
                @Override
                public TableCell<ICFBamTZTimestampDefObj, String> call(
                        TableColumn<ICFBamTZTimestampDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamTZTimestampDefObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampDefObj, 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<ICFBamTZTimestampDefObj, String>, TableCell<ICFBamTZTimestampDefObj, String>>() {
                @Override
                public TableCell<ICFBamTZTimestampDefObj, String> call(
                        TableColumn<ICFBamTZTimestampDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnIsNullable = new TableColumn<ICFBamTZTimestampDefObj, Boolean>("Is Nullable");
    tableColumnIsNullable.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimestampDefObj, 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<ICFBamTZTimestampDefObj, Boolean>, TableCell<ICFBamTZTimestampDefObj, Boolean>>() {
                @Override
                public TableCell<ICFBamTZTimestampDefObj, Boolean> call(
                        TableColumn<ICFBamTZTimestampDefObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamTZTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsNullable);
    tableColumnGenerateId = new TableColumn<ICFBamTZTimestampDefObj, Boolean>("Generate Id");
    tableColumnGenerateId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimestampDefObj, 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<ICFBamTZTimestampDefObj, Boolean>, TableCell<ICFBamTZTimestampDefObj, Boolean>>() {
                @Override
                public TableCell<ICFBamTZTimestampDefObj, Boolean> call(
                        TableColumn<ICFBamTZTimestampDefObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamTZTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnGenerateId);
    tableColumnDefaultVisibility = new TableColumn<ICFBamTZTimestampDefObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimestampDefObj, 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<ICFBamTZTimestampDefObj, Boolean>, TableCell<ICFBamTZTimestampDefObj, Boolean>>() {
                @Override
                public TableCell<ICFBamTZTimestampDefObj, Boolean> call(
                        TableColumn<ICFBamTZTimestampDefObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamTZTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnDbName = new TableColumn<ICFBamTZTimestampDefObj, String>("Db Name");
    tableColumnDbName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimestampDefObj, 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<ICFBamTZTimestampDefObj, String>, TableCell<ICFBamTZTimestampDefObj, String>>() {
                @Override
                public TableCell<ICFBamTZTimestampDefObj, String> call(
                        TableColumn<ICFBamTZTimestampDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDbName);
    tableColumnInitValue = new TableColumn<ICFBamTZTimestampDefObj, Calendar>("Init. Value");
    tableColumnInitValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampDefObj, 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<ICFBamTZTimestampDefObj, Calendar>, TableCell<ICFBamTZTimestampDefObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTZTimestampDefObj, Calendar> call(
                        TableColumn<ICFBamTZTimestampDefObj, Calendar> arg) {
                    return new CFTZTimestampTableCell<ICFBamTZTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnInitValue);
    tableColumnDefaultValue = new TableColumn<ICFBamTZTimestampDefObj, Calendar>("Default Value");
    tableColumnDefaultValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampDefObj, 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<ICFBamTZTimestampDefObj, Calendar>, TableCell<ICFBamTZTimestampDefObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTZTimestampDefObj, Calendar> call(
                        TableColumn<ICFBamTZTimestampDefObj, Calendar> arg) {
                    return new CFTZTimestampTableCell<ICFBamTZTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultValue);
    tableColumnMinValue = new TableColumn<ICFBamTZTimestampDefObj, Calendar>("Min. Value");
    tableColumnMinValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampDefObj, 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<ICFBamTZTimestampDefObj, Calendar>, TableCell<ICFBamTZTimestampDefObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTZTimestampDefObj, Calendar> call(
                        TableColumn<ICFBamTZTimestampDefObj, Calendar> arg) {
                    return new CFTZTimestampTableCell<ICFBamTZTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnMinValue);
    tableColumnMaxValue = new TableColumn<ICFBamTZTimestampDefObj, Calendar>("Max. Value");
    tableColumnMaxValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampDefObj, 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<ICFBamTZTimestampDefObj, Calendar>, TableCell<ICFBamTZTimestampDefObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTZTimestampDefObj, Calendar> call(
                        TableColumn<ICFBamTZTimestampDefObj, Calendar> arg) {
                    return new CFTZTimestampTableCell<ICFBamTZTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnMaxValue);
    tableColumnNullValue = new TableColumn<ICFBamTZTimestampDefObj, Calendar>("Null Value");
    tableColumnNullValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampDefObj, 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<ICFBamTZTimestampDefObj, Calendar>, TableCell<ICFBamTZTimestampDefObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTZTimestampDefObj, Calendar> call(
                        TableColumn<ICFBamTZTimestampDefObj, Calendar> arg) {
                    return new CFTZTimestampTableCell<ICFBamTZTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnNullValue);
    tableColumnUnknownValue = new TableColumn<ICFBamTZTimestampDefObj, Calendar>("Unknown Value");
    tableColumnUnknownValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimestampDefObj, 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<ICFBamTZTimestampDefObj, Calendar>, TableCell<ICFBamTZTimestampDefObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTZTimestampDefObj, Calendar> call(
                        TableColumn<ICFBamTZTimestampDefObj, Calendar> arg) {
                    return new CFTZTimestampTableCell<ICFBamTZTimestampDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnUnknownValue);
    tableColumnLookupDefSchema = new TableColumn<ICFBamTZTimestampDefObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimestampDefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamTZTimestampDefObj, ICFBamSchemaDefObj> p) {
                    ICFBamTZTimestampDefObj 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<ICFBamTZTimestampDefObj, ICFBamSchemaDefObj>, TableCell<ICFBamTZTimestampDefObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamTZTimestampDefObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamTZTimestampDefObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamTZTimestampDefObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty()
            .addListener(new ChangeListener<ICFBamTZTimestampDefObj>() {
                @Override
                public void changed(ObservableValue<? extends ICFBamTZTimestampDefObj> observable,
                        ICFBamTZTimestampDefObj oldValue, ICFBamTZTimestampDefObj 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.choseTZTimestampDef(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");
                }
                ICFBamTZTimestampDefObj selectedInstance = getJavaFXFocusAsTZTimestampDef();
                invokeWhenChosen.choseTZTimestampDef(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.CFBamJavaFXNmTokensDefPickerPane.java

public CFBamJavaFXNmTokensDefPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamNmTokensDefObj argFocus, ICFBamScopeObj argContainer,
        Collection<ICFBamNmTokensDefObj> argDataCollection, ICFBamJavaFXNmTokensDefChosen whenChosen) {
    super();//from   w ww  .  j  a  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<ICFBamNmTokensDefObj>();
    tableColumnObjKind = new TableColumn<ICFBamNmTokensDefObj, String>("Class Code");
    tableColumnObjKind.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() {
                @Override
                public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) {
                    ICFBamNmTokensDefObj 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<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() {
                @Override
                public TableCell<ICFBamNmTokensDefObj, String> call(
                        TableColumn<ICFBamNmTokensDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamNmTokensDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnObjKind);
    tableColumnId = new TableColumn<ICFBamNmTokensDefObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamNmTokensDefObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamNmTokensDefObj, 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<ICFBamNmTokensDefObj, Long>, TableCell<ICFBamNmTokensDefObj, Long>>() {
                @Override
                public TableCell<ICFBamNmTokensDefObj, Long> call(TableColumn<ICFBamNmTokensDefObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamNmTokensDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamNmTokensDefObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, 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<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() {
                @Override
                public TableCell<ICFBamNmTokensDefObj, String> call(
                        TableColumn<ICFBamNmTokensDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamNmTokensDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamNmTokensDefObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, 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<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() {
                @Override
                public TableCell<ICFBamNmTokensDefObj, String> call(
                        TableColumn<ICFBamNmTokensDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamNmTokensDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamNmTokensDefObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, 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<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() {
                @Override
                public TableCell<ICFBamNmTokensDefObj, String> call(
                        TableColumn<ICFBamNmTokensDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamNmTokensDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamNmTokensDefObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, 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<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() {
                @Override
                public TableCell<ICFBamNmTokensDefObj, String> call(
                        TableColumn<ICFBamNmTokensDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamNmTokensDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamNmTokensDefObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, 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<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() {
                @Override
                public TableCell<ICFBamNmTokensDefObj, String> call(
                        TableColumn<ICFBamNmTokensDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamNmTokensDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnIsNullable = new TableColumn<ICFBamNmTokensDefObj, Boolean>("Is Nullable");
    tableColumnIsNullable.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamNmTokensDefObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokensDefObj, 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<ICFBamNmTokensDefObj, Boolean>, TableCell<ICFBamNmTokensDefObj, Boolean>>() {
                @Override
                public TableCell<ICFBamNmTokensDefObj, Boolean> call(
                        TableColumn<ICFBamNmTokensDefObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamNmTokensDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsNullable);
    tableColumnGenerateId = new TableColumn<ICFBamNmTokensDefObj, Boolean>("Generate Id");
    tableColumnGenerateId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamNmTokensDefObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokensDefObj, 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<ICFBamNmTokensDefObj, Boolean>, TableCell<ICFBamNmTokensDefObj, Boolean>>() {
                @Override
                public TableCell<ICFBamNmTokensDefObj, Boolean> call(
                        TableColumn<ICFBamNmTokensDefObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamNmTokensDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnGenerateId);
    tableColumnDefaultVisibility = new TableColumn<ICFBamNmTokensDefObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamNmTokensDefObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamNmTokensDefObj, 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<ICFBamNmTokensDefObj, Boolean>, TableCell<ICFBamNmTokensDefObj, Boolean>>() {
                @Override
                public TableCell<ICFBamNmTokensDefObj, Boolean> call(
                        TableColumn<ICFBamNmTokensDefObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamNmTokensDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnDbName = new TableColumn<ICFBamNmTokensDefObj, String>("Db Name");
    tableColumnDbName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, 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<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() {
                @Override
                public TableCell<ICFBamNmTokensDefObj, String> call(
                        TableColumn<ICFBamNmTokensDefObj, String> arg) {
                    return new CFStringTableCell<ICFBamNmTokensDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDbName);
    tableColumnMaxLen = new TableColumn<ICFBamNmTokensDefObj, Integer>("Max. Length");
    tableColumnMaxLen.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamNmTokensDefObj, Integer>, ObservableValue<Integer>>() {
                public ObservableValue<Integer> call(CellDataFeatures<ICFBamNmTokensDefObj, Integer> p) {
                    ICFBamNmTokensDefObj 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<ICFBamNmTokensDefObj, Integer>, TableCell<ICFBamNmTokensDefObj, Integer>>() {
                @Override
                public TableCell<ICFBamNmTokensDefObj, Integer> call(
                        TableColumn<ICFBamNmTokensDefObj, Integer> arg) {
                    return new CFInt32TableCell<ICFBamNmTokensDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnMaxLen);
    tableColumnInitValue = new TableColumn<ICFBamNmTokensDefObj, String>("Init. Value");
    tableColumnInitValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) {
                    ICFBamNmTokensDefObj 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<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() {
                @Override
                public TableCell<ICFBamNmTokensDefObj, String> call(
                        TableColumn<ICFBamNmTokensDefObj, String> arg) {
                    return new CFNmTokensTableCell<ICFBamNmTokensDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnInitValue);
    tableColumnDefaultValue = new TableColumn<ICFBamNmTokensDefObj, String>("Default Value");
    tableColumnDefaultValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) {
                    ICFBamNmTokensDefObj 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<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() {
                @Override
                public TableCell<ICFBamNmTokensDefObj, String> call(
                        TableColumn<ICFBamNmTokensDefObj, String> arg) {
                    return new CFNmTokensTableCell<ICFBamNmTokensDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultValue);
    tableColumnNullValue = new TableColumn<ICFBamNmTokensDefObj, String>("Null Value");
    tableColumnNullValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) {
                    ICFBamNmTokensDefObj 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<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() {
                @Override
                public TableCell<ICFBamNmTokensDefObj, String> call(
                        TableColumn<ICFBamNmTokensDefObj, String> arg) {
                    return new CFNmTokensTableCell<ICFBamNmTokensDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnNullValue);
    tableColumnUnknownValue = new TableColumn<ICFBamNmTokensDefObj, String>("Unknown Value");
    tableColumnUnknownValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamNmTokensDefObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamNmTokensDefObj, String> p) {
                    ICFBamNmTokensDefObj 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<ICFBamNmTokensDefObj, String>, TableCell<ICFBamNmTokensDefObj, String>>() {
                @Override
                public TableCell<ICFBamNmTokensDefObj, String> call(
                        TableColumn<ICFBamNmTokensDefObj, String> arg) {
                    return new CFNmTokensTableCell<ICFBamNmTokensDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnUnknownValue);
    tableColumnShowLines = new TableColumn<ICFBamNmTokensDefObj, Short>("Show Lines");
    tableColumnShowLines.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamNmTokensDefObj, Short>, ObservableValue<Short>>() {
                public ObservableValue<Short> call(CellDataFeatures<ICFBamNmTokensDefObj, Short> p) {
                    ICFBamNmTokensDefObj 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<ICFBamNmTokensDefObj, Short>, TableCell<ICFBamNmTokensDefObj, Short>>() {
                @Override
                public TableCell<ICFBamNmTokensDefObj, Short> call(
                        TableColumn<ICFBamNmTokensDefObj, Short> arg) {
                    return new CFInt16TableCell<ICFBamNmTokensDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShowLines);
    tableColumnLookupDefSchema = new TableColumn<ICFBamNmTokensDefObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamNmTokensDefObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamNmTokensDefObj, ICFBamSchemaDefObj> p) {
                    ICFBamNmTokensDefObj 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<ICFBamNmTokensDefObj, ICFBamSchemaDefObj>, TableCell<ICFBamNmTokensDefObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamNmTokensDefObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamNmTokensDefObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamNmTokensDefObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty()
            .addListener(new ChangeListener<ICFBamNmTokensDefObj>() {
                @Override
                public void changed(ObservableValue<? extends ICFBamNmTokensDefObj> observable,
                        ICFBamNmTokensDefObj oldValue, ICFBamNmTokensDefObj 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.choseNmTokensDef(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");
                }
                ICFBamNmTokensDefObj selectedInstance = getJavaFXFocusAsNmTokensDef();
                invokeWhenChosen.choseNmTokensDef(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);
}