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:com.bekwam.resignator.SettingsController.java

@FXML
public void cancel(ActionEvent evt) {

    if (dirtyFlag) {

        Alert alert = new Alert(Alert.AlertType.CONFIRMATION, "Form has been modified");
        alert.setHeaderText("Discard edits?");

        Optional<ButtonType> response = alert.showAndWait();

        if (response.isPresent() && response.get() == ButtonType.OK) {

            Configuration savedConf = configurationDS.getConfiguration();

            if (logger.isDebugEnabled()) {
                logger.debug("[CANCEL] reverting configuration ac jdkhome={} to sc jjdkhome={}",
                        activeConfiguration.getJDKHome(), savedConf.getJDKHome().get());
            }//from w w  w . jav a 2 s  .c  o  m

            activeConfiguration.setJDKHome(savedConf.getJDKHome().get());

            dirtyFlag = false;

        } else {
            return; // dirtyFlag continues to be true
        }
    }

    Scene scene = ((Button) evt.getSource()).getScene();
    if (scene != null) {
        Window w = scene.getWindow();
        if (w != null) {
            w.hide();
        }
    }
}

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

public CFBamJavaFXAtomPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamAtomObj argFocus, ICFBamScopeObj argContainer, Collection<ICFBamAtomObj> argDataCollection,
        ICFBamJavaFXAtomChosen whenChosen) {
    super();//from   w ww . ja  v  a  2  s  .c om
    final String S_ProcName = "construct-schema-focus";
    if (formManager == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "formManager");
    }
    cfFormManager = formManager;
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2,
                "argSchema");
    }
    if (whenChosen == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6,
                "whenChosen");
    }
    invokeWhenChosen = whenChosen;
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    javafxSchema = argSchema;
    javaFXFocus = argFocus;
    javafxContainer = argContainer;
    setJavaFXDataCollection(argDataCollection);
    dataTable = new TableView<ICFBamAtomObj>();
    tableColumnObjKind = new TableColumn<ICFBamAtomObj, String>("Class Code");
    tableColumnObjKind.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamAtomObj, String>, ObservableValue<String>>() {
                @Override
                public ObservableValue<String> call(CellDataFeatures<ICFBamAtomObj, String> p) {
                    ICFBamAtomObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String classCode = obj.getClassCode();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(classCode);
                        return (observable);
                    }
                }
            });
    tableColumnObjKind.setCellFactory(
            new Callback<TableColumn<ICFBamAtomObj, String>, TableCell<ICFBamAtomObj, String>>() {
                @Override
                public TableCell<ICFBamAtomObj, String> call(TableColumn<ICFBamAtomObj, String> arg) {
                    return new CFStringTableCell<ICFBamAtomObj>();
                }
            });
    dataTable.getColumns().add(tableColumnObjKind);
    tableColumnId = new TableColumn<ICFBamAtomObj, Long>("Id");
    tableColumnId
            .setCellValueFactory(new Callback<CellDataFeatures<ICFBamAtomObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamAtomObj, Long> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        long value = obj.getRequiredId();
                        Long wrapped = new Long(value);
                        ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnId
            .setCellFactory(new Callback<TableColumn<ICFBamAtomObj, Long>, TableCell<ICFBamAtomObj, Long>>() {
                @Override
                public TableCell<ICFBamAtomObj, Long> call(TableColumn<ICFBamAtomObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamAtomObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamAtomObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamAtomObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamAtomObj, String> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getRequiredName();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnName.setCellFactory(
            new Callback<TableColumn<ICFBamAtomObj, String>, TableCell<ICFBamAtomObj, String>>() {
                @Override
                public TableCell<ICFBamAtomObj, String> call(TableColumn<ICFBamAtomObj, String> arg) {
                    return new CFStringTableCell<ICFBamAtomObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamAtomObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamAtomObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamAtomObj, String> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalShortName();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnShortName.setCellFactory(
            new Callback<TableColumn<ICFBamAtomObj, String>, TableCell<ICFBamAtomObj, String>>() {
                @Override
                public TableCell<ICFBamAtomObj, String> call(TableColumn<ICFBamAtomObj, String> arg) {
                    return new CFStringTableCell<ICFBamAtomObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamAtomObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamAtomObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamAtomObj, String> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalLabel();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnLabel.setCellFactory(
            new Callback<TableColumn<ICFBamAtomObj, String>, TableCell<ICFBamAtomObj, String>>() {
                @Override
                public TableCell<ICFBamAtomObj, String> call(TableColumn<ICFBamAtomObj, String> arg) {
                    return new CFStringTableCell<ICFBamAtomObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamAtomObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamAtomObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamAtomObj, String> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalShortDescription();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnShortDescription.setCellFactory(
            new Callback<TableColumn<ICFBamAtomObj, String>, TableCell<ICFBamAtomObj, String>>() {
                @Override
                public TableCell<ICFBamAtomObj, String> call(TableColumn<ICFBamAtomObj, String> arg) {
                    return new CFStringTableCell<ICFBamAtomObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamAtomObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamAtomObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamAtomObj, String> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalDescription();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDescription.setCellFactory(
            new Callback<TableColumn<ICFBamAtomObj, String>, TableCell<ICFBamAtomObj, String>>() {
                @Override
                public TableCell<ICFBamAtomObj, String> call(TableColumn<ICFBamAtomObj, String> arg) {
                    return new CFStringTableCell<ICFBamAtomObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnIsNullable = new TableColumn<ICFBamAtomObj, Boolean>("Is Nullable");
    tableColumnIsNullable.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamAtomObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamAtomObj, Boolean> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        boolean value = obj.getRequiredIsNullable();
                        Boolean wrapped = new Boolean(value);
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnIsNullable.setCellFactory(
            new Callback<TableColumn<ICFBamAtomObj, Boolean>, TableCell<ICFBamAtomObj, Boolean>>() {
                @Override
                public TableCell<ICFBamAtomObj, Boolean> call(TableColumn<ICFBamAtomObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamAtomObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsNullable);
    tableColumnGenerateId = new TableColumn<ICFBamAtomObj, Boolean>("Generate Id");
    tableColumnGenerateId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamAtomObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamAtomObj, Boolean> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Boolean value = obj.getOptionalGenerateId();
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnGenerateId.setCellFactory(
            new Callback<TableColumn<ICFBamAtomObj, Boolean>, TableCell<ICFBamAtomObj, Boolean>>() {
                @Override
                public TableCell<ICFBamAtomObj, Boolean> call(TableColumn<ICFBamAtomObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamAtomObj>();
                }
            });
    dataTable.getColumns().add(tableColumnGenerateId);
    tableColumnDefaultVisibility = new TableColumn<ICFBamAtomObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamAtomObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamAtomObj, Boolean> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        boolean value = obj.getRequiredDefaultVisibility();
                        Boolean wrapped = new Boolean(value);
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnDefaultVisibility.setCellFactory(
            new Callback<TableColumn<ICFBamAtomObj, Boolean>, TableCell<ICFBamAtomObj, Boolean>>() {
                @Override
                public TableCell<ICFBamAtomObj, Boolean> call(TableColumn<ICFBamAtomObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamAtomObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnDbName = new TableColumn<ICFBamAtomObj, String>("Db Name");
    tableColumnDbName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamAtomObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamAtomObj, String> p) {
                    ICFBamAtomObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalDbName();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDbName.setCellFactory(
            new Callback<TableColumn<ICFBamAtomObj, String>, TableCell<ICFBamAtomObj, String>>() {
                @Override
                public TableCell<ICFBamAtomObj, String> call(TableColumn<ICFBamAtomObj, String> arg) {
                    return new CFStringTableCell<ICFBamAtomObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDbName);
    tableColumnLookupDefSchema = new TableColumn<ICFBamAtomObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamAtomObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamAtomObj, ICFBamSchemaDefObj> p) {
                    ICFBamAtomObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema();
                        ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupDefSchema.setCellFactory(
            new Callback<TableColumn<ICFBamAtomObj, ICFBamSchemaDefObj>, TableCell<ICFBamAtomObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamAtomObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamAtomObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamAtomObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamAtomObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamAtomObj> observable, ICFBamAtomObj oldValue,
                ICFBamAtomObj newValue) {
            setJavaFXFocus(newValue);
            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.choseAtom(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");
                }
                ICFBamAtomObj selectedInstance = getJavaFXFocusAsAtom();
                invokeWhenChosen.choseAtom(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.CFBamJavaFXBlobColPickerPane.java

public CFBamJavaFXBlobColPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamBlobColObj argFocus, ICFBamTableObj argContainer, Collection<ICFBamBlobColObj> argDataCollection,
        ICFBamJavaFXBlobColChosen whenChosen) {
    super();//from w  ww  .j ava 2s.co m
    final String S_ProcName = "construct-schema-focus";
    if (formManager == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "formManager");
    }
    cfFormManager = formManager;
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2,
                "argSchema");
    }
    if (whenChosen == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6,
                "whenChosen");
    }
    invokeWhenChosen = whenChosen;
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    javafxSchema = argSchema;
    javaFXFocus = argFocus;
    javafxContainer = argContainer;
    setJavaFXDataCollection(argDataCollection);
    dataTable = new TableView<ICFBamBlobColObj>();
    tableColumnId = new TableColumn<ICFBamBlobColObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobColObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamBlobColObj, 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<ICFBamBlobColObj, Long>, TableCell<ICFBamBlobColObj, Long>>() {
                @Override
                public TableCell<ICFBamBlobColObj, Long> call(TableColumn<ICFBamBlobColObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamBlobColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamBlobColObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamBlobColObj, 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<ICFBamBlobColObj, String>, TableCell<ICFBamBlobColObj, String>>() {
                @Override
                public TableCell<ICFBamBlobColObj, String> call(TableColumn<ICFBamBlobColObj, String> arg) {
                    return new CFStringTableCell<ICFBamBlobColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamBlobColObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamBlobColObj, 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<ICFBamBlobColObj, String>, TableCell<ICFBamBlobColObj, String>>() {
                @Override
                public TableCell<ICFBamBlobColObj, String> call(TableColumn<ICFBamBlobColObj, String> arg) {
                    return new CFStringTableCell<ICFBamBlobColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamBlobColObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamBlobColObj, 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<ICFBamBlobColObj, String>, TableCell<ICFBamBlobColObj, String>>() {
                @Override
                public TableCell<ICFBamBlobColObj, String> call(TableColumn<ICFBamBlobColObj, String> arg) {
                    return new CFStringTableCell<ICFBamBlobColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamBlobColObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamBlobColObj, 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<ICFBamBlobColObj, String>, TableCell<ICFBamBlobColObj, String>>() {
                @Override
                public TableCell<ICFBamBlobColObj, String> call(TableColumn<ICFBamBlobColObj, String> arg) {
                    return new CFStringTableCell<ICFBamBlobColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamBlobColObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamBlobColObj, 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<ICFBamBlobColObj, String>, TableCell<ICFBamBlobColObj, String>>() {
                @Override
                public TableCell<ICFBamBlobColObj, String> call(TableColumn<ICFBamBlobColObj, String> arg) {
                    return new CFStringTableCell<ICFBamBlobColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnIsNullable = new TableColumn<ICFBamBlobColObj, Boolean>("Is Nullable");
    tableColumnIsNullable.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobColObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBlobColObj, 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<ICFBamBlobColObj, Boolean>, TableCell<ICFBamBlobColObj, Boolean>>() {
                @Override
                public TableCell<ICFBamBlobColObj, Boolean> call(TableColumn<ICFBamBlobColObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamBlobColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsNullable);
    tableColumnGenerateId = new TableColumn<ICFBamBlobColObj, Boolean>("Generate Id");
    tableColumnGenerateId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobColObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBlobColObj, 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<ICFBamBlobColObj, Boolean>, TableCell<ICFBamBlobColObj, Boolean>>() {
                @Override
                public TableCell<ICFBamBlobColObj, Boolean> call(TableColumn<ICFBamBlobColObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamBlobColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnGenerateId);
    tableColumnDefaultVisibility = new TableColumn<ICFBamBlobColObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobColObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBlobColObj, 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<ICFBamBlobColObj, Boolean>, TableCell<ICFBamBlobColObj, Boolean>>() {
                @Override
                public TableCell<ICFBamBlobColObj, Boolean> call(TableColumn<ICFBamBlobColObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamBlobColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnDbName = new TableColumn<ICFBamBlobColObj, String>("Db Name");
    tableColumnDbName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamBlobColObj, 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<ICFBamBlobColObj, String>, TableCell<ICFBamBlobColObj, String>>() {
                @Override
                public TableCell<ICFBamBlobColObj, String> call(TableColumn<ICFBamBlobColObj, String> arg) {
                    return new CFStringTableCell<ICFBamBlobColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDbName);
    tableColumnMaxLen = new TableColumn<ICFBamBlobColObj, Integer>("Max. Length");
    tableColumnMaxLen.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobColObj, Integer>, ObservableValue<Integer>>() {
                public ObservableValue<Integer> call(CellDataFeatures<ICFBamBlobColObj, Integer> p) {
                    ICFBamBlobDefObj 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<ICFBamBlobColObj, Integer>, TableCell<ICFBamBlobColObj, Integer>>() {
                @Override
                public TableCell<ICFBamBlobColObj, Integer> call(TableColumn<ICFBamBlobColObj, Integer> arg) {
                    return new CFInt32TableCell<ICFBamBlobColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnMaxLen);
    tableColumnLookupDefSchema = new TableColumn<ICFBamBlobColObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamBlobColObj, ICFBamSchemaDefObj> p) {
                    ICFBamBlobColObj 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<ICFBamBlobColObj, ICFBamSchemaDefObj>, TableCell<ICFBamBlobColObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamBlobColObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamBlobColObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamBlobColObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamBlobColObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamBlobColObj> observable, ICFBamBlobColObj oldValue,
                ICFBamBlobColObj 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.choseBlobCol(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");
                }
                ICFBamBlobColObj selectedInstance = getJavaFXFocusAsBlobCol();
                invokeWhenChosen.choseBlobCol(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.CFBamJavaFXBlobTypePickerPane.java

public CFBamJavaFXBlobTypePickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamBlobTypeObj argFocus, ICFBamSchemaDefObj argContainer,
        Collection<ICFBamBlobTypeObj> argDataCollection, ICFBamJavaFXBlobTypeChosen whenChosen) {
    super();//from  w  w 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<ICFBamBlobTypeObj>();
    tableColumnId = new TableColumn<ICFBamBlobTypeObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobTypeObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamBlobTypeObj, 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<ICFBamBlobTypeObj, Long>, TableCell<ICFBamBlobTypeObj, Long>>() {
                @Override
                public TableCell<ICFBamBlobTypeObj, Long> call(TableColumn<ICFBamBlobTypeObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamBlobTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamBlobTypeObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobTypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamBlobTypeObj, 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<ICFBamBlobTypeObj, String>, TableCell<ICFBamBlobTypeObj, String>>() {
                @Override
                public TableCell<ICFBamBlobTypeObj, String> call(TableColumn<ICFBamBlobTypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamBlobTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamBlobTypeObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobTypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamBlobTypeObj, 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<ICFBamBlobTypeObj, String>, TableCell<ICFBamBlobTypeObj, String>>() {
                @Override
                public TableCell<ICFBamBlobTypeObj, String> call(TableColumn<ICFBamBlobTypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamBlobTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamBlobTypeObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobTypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamBlobTypeObj, 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<ICFBamBlobTypeObj, String>, TableCell<ICFBamBlobTypeObj, String>>() {
                @Override
                public TableCell<ICFBamBlobTypeObj, String> call(TableColumn<ICFBamBlobTypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamBlobTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamBlobTypeObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobTypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamBlobTypeObj, 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<ICFBamBlobTypeObj, String>, TableCell<ICFBamBlobTypeObj, String>>() {
                @Override
                public TableCell<ICFBamBlobTypeObj, String> call(TableColumn<ICFBamBlobTypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamBlobTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamBlobTypeObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobTypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamBlobTypeObj, 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<ICFBamBlobTypeObj, String>, TableCell<ICFBamBlobTypeObj, String>>() {
                @Override
                public TableCell<ICFBamBlobTypeObj, String> call(TableColumn<ICFBamBlobTypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamBlobTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnIsNullable = new TableColumn<ICFBamBlobTypeObj, Boolean>("Is Nullable");
    tableColumnIsNullable.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobTypeObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBlobTypeObj, 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<ICFBamBlobTypeObj, Boolean>, TableCell<ICFBamBlobTypeObj, Boolean>>() {
                @Override
                public TableCell<ICFBamBlobTypeObj, Boolean> call(TableColumn<ICFBamBlobTypeObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamBlobTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsNullable);
    tableColumnGenerateId = new TableColumn<ICFBamBlobTypeObj, Boolean>("Generate Id");
    tableColumnGenerateId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobTypeObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBlobTypeObj, 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<ICFBamBlobTypeObj, Boolean>, TableCell<ICFBamBlobTypeObj, Boolean>>() {
                @Override
                public TableCell<ICFBamBlobTypeObj, Boolean> call(TableColumn<ICFBamBlobTypeObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamBlobTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnGenerateId);
    tableColumnDefaultVisibility = new TableColumn<ICFBamBlobTypeObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobTypeObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamBlobTypeObj, 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<ICFBamBlobTypeObj, Boolean>, TableCell<ICFBamBlobTypeObj, Boolean>>() {
                @Override
                public TableCell<ICFBamBlobTypeObj, Boolean> call(TableColumn<ICFBamBlobTypeObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamBlobTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnDbName = new TableColumn<ICFBamBlobTypeObj, String>("Db Name");
    tableColumnDbName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobTypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamBlobTypeObj, 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<ICFBamBlobTypeObj, String>, TableCell<ICFBamBlobTypeObj, String>>() {
                @Override
                public TableCell<ICFBamBlobTypeObj, String> call(TableColumn<ICFBamBlobTypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamBlobTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDbName);
    tableColumnMaxLen = new TableColumn<ICFBamBlobTypeObj, Integer>("Max. Length");
    tableColumnMaxLen.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobTypeObj, Integer>, ObservableValue<Integer>>() {
                public ObservableValue<Integer> call(CellDataFeatures<ICFBamBlobTypeObj, Integer> p) {
                    ICFBamBlobDefObj 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<ICFBamBlobTypeObj, Integer>, TableCell<ICFBamBlobTypeObj, Integer>>() {
                @Override
                public TableCell<ICFBamBlobTypeObj, Integer> call(TableColumn<ICFBamBlobTypeObj, Integer> arg) {
                    return new CFInt32TableCell<ICFBamBlobTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnMaxLen);
    tableColumnLookupDefSchema = new TableColumn<ICFBamBlobTypeObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamBlobTypeObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamBlobTypeObj, ICFBamSchemaDefObj> p) {
                    ICFBamBlobTypeObj 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<ICFBamBlobTypeObj, ICFBamSchemaDefObj>, TableCell<ICFBamBlobTypeObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamBlobTypeObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamBlobTypeObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamBlobTypeObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamBlobTypeObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamBlobTypeObj> observable, ICFBamBlobTypeObj oldValue,
                ICFBamBlobTypeObj 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.choseBlobType(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");
                }
                ICFBamBlobTypeObj selectedInstance = getJavaFXFocusAsBlobType();
                invokeWhenChosen.choseBlobType(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.CFBamJavaFXIndexPickerPane.java

public CFBamJavaFXIndexPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamIndexObj argFocus, ICFBamTableObj argContainer, Collection<ICFBamIndexObj> argDataCollection,
        ICFBamJavaFXIndexChosen whenChosen) {
    super();//  w w  w  .j a  v  a 2 s. c o m
    final String S_ProcName = "construct-schema-focus";
    if (formManager == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "formManager");
    }
    cfFormManager = formManager;
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2,
                "argSchema");
    }
    if (whenChosen == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6,
                "whenChosen");
    }
    invokeWhenChosen = whenChosen;
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    javafxSchema = argSchema;
    javaFXFocus = argFocus;
    javafxContainer = argContainer;
    setJavaFXDataCollection(argDataCollection);
    dataTable = new TableView<ICFBamIndexObj>();
    tableColumnId = new TableColumn<ICFBamIndexObj, Long>("Id");
    tableColumnId
            .setCellValueFactory(new Callback<CellDataFeatures<ICFBamIndexObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamIndexObj, 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<ICFBamIndexObj, Long>, TableCell<ICFBamIndexObj, Long>>() {
                @Override
                public TableCell<ICFBamIndexObj, Long> call(TableColumn<ICFBamIndexObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamIndexObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamIndexObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamIndexObj, String> p) {
                    ICFBamIndexObj 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<ICFBamIndexObj, String>, TableCell<ICFBamIndexObj, String>>() {
                @Override
                public TableCell<ICFBamIndexObj, String> call(TableColumn<ICFBamIndexObj, String> arg) {
                    return new CFStringTableCell<ICFBamIndexObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamIndexObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamIndexObj, String> p) {
                    ICFBamIndexObj 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<ICFBamIndexObj, String>, TableCell<ICFBamIndexObj, String>>() {
                @Override
                public TableCell<ICFBamIndexObj, String> call(TableColumn<ICFBamIndexObj, String> arg) {
                    return new CFStringTableCell<ICFBamIndexObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamIndexObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamIndexObj, String> p) {
                    ICFBamIndexObj 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<ICFBamIndexObj, String>, TableCell<ICFBamIndexObj, String>>() {
                @Override
                public TableCell<ICFBamIndexObj, String> call(TableColumn<ICFBamIndexObj, String> arg) {
                    return new CFStringTableCell<ICFBamIndexObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamIndexObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamIndexObj, String> p) {
                    ICFBamIndexObj 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<ICFBamIndexObj, String>, TableCell<ICFBamIndexObj, String>>() {
                @Override
                public TableCell<ICFBamIndexObj, String> call(TableColumn<ICFBamIndexObj, String> arg) {
                    return new CFStringTableCell<ICFBamIndexObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamIndexObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamIndexObj, String> p) {
                    ICFBamIndexObj 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<ICFBamIndexObj, String>, TableCell<ICFBamIndexObj, String>>() {
                @Override
                public TableCell<ICFBamIndexObj, String> call(TableColumn<ICFBamIndexObj, String> arg) {
                    return new CFStringTableCell<ICFBamIndexObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnDbName = new TableColumn<ICFBamIndexObj, String>("Db Name");
    tableColumnDbName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamIndexObj, String> p) {
                    ICFBamIndexObj 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<ICFBamIndexObj, String>, TableCell<ICFBamIndexObj, String>>() {
                @Override
                public TableCell<ICFBamIndexObj, String> call(TableColumn<ICFBamIndexObj, String> arg) {
                    return new CFStringTableCell<ICFBamIndexObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDbName);
    tableColumnSuffix = new TableColumn<ICFBamIndexObj, String>("Suffix");
    tableColumnSuffix.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamIndexObj, String> p) {
                    ICFBamIndexObj 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<ICFBamIndexObj, String>, TableCell<ICFBamIndexObj, String>>() {
                @Override
                public TableCell<ICFBamIndexObj, String> call(TableColumn<ICFBamIndexObj, String> arg) {
                    return new CFStringTableCell<ICFBamIndexObj>();
                }
            });
    dataTable.getColumns().add(tableColumnSuffix);
    tableColumnIsUnique = new TableColumn<ICFBamIndexObj, Boolean>("Is Unique");
    tableColumnIsUnique.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamIndexObj, Boolean> p) {
                    ICFBamIndexObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        boolean value = obj.getRequiredIsUnique();
                        Boolean wrapped = new Boolean(value);
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnIsUnique.setCellFactory(
            new Callback<TableColumn<ICFBamIndexObj, Boolean>, TableCell<ICFBamIndexObj, Boolean>>() {
                @Override
                public TableCell<ICFBamIndexObj, Boolean> call(TableColumn<ICFBamIndexObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamIndexObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsUnique);
    tableColumnIsDbMapped = new TableColumn<ICFBamIndexObj, Boolean>("Is Db Mapped");
    tableColumnIsDbMapped.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamIndexObj, Boolean> p) {
                    ICFBamIndexObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        boolean value = obj.getRequiredIsDbMapped();
                        Boolean wrapped = new Boolean(value);
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnIsDbMapped.setCellFactory(
            new Callback<TableColumn<ICFBamIndexObj, Boolean>, TableCell<ICFBamIndexObj, Boolean>>() {
                @Override
                public TableCell<ICFBamIndexObj, Boolean> call(TableColumn<ICFBamIndexObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamIndexObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsDbMapped);
    tableColumnDefaultVisibility = new TableColumn<ICFBamIndexObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamIndexObj, Boolean> p) {
                    ICFBamIndexObj 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<ICFBamIndexObj, Boolean>, TableCell<ICFBamIndexObj, Boolean>>() {
                @Override
                public TableCell<ICFBamIndexObj, Boolean> call(TableColumn<ICFBamIndexObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamIndexObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnLookupDefSchema = new TableColumn<ICFBamIndexObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamIndexObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamIndexObj, ICFBamSchemaDefObj> p) {
                    ICFBamIndexObj 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<ICFBamIndexObj, ICFBamSchemaDefObj>, TableCell<ICFBamIndexObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamIndexObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamIndexObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamIndexObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamIndexObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamIndexObj> observable, ICFBamIndexObj oldValue,
                ICFBamIndexObj 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.choseIndex(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");
                }
                ICFBamIndexObj selectedInstance = getJavaFXFocusAsIndex();
                invokeWhenChosen.choseIndex(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.CFBamJavaFXTableColPickerPane.java

public CFBamJavaFXTableColPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamTableColObj argFocus, ICFBamTableObj argContainer,
        Collection<ICFBamTableColObj> argDataCollection, ICFBamJavaFXTableColChosen 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<ICFBamTableColObj>();
    tableColumnId = new TableColumn<ICFBamTableColObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTableColObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamTableColObj, 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<ICFBamTableColObj, Long>, TableCell<ICFBamTableColObj, Long>>() {
                @Override
                public TableCell<ICFBamTableColObj, Long> call(TableColumn<ICFBamTableColObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamTableColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamTableColObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTableColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTableColObj, 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<ICFBamTableColObj, String>, TableCell<ICFBamTableColObj, String>>() {
                @Override
                public TableCell<ICFBamTableColObj, String> call(TableColumn<ICFBamTableColObj, String> arg) {
                    return new CFStringTableCell<ICFBamTableColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamTableColObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTableColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTableColObj, 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<ICFBamTableColObj, String>, TableCell<ICFBamTableColObj, String>>() {
                @Override
                public TableCell<ICFBamTableColObj, String> call(TableColumn<ICFBamTableColObj, String> arg) {
                    return new CFStringTableCell<ICFBamTableColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamTableColObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTableColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTableColObj, 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<ICFBamTableColObj, String>, TableCell<ICFBamTableColObj, String>>() {
                @Override
                public TableCell<ICFBamTableColObj, String> call(TableColumn<ICFBamTableColObj, String> arg) {
                    return new CFStringTableCell<ICFBamTableColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamTableColObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTableColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTableColObj, 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<ICFBamTableColObj, String>, TableCell<ICFBamTableColObj, String>>() {
                @Override
                public TableCell<ICFBamTableColObj, String> call(TableColumn<ICFBamTableColObj, String> arg) {
                    return new CFStringTableCell<ICFBamTableColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamTableColObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTableColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTableColObj, 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<ICFBamTableColObj, String>, TableCell<ICFBamTableColObj, String>>() {
                @Override
                public TableCell<ICFBamTableColObj, String> call(TableColumn<ICFBamTableColObj, String> arg) {
                    return new CFStringTableCell<ICFBamTableColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnIsNullable = new TableColumn<ICFBamTableColObj, Boolean>("Is Nullable");
    tableColumnIsNullable.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTableColObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTableColObj, 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<ICFBamTableColObj, Boolean>, TableCell<ICFBamTableColObj, Boolean>>() {
                @Override
                public TableCell<ICFBamTableColObj, Boolean> call(TableColumn<ICFBamTableColObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamTableColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsNullable);
    tableColumnGenerateId = new TableColumn<ICFBamTableColObj, Boolean>("Generate Id");
    tableColumnGenerateId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTableColObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTableColObj, 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<ICFBamTableColObj, Boolean>, TableCell<ICFBamTableColObj, Boolean>>() {
                @Override
                public TableCell<ICFBamTableColObj, Boolean> call(TableColumn<ICFBamTableColObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamTableColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnGenerateId);
    tableColumnDefaultVisibility = new TableColumn<ICFBamTableColObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTableColObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTableColObj, 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<ICFBamTableColObj, Boolean>, TableCell<ICFBamTableColObj, Boolean>>() {
                @Override
                public TableCell<ICFBamTableColObj, Boolean> call(TableColumn<ICFBamTableColObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamTableColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnDbName = new TableColumn<ICFBamTableColObj, String>("Db Name");
    tableColumnDbName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTableColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTableColObj, String> p) {
                    ICFBamTableColObj 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<ICFBamTableColObj, String>, TableCell<ICFBamTableColObj, String>>() {
                @Override
                public TableCell<ICFBamTableColObj, String> call(TableColumn<ICFBamTableColObj, String> arg) {
                    return new CFStringTableCell<ICFBamTableColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDbName);
    tableColumnParentDataType = new TableColumn<ICFBamTableColObj, ICFBamValueObj>("Column Data Type");
    tableColumnParentDataType.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTableColObj, ICFBamValueObj>, ObservableValue<ICFBamValueObj>>() {
                public ObservableValue<ICFBamValueObj> call(
                        CellDataFeatures<ICFBamTableColObj, ICFBamValueObj> p) {
                    ICFBamTableColObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamValueObj ref = obj.getRequiredParentDataType();
                        ReadOnlyObjectWrapper<ICFBamValueObj> observable = new ReadOnlyObjectWrapper<ICFBamValueObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnParentDataType.setCellFactory(
            new Callback<TableColumn<ICFBamTableColObj, ICFBamValueObj>, TableCell<ICFBamTableColObj, ICFBamValueObj>>() {
                @Override
                public TableCell<ICFBamTableColObj, ICFBamValueObj> call(
                        TableColumn<ICFBamTableColObj, ICFBamValueObj> arg) {
                    return new CFReferenceTableCell<ICFBamTableColObj, ICFBamValueObj>();
                }
            });
    dataTable.getColumns().add(tableColumnParentDataType);
    tableColumnLookupDefSchema = new TableColumn<ICFBamTableColObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTableColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamTableColObj, ICFBamSchemaDefObj> p) {
                    ICFBamTableColObj 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<ICFBamTableColObj, ICFBamSchemaDefObj>, TableCell<ICFBamTableColObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamTableColObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamTableColObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamTableColObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamTableColObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamTableColObj> observable, ICFBamTableColObj oldValue,
                ICFBamTableColObj 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.choseTableCol(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");
                }
                ICFBamTableColObj selectedInstance = getJavaFXFocusAsTableCol();
                invokeWhenChosen.choseTableCol(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.CFBamJavaFXServerProcPickerPane.java

public CFBamJavaFXServerProcPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamServerProcObj argFocus, ICFBamTableObj argContainer,
        Collection<ICFBamServerProcObj> argDataCollection, ICFBamJavaFXServerProcChosen whenChosen) {
    super();//from  ww w.  j  av 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<ICFBamServerProcObj>();
    tableColumnId = new TableColumn<ICFBamServerProcObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerProcObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamServerProcObj, 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<ICFBamServerProcObj, Long>, TableCell<ICFBamServerProcObj, Long>>() {
                @Override
                public TableCell<ICFBamServerProcObj, Long> call(TableColumn<ICFBamServerProcObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamServerProcObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamServerProcObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerProcObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamServerProcObj, String> p) {
                    ICFBamServerMethodObj 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<ICFBamServerProcObj, String>, TableCell<ICFBamServerProcObj, String>>() {
                @Override
                public TableCell<ICFBamServerProcObj, String> call(
                        TableColumn<ICFBamServerProcObj, String> arg) {
                    return new CFStringTableCell<ICFBamServerProcObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamServerProcObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerProcObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamServerProcObj, String> p) {
                    ICFBamServerMethodObj 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<ICFBamServerProcObj, String>, TableCell<ICFBamServerProcObj, String>>() {
                @Override
                public TableCell<ICFBamServerProcObj, String> call(
                        TableColumn<ICFBamServerProcObj, String> arg) {
                    return new CFStringTableCell<ICFBamServerProcObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamServerProcObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerProcObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamServerProcObj, String> p) {
                    ICFBamServerMethodObj 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<ICFBamServerProcObj, String>, TableCell<ICFBamServerProcObj, String>>() {
                @Override
                public TableCell<ICFBamServerProcObj, String> call(
                        TableColumn<ICFBamServerProcObj, String> arg) {
                    return new CFStringTableCell<ICFBamServerProcObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamServerProcObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerProcObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamServerProcObj, String> p) {
                    ICFBamServerMethodObj 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<ICFBamServerProcObj, String>, TableCell<ICFBamServerProcObj, String>>() {
                @Override
                public TableCell<ICFBamServerProcObj, String> call(
                        TableColumn<ICFBamServerProcObj, String> arg) {
                    return new CFStringTableCell<ICFBamServerProcObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamServerProcObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerProcObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamServerProcObj, String> p) {
                    ICFBamServerMethodObj 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<ICFBamServerProcObj, String>, TableCell<ICFBamServerProcObj, String>>() {
                @Override
                public TableCell<ICFBamServerProcObj, String> call(
                        TableColumn<ICFBamServerProcObj, String> arg) {
                    return new CFStringTableCell<ICFBamServerProcObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnSuffix = new TableColumn<ICFBamServerProcObj, String>("Suffix");
    tableColumnSuffix.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerProcObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamServerProcObj, String> p) {
                    ICFBamServerMethodObj 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<ICFBamServerProcObj, String>, TableCell<ICFBamServerProcObj, String>>() {
                @Override
                public TableCell<ICFBamServerProcObj, String> call(
                        TableColumn<ICFBamServerProcObj, String> arg) {
                    return new CFStringTableCell<ICFBamServerProcObj>();
                }
            });
    dataTable.getColumns().add(tableColumnSuffix);
    tableColumnDefaultVisibility = new TableColumn<ICFBamServerProcObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerProcObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamServerProcObj, Boolean> p) {
                    ICFBamServerMethodObj 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<ICFBamServerProcObj, Boolean>, TableCell<ICFBamServerProcObj, Boolean>>() {
                @Override
                public TableCell<ICFBamServerProcObj, Boolean> call(
                        TableColumn<ICFBamServerProcObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamServerProcObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnIsInstanceMethod = new TableColumn<ICFBamServerProcObj, Boolean>("Is Instance Method");
    tableColumnIsInstanceMethod.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerProcObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamServerProcObj, Boolean> p) {
                    ICFBamServerMethodObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        boolean value = obj.getRequiredIsInstanceMethod();
                        Boolean wrapped = new Boolean(value);
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnIsInstanceMethod.setCellFactory(
            new Callback<TableColumn<ICFBamServerProcObj, Boolean>, TableCell<ICFBamServerProcObj, Boolean>>() {
                @Override
                public TableCell<ICFBamServerProcObj, Boolean> call(
                        TableColumn<ICFBamServerProcObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamServerProcObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsInstanceMethod);
    tableColumnJMethodBody = new TableColumn<ICFBamServerProcObj, String>("Java Method Body");
    tableColumnJMethodBody.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerProcObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamServerProcObj, String> p) {
                    ICFBamServerMethodObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getRequiredJMethodBody();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnJMethodBody.setCellFactory(
            new Callback<TableColumn<ICFBamServerProcObj, String>, TableCell<ICFBamServerProcObj, String>>() {
                @Override
                public TableCell<ICFBamServerProcObj, String> call(
                        TableColumn<ICFBamServerProcObj, String> arg) {
                    return new CFTextTableCell<ICFBamServerProcObj>();
                }
            });
    dataTable.getColumns().add(tableColumnJMethodBody);
    tableColumnDummy = new TableColumn<ICFBamServerProcObj, String>("Dummy");
    tableColumnDummy.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerProcObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamServerProcObj, String> p) {
                    ICFBamServerProcObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalDummy();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDummy.setCellFactory(
            new Callback<TableColumn<ICFBamServerProcObj, String>, TableCell<ICFBamServerProcObj, String>>() {
                @Override
                public TableCell<ICFBamServerProcObj, String> call(
                        TableColumn<ICFBamServerProcObj, String> arg) {
                    return new CFStringTableCell<ICFBamServerProcObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDummy);
    tableColumnLookupDefSchema = new TableColumn<ICFBamServerProcObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerProcObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamServerProcObj, ICFBamSchemaDefObj> p) {
                    ICFBamServerProcObj 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<ICFBamServerProcObj, ICFBamSchemaDefObj>, TableCell<ICFBamServerProcObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamServerProcObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamServerProcObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamServerProcObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamServerProcObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamServerProcObj> observable,
                ICFBamServerProcObj oldValue, ICFBamServerProcObj 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.choseServerProc(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");
                }
                ICFBamServerProcObj selectedInstance = getJavaFXFocusAsServerProc();
                invokeWhenChosen.choseServerProc(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.CFBamJavaFXServerMethodPickerPane.java

public CFBamJavaFXServerMethodPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamServerMethodObj argFocus, ICFBamTableObj argContainer,
        Collection<ICFBamServerMethodObj> argDataCollection, ICFBamJavaFXServerMethodChosen whenChosen) {
    super();//from   w ww . ja  v  a  2 s .  co  m
    final String S_ProcName = "construct-schema-focus";
    if (formManager == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "formManager");
    }
    cfFormManager = formManager;
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2,
                "argSchema");
    }
    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<ICFBamServerMethodObj>();
    tableColumnObjKind = new TableColumn<ICFBamServerMethodObj, String>("Class Code");
    tableColumnObjKind.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerMethodObj, String>, ObservableValue<String>>() {
                @Override
                public ObservableValue<String> call(CellDataFeatures<ICFBamServerMethodObj, String> p) {
                    ICFBamServerMethodObj 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<ICFBamServerMethodObj, String>, TableCell<ICFBamServerMethodObj, String>>() {
                @Override
                public TableCell<ICFBamServerMethodObj, String> call(
                        TableColumn<ICFBamServerMethodObj, String> arg) {
                    return new CFStringTableCell<ICFBamServerMethodObj>();
                }
            });
    dataTable.getColumns().add(tableColumnObjKind);
    tableColumnId = new TableColumn<ICFBamServerMethodObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerMethodObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamServerMethodObj, 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<ICFBamServerMethodObj, Long>, TableCell<ICFBamServerMethodObj, Long>>() {
                @Override
                public TableCell<ICFBamServerMethodObj, Long> call(
                        TableColumn<ICFBamServerMethodObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamServerMethodObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamServerMethodObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerMethodObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamServerMethodObj, String> p) {
                    ICFBamServerMethodObj 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<ICFBamServerMethodObj, String>, TableCell<ICFBamServerMethodObj, String>>() {
                @Override
                public TableCell<ICFBamServerMethodObj, String> call(
                        TableColumn<ICFBamServerMethodObj, String> arg) {
                    return new CFStringTableCell<ICFBamServerMethodObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamServerMethodObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerMethodObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamServerMethodObj, String> p) {
                    ICFBamServerMethodObj 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<ICFBamServerMethodObj, String>, TableCell<ICFBamServerMethodObj, String>>() {
                @Override
                public TableCell<ICFBamServerMethodObj, String> call(
                        TableColumn<ICFBamServerMethodObj, String> arg) {
                    return new CFStringTableCell<ICFBamServerMethodObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamServerMethodObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerMethodObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamServerMethodObj, String> p) {
                    ICFBamServerMethodObj 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<ICFBamServerMethodObj, String>, TableCell<ICFBamServerMethodObj, String>>() {
                @Override
                public TableCell<ICFBamServerMethodObj, String> call(
                        TableColumn<ICFBamServerMethodObj, String> arg) {
                    return new CFStringTableCell<ICFBamServerMethodObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamServerMethodObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerMethodObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamServerMethodObj, String> p) {
                    ICFBamServerMethodObj 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<ICFBamServerMethodObj, String>, TableCell<ICFBamServerMethodObj, String>>() {
                @Override
                public TableCell<ICFBamServerMethodObj, String> call(
                        TableColumn<ICFBamServerMethodObj, String> arg) {
                    return new CFStringTableCell<ICFBamServerMethodObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamServerMethodObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerMethodObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamServerMethodObj, String> p) {
                    ICFBamServerMethodObj 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<ICFBamServerMethodObj, String>, TableCell<ICFBamServerMethodObj, String>>() {
                @Override
                public TableCell<ICFBamServerMethodObj, String> call(
                        TableColumn<ICFBamServerMethodObj, String> arg) {
                    return new CFStringTableCell<ICFBamServerMethodObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnSuffix = new TableColumn<ICFBamServerMethodObj, String>("Suffix");
    tableColumnSuffix.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerMethodObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamServerMethodObj, String> p) {
                    ICFBamServerMethodObj 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<ICFBamServerMethodObj, String>, TableCell<ICFBamServerMethodObj, String>>() {
                @Override
                public TableCell<ICFBamServerMethodObj, String> call(
                        TableColumn<ICFBamServerMethodObj, String> arg) {
                    return new CFStringTableCell<ICFBamServerMethodObj>();
                }
            });
    dataTable.getColumns().add(tableColumnSuffix);
    tableColumnDefaultVisibility = new TableColumn<ICFBamServerMethodObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerMethodObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamServerMethodObj, Boolean> p) {
                    ICFBamServerMethodObj 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<ICFBamServerMethodObj, Boolean>, TableCell<ICFBamServerMethodObj, Boolean>>() {
                @Override
                public TableCell<ICFBamServerMethodObj, Boolean> call(
                        TableColumn<ICFBamServerMethodObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamServerMethodObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnIsInstanceMethod = new TableColumn<ICFBamServerMethodObj, Boolean>("Is Instance Method");
    tableColumnIsInstanceMethod.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerMethodObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamServerMethodObj, Boolean> p) {
                    ICFBamServerMethodObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        boolean value = obj.getRequiredIsInstanceMethod();
                        Boolean wrapped = new Boolean(value);
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnIsInstanceMethod.setCellFactory(
            new Callback<TableColumn<ICFBamServerMethodObj, Boolean>, TableCell<ICFBamServerMethodObj, Boolean>>() {
                @Override
                public TableCell<ICFBamServerMethodObj, Boolean> call(
                        TableColumn<ICFBamServerMethodObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamServerMethodObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsInstanceMethod);
    tableColumnJMethodBody = new TableColumn<ICFBamServerMethodObj, String>("Java Method Body");
    tableColumnJMethodBody.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerMethodObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamServerMethodObj, String> p) {
                    ICFBamServerMethodObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getRequiredJMethodBody();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnJMethodBody.setCellFactory(
            new Callback<TableColumn<ICFBamServerMethodObj, String>, TableCell<ICFBamServerMethodObj, String>>() {
                @Override
                public TableCell<ICFBamServerMethodObj, String> call(
                        TableColumn<ICFBamServerMethodObj, String> arg) {
                    return new CFTextTableCell<ICFBamServerMethodObj>();
                }
            });
    dataTable.getColumns().add(tableColumnJMethodBody);
    tableColumnLookupDefSchema = new TableColumn<ICFBamServerMethodObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerMethodObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamServerMethodObj, ICFBamSchemaDefObj> p) {
                    ICFBamServerMethodObj 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<ICFBamServerMethodObj, ICFBamSchemaDefObj>, TableCell<ICFBamServerMethodObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamServerMethodObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamServerMethodObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamServerMethodObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty()
            .addListener(new ChangeListener<ICFBamServerMethodObj>() {
                @Override
                public void changed(ObservableValue<? extends ICFBamServerMethodObj> observable,
                        ICFBamServerMethodObj oldValue, ICFBamServerMethodObj 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.choseServerMethod(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");
                }
                ICFBamServerMethodObj selectedInstance = getJavaFXFocusAsServerMethod();
                invokeWhenChosen.choseServerMethod(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.CFBamJavaFXServerObjFuncPickerPane.java

public CFBamJavaFXServerObjFuncPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamServerObjFuncObj argFocus, ICFBamTableObj argContainer,
        Collection<ICFBamServerObjFuncObj> argDataCollection, ICFBamJavaFXServerObjFuncChosen whenChosen) {
    super();/*  w w  w  .  j a v  a  2 s . com*/
    final String S_ProcName = "construct-schema-focus";
    if (formManager == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "formManager");
    }
    cfFormManager = formManager;
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2,
                "argSchema");
    }
    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<ICFBamServerObjFuncObj>();
    tableColumnId = new TableColumn<ICFBamServerObjFuncObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerObjFuncObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamServerObjFuncObj, 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<ICFBamServerObjFuncObj, Long>, TableCell<ICFBamServerObjFuncObj, Long>>() {
                @Override
                public TableCell<ICFBamServerObjFuncObj, Long> call(
                        TableColumn<ICFBamServerObjFuncObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamServerObjFuncObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamServerObjFuncObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerObjFuncObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamServerObjFuncObj, String> p) {
                    ICFBamServerMethodObj 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<ICFBamServerObjFuncObj, String>, TableCell<ICFBamServerObjFuncObj, String>>() {
                @Override
                public TableCell<ICFBamServerObjFuncObj, String> call(
                        TableColumn<ICFBamServerObjFuncObj, String> arg) {
                    return new CFStringTableCell<ICFBamServerObjFuncObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamServerObjFuncObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerObjFuncObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamServerObjFuncObj, String> p) {
                    ICFBamServerMethodObj 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<ICFBamServerObjFuncObj, String>, TableCell<ICFBamServerObjFuncObj, String>>() {
                @Override
                public TableCell<ICFBamServerObjFuncObj, String> call(
                        TableColumn<ICFBamServerObjFuncObj, String> arg) {
                    return new CFStringTableCell<ICFBamServerObjFuncObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamServerObjFuncObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerObjFuncObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamServerObjFuncObj, String> p) {
                    ICFBamServerMethodObj 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<ICFBamServerObjFuncObj, String>, TableCell<ICFBamServerObjFuncObj, String>>() {
                @Override
                public TableCell<ICFBamServerObjFuncObj, String> call(
                        TableColumn<ICFBamServerObjFuncObj, String> arg) {
                    return new CFStringTableCell<ICFBamServerObjFuncObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamServerObjFuncObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerObjFuncObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamServerObjFuncObj, String> p) {
                    ICFBamServerMethodObj 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<ICFBamServerObjFuncObj, String>, TableCell<ICFBamServerObjFuncObj, String>>() {
                @Override
                public TableCell<ICFBamServerObjFuncObj, String> call(
                        TableColumn<ICFBamServerObjFuncObj, String> arg) {
                    return new CFStringTableCell<ICFBamServerObjFuncObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamServerObjFuncObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerObjFuncObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamServerObjFuncObj, String> p) {
                    ICFBamServerMethodObj 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<ICFBamServerObjFuncObj, String>, TableCell<ICFBamServerObjFuncObj, String>>() {
                @Override
                public TableCell<ICFBamServerObjFuncObj, String> call(
                        TableColumn<ICFBamServerObjFuncObj, String> arg) {
                    return new CFStringTableCell<ICFBamServerObjFuncObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnSuffix = new TableColumn<ICFBamServerObjFuncObj, String>("Suffix");
    tableColumnSuffix.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerObjFuncObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamServerObjFuncObj, String> p) {
                    ICFBamServerMethodObj 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<ICFBamServerObjFuncObj, String>, TableCell<ICFBamServerObjFuncObj, String>>() {
                @Override
                public TableCell<ICFBamServerObjFuncObj, String> call(
                        TableColumn<ICFBamServerObjFuncObj, String> arg) {
                    return new CFStringTableCell<ICFBamServerObjFuncObj>();
                }
            });
    dataTable.getColumns().add(tableColumnSuffix);
    tableColumnDefaultVisibility = new TableColumn<ICFBamServerObjFuncObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerObjFuncObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamServerObjFuncObj, Boolean> p) {
                    ICFBamServerMethodObj 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<ICFBamServerObjFuncObj, Boolean>, TableCell<ICFBamServerObjFuncObj, Boolean>>() {
                @Override
                public TableCell<ICFBamServerObjFuncObj, Boolean> call(
                        TableColumn<ICFBamServerObjFuncObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamServerObjFuncObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnIsInstanceMethod = new TableColumn<ICFBamServerObjFuncObj, Boolean>("Is Instance Method");
    tableColumnIsInstanceMethod.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerObjFuncObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamServerObjFuncObj, Boolean> p) {
                    ICFBamServerMethodObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        boolean value = obj.getRequiredIsInstanceMethod();
                        Boolean wrapped = new Boolean(value);
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnIsInstanceMethod.setCellFactory(
            new Callback<TableColumn<ICFBamServerObjFuncObj, Boolean>, TableCell<ICFBamServerObjFuncObj, Boolean>>() {
                @Override
                public TableCell<ICFBamServerObjFuncObj, Boolean> call(
                        TableColumn<ICFBamServerObjFuncObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamServerObjFuncObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsInstanceMethod);
    tableColumnJMethodBody = new TableColumn<ICFBamServerObjFuncObj, String>("Java Method Body");
    tableColumnJMethodBody.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerObjFuncObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamServerObjFuncObj, String> p) {
                    ICFBamServerMethodObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getRequiredJMethodBody();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnJMethodBody.setCellFactory(
            new Callback<TableColumn<ICFBamServerObjFuncObj, String>, TableCell<ICFBamServerObjFuncObj, String>>() {
                @Override
                public TableCell<ICFBamServerObjFuncObj, String> call(
                        TableColumn<ICFBamServerObjFuncObj, String> arg) {
                    return new CFTextTableCell<ICFBamServerObjFuncObj>();
                }
            });
    dataTable.getColumns().add(tableColumnJMethodBody);
    tableColumnLookupDefSchema = new TableColumn<ICFBamServerObjFuncObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerObjFuncObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamServerObjFuncObj, ICFBamSchemaDefObj> p) {
                    ICFBamServerObjFuncObj 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<ICFBamServerObjFuncObj, ICFBamSchemaDefObj>, TableCell<ICFBamServerObjFuncObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamServerObjFuncObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamServerObjFuncObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamServerObjFuncObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    tableColumnLookupRetTable = new TableColumn<ICFBamServerObjFuncObj, ICFBamTableObj>("Ret Table");
    tableColumnLookupRetTable.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerObjFuncObj, ICFBamTableObj>, ObservableValue<ICFBamTableObj>>() {
                public ObservableValue<ICFBamTableObj> call(
                        CellDataFeatures<ICFBamServerObjFuncObj, ICFBamTableObj> p) {
                    ICFBamServerObjFuncObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamTableObj ref = obj.getOptionalLookupRetTable();
                        ReadOnlyObjectWrapper<ICFBamTableObj> observable = new ReadOnlyObjectWrapper<ICFBamTableObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupRetTable.setCellFactory(
            new Callback<TableColumn<ICFBamServerObjFuncObj, ICFBamTableObj>, TableCell<ICFBamServerObjFuncObj, ICFBamTableObj>>() {
                @Override
                public TableCell<ICFBamServerObjFuncObj, ICFBamTableObj> call(
                        TableColumn<ICFBamServerObjFuncObj, ICFBamTableObj> arg) {
                    return new CFReferenceTableCell<ICFBamServerObjFuncObj, ICFBamTableObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupRetTable);
    dataTable.getSelectionModel().selectedItemProperty()
            .addListener(new ChangeListener<ICFBamServerObjFuncObj>() {
                @Override
                public void changed(ObservableValue<? extends ICFBamServerObjFuncObj> observable,
                        ICFBamServerObjFuncObj oldValue, ICFBamServerObjFuncObj 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.choseServerObjFunc(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");
                }
                ICFBamServerObjFuncObj selectedInstance = getJavaFXFocusAsServerObjFunc();
                invokeWhenChosen.choseServerObjFunc(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.CFBamJavaFXServerListFuncPickerPane.java

public CFBamJavaFXServerListFuncPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamServerListFuncObj argFocus, ICFBamTableObj argContainer,
        Collection<ICFBamServerListFuncObj> argDataCollection, ICFBamJavaFXServerListFuncChosen whenChosen) {
    super();//from  w w w . j a  v  a2s .c  o  m
    final String S_ProcName = "construct-schema-focus";
    if (formManager == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "formManager");
    }
    cfFormManager = formManager;
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2,
                "argSchema");
    }
    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<ICFBamServerListFuncObj>();
    tableColumnId = new TableColumn<ICFBamServerListFuncObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerListFuncObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamServerListFuncObj, 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<ICFBamServerListFuncObj, Long>, TableCell<ICFBamServerListFuncObj, Long>>() {
                @Override
                public TableCell<ICFBamServerListFuncObj, Long> call(
                        TableColumn<ICFBamServerListFuncObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamServerListFuncObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamServerListFuncObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerListFuncObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamServerListFuncObj, String> p) {
                    ICFBamServerMethodObj 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<ICFBamServerListFuncObj, String>, TableCell<ICFBamServerListFuncObj, String>>() {
                @Override
                public TableCell<ICFBamServerListFuncObj, String> call(
                        TableColumn<ICFBamServerListFuncObj, String> arg) {
                    return new CFStringTableCell<ICFBamServerListFuncObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamServerListFuncObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerListFuncObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamServerListFuncObj, String> p) {
                    ICFBamServerMethodObj 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<ICFBamServerListFuncObj, String>, TableCell<ICFBamServerListFuncObj, String>>() {
                @Override
                public TableCell<ICFBamServerListFuncObj, String> call(
                        TableColumn<ICFBamServerListFuncObj, String> arg) {
                    return new CFStringTableCell<ICFBamServerListFuncObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamServerListFuncObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerListFuncObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamServerListFuncObj, String> p) {
                    ICFBamServerMethodObj 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<ICFBamServerListFuncObj, String>, TableCell<ICFBamServerListFuncObj, String>>() {
                @Override
                public TableCell<ICFBamServerListFuncObj, String> call(
                        TableColumn<ICFBamServerListFuncObj, String> arg) {
                    return new CFStringTableCell<ICFBamServerListFuncObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamServerListFuncObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerListFuncObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamServerListFuncObj, String> p) {
                    ICFBamServerMethodObj 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<ICFBamServerListFuncObj, String>, TableCell<ICFBamServerListFuncObj, String>>() {
                @Override
                public TableCell<ICFBamServerListFuncObj, String> call(
                        TableColumn<ICFBamServerListFuncObj, String> arg) {
                    return new CFStringTableCell<ICFBamServerListFuncObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamServerListFuncObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerListFuncObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamServerListFuncObj, String> p) {
                    ICFBamServerMethodObj 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<ICFBamServerListFuncObj, String>, TableCell<ICFBamServerListFuncObj, String>>() {
                @Override
                public TableCell<ICFBamServerListFuncObj, String> call(
                        TableColumn<ICFBamServerListFuncObj, String> arg) {
                    return new CFStringTableCell<ICFBamServerListFuncObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnSuffix = new TableColumn<ICFBamServerListFuncObj, String>("Suffix");
    tableColumnSuffix.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerListFuncObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamServerListFuncObj, String> p) {
                    ICFBamServerMethodObj 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<ICFBamServerListFuncObj, String>, TableCell<ICFBamServerListFuncObj, String>>() {
                @Override
                public TableCell<ICFBamServerListFuncObj, String> call(
                        TableColumn<ICFBamServerListFuncObj, String> arg) {
                    return new CFStringTableCell<ICFBamServerListFuncObj>();
                }
            });
    dataTable.getColumns().add(tableColumnSuffix);
    tableColumnDefaultVisibility = new TableColumn<ICFBamServerListFuncObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerListFuncObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamServerListFuncObj, Boolean> p) {
                    ICFBamServerMethodObj 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<ICFBamServerListFuncObj, Boolean>, TableCell<ICFBamServerListFuncObj, Boolean>>() {
                @Override
                public TableCell<ICFBamServerListFuncObj, Boolean> call(
                        TableColumn<ICFBamServerListFuncObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamServerListFuncObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnIsInstanceMethod = new TableColumn<ICFBamServerListFuncObj, Boolean>("Is Instance Method");
    tableColumnIsInstanceMethod.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerListFuncObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamServerListFuncObj, Boolean> p) {
                    ICFBamServerMethodObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        boolean value = obj.getRequiredIsInstanceMethod();
                        Boolean wrapped = new Boolean(value);
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnIsInstanceMethod.setCellFactory(
            new Callback<TableColumn<ICFBamServerListFuncObj, Boolean>, TableCell<ICFBamServerListFuncObj, Boolean>>() {
                @Override
                public TableCell<ICFBamServerListFuncObj, Boolean> call(
                        TableColumn<ICFBamServerListFuncObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamServerListFuncObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsInstanceMethod);
    tableColumnJMethodBody = new TableColumn<ICFBamServerListFuncObj, String>("Java Method Body");
    tableColumnJMethodBody.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerListFuncObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamServerListFuncObj, String> p) {
                    ICFBamServerMethodObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getRequiredJMethodBody();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnJMethodBody.setCellFactory(
            new Callback<TableColumn<ICFBamServerListFuncObj, String>, TableCell<ICFBamServerListFuncObj, String>>() {
                @Override
                public TableCell<ICFBamServerListFuncObj, String> call(
                        TableColumn<ICFBamServerListFuncObj, String> arg) {
                    return new CFTextTableCell<ICFBamServerListFuncObj>();
                }
            });
    dataTable.getColumns().add(tableColumnJMethodBody);
    tableColumnLookupDefSchema = new TableColumn<ICFBamServerListFuncObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerListFuncObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamServerListFuncObj, ICFBamSchemaDefObj> p) {
                    ICFBamServerListFuncObj 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<ICFBamServerListFuncObj, ICFBamSchemaDefObj>, TableCell<ICFBamServerListFuncObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamServerListFuncObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamServerListFuncObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamServerListFuncObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    tableColumnLookupRetTable = new TableColumn<ICFBamServerListFuncObj, ICFBamTableObj>("Ret Table");
    tableColumnLookupRetTable.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamServerListFuncObj, ICFBamTableObj>, ObservableValue<ICFBamTableObj>>() {
                public ObservableValue<ICFBamTableObj> call(
                        CellDataFeatures<ICFBamServerListFuncObj, ICFBamTableObj> p) {
                    ICFBamServerListFuncObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamTableObj ref = obj.getOptionalLookupRetTable();
                        ReadOnlyObjectWrapper<ICFBamTableObj> observable = new ReadOnlyObjectWrapper<ICFBamTableObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupRetTable.setCellFactory(
            new Callback<TableColumn<ICFBamServerListFuncObj, ICFBamTableObj>, TableCell<ICFBamServerListFuncObj, ICFBamTableObj>>() {
                @Override
                public TableCell<ICFBamServerListFuncObj, ICFBamTableObj> call(
                        TableColumn<ICFBamServerListFuncObj, ICFBamTableObj> arg) {
                    return new CFReferenceTableCell<ICFBamServerListFuncObj, ICFBamTableObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupRetTable);
    dataTable.getSelectionModel().selectedItemProperty()
            .addListener(new ChangeListener<ICFBamServerListFuncObj>() {
                @Override
                public void changed(ObservableValue<? extends ICFBamServerListFuncObj> observable,
                        ICFBamServerListFuncObj oldValue, ICFBamServerListFuncObj 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.choseServerListFunc(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");
                }
                ICFBamServerListFuncObj selectedInstance = getJavaFXFocusAsServerListFunc();
                invokeWhenChosen.choseServerListFunc(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);
}