Example usage for javafx.beans.value ChangeListener ChangeListener

List of usage examples for javafx.beans.value ChangeListener ChangeListener

Introduction

In this page you can find the example usage for javafx.beans.value ChangeListener ChangeListener.

Prototype

ChangeListener

Source Link

Usage

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

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

    scrollMenu = new ScrollPane();
    scrollMenu.setVbarPolicy(ScrollBarPolicy.NEVER);
    scrollMenu.setHbarPolicy(ScrollBarPolicy.AS_NEEDED);
    scrollMenu.setFitToHeight(true);
    scrollMenu.setContent(getPanelHBoxMenu());

    setTop(scrollMenu);
    setCenter(dataTable);
    javafxIsInitializing = false;
    if (observableListOfBlobDef != null) {
        dataTable.setItems(observableListOfBlobDef);
    }
    adjustListButtons();
}

From source file:dsfixgui.view.DSFGraphicsPane.java

private void initializeEventHandlers() {

    applySettingsButton.setOnAction(e -> {
        ui.applyDSFConfig();//from   w  w w.  j  a va 2s .co  m
    });

    restoreDefaultsButton.setOnAction(e -> {
        ContinueDialog cD = new ContinueDialog(300.0, 80.0, DIALOG_TITLE_RESET, DIALOG_MSG_RESTORE_SETTINGS,
                DIALOG_BUTTON_TEXTS[2], DIALOG_BUTTON_TEXTS[1]);

        if (cD.show()) {
            config.restoreDefaultGraphicsOptions();
            ui.refreshUI();
        }
    });

    renderWidthField.textProperty().addListener(new ChangeListener<String>() {
        @Override
        public void changed(ObservableValue<? extends String> observable, String oldText, String newText) {
            try {
                if (!NumberUtils.isParsable(newText)
                        || (NumberUtils.isParsable(newText) && Integer.parseInt(newText) < 1)) {
                    renderWidthField.pseudoClassStateChanged(INVALID_INPUT, true);
                    renderWidthField.setTooltip(new Tooltip(POSITIVE_INTEGER));
                } else if (Integer.parseInt(newText) >= 1280) {
                    if (NumberUtils.isParsable(presentWidthField.getText())
                            && (Integer.parseInt(newText) == Integer.parseInt(presentWidthField.getText()))) {
                        renderWidthField.pseudoClassStateChanged(INVALID_INPUT, true);
                        renderWidthField.setTooltip(new Tooltip(SAME_RESOLUTIONS));
                    } else {
                        renderWidthField.pseudoClassStateChanged(INVALID_INPUT, false);
                        renderWidthField.setTooltip(new Tooltip(""));
                        config.setRenderWidth(Integer.parseInt(newText));
                        if (config.disableDOF) {
                            config.setPresentWidth(Integer.parseInt(newText));
                        }
                    }
                    //If input is a positive integer that is less than 1280, present width comes into play
                } else if (NumberUtils.isParsable(presentWidthField.getText())
                        && Integer.parseInt(presentWidthField.getText()) >= 1280) {
                    renderWidthField.pseudoClassStateChanged(INVALID_INPUT, false);
                    renderWidthField.setTooltip(new Tooltip(""));
                    config.setRenderWidth(Integer.parseInt(newText));
                } else {
                    renderWidthField.pseudoClassStateChanged(INVALID_INPUT, true);
                    renderWidthField.setTooltip(new Tooltip(PRES_WIDTH_TOO_LOW));
                }
                recheckTextInput(presentWidthField);
            } catch (NumberFormatException nFE) {
                config.setRenderWidth(1920);
                ui.printConsole(INPUT_TOO_LARGE);
                renderWidthField.setText("");
                renderWidthField.appendText(config.getRenderWidth() + "");
            }

        }
    });

    renderHeightField.textProperty().addListener(new ChangeListener<String>() {
        @Override
        public void changed(ObservableValue<? extends String> observable, String oldText, String newText) {
            try {
                if (!NumberUtils.isParsable(newText)
                        || (NumberUtils.isParsable(newText) && Integer.parseInt(newText) < 1)) {
                    renderHeightField.pseudoClassStateChanged(INVALID_INPUT, true);
                    renderHeightField.setTooltip(new Tooltip(POSITIVE_INTEGER));
                } else if (Integer.parseInt(newText) >= 720) {
                    if (NumberUtils.isParsable(presentHeightField.getText())
                            && (Integer.parseInt(newText) == Integer.parseInt(presentHeightField.getText()))) {
                        renderHeightField.pseudoClassStateChanged(INVALID_INPUT, true);
                        renderHeightField.setTooltip(new Tooltip(SAME_RESOLUTIONS));
                    } else {
                        renderHeightField.pseudoClassStateChanged(INVALID_INPUT, false);
                        renderHeightField.setTooltip(new Tooltip(""));
                        config.setRenderHeight(Integer.parseInt(newText));
                        if (config.disableDOF) {
                            config.setPresentHeight(Integer.parseInt(newText));
                            config.setDOFOverride(Integer.parseInt(newText));
                        }
                    }
                    //If input is a positive integer that is less than 720, present height comes into play
                } else if (NumberUtils.isParsable(presentHeightField.getText())
                        && Integer.parseInt(presentHeightField.getText()) >= 720) {
                    renderHeightField.pseudoClassStateChanged(INVALID_INPUT, false);
                    renderHeightField.setTooltip(new Tooltip(""));
                    config.setRenderHeight(Integer.parseInt(newText));
                } else {
                    renderHeightField.pseudoClassStateChanged(INVALID_INPUT, true);
                    renderHeightField.setTooltip(new Tooltip(PRES_HEIGHT_TOO_LOW));
                }
                recheckTextInput(presentHeightField);
            } catch (NumberFormatException nFE) {
                config.setRenderHeight(1080);
                ui.printConsole(INPUT_TOO_LARGE);
                renderHeightField.setText("");
                renderHeightField.appendText(config.getRenderHeight() + "");
            }
        }
    });

    setWindowsRenderRes.setOnAction(e -> {
        renderWidthField.setText("");
        renderHeightField.setText("");
        renderWidthField.appendText((int) Toolkit.getDefaultToolkit().getScreenSize().getWidth() + "");
        renderHeightField.appendText((int) Toolkit.getDefaultToolkit().getScreenSize().getHeight() + "");
    });

    presentWidthField.textProperty().addListener(new ChangeListener<String>() {
        @Override
        public void changed(ObservableValue<? extends String> observable, String oldText, String newText) {
            try {
                if (!NumberUtils.isParsable(newText)
                        || (NumberUtils.isParsable(newText) && Integer.parseInt(newText) < 1)) {
                    presentWidthField.pseudoClassStateChanged(INVALID_INPUT, true);
                    presentWidthField.setTooltip(new Tooltip(POSITIVE_INTEGER));
                } else if (Integer.parseInt(newText) < 1280) {
                    presentWidthField.pseudoClassStateChanged(INVALID_INPUT, true);
                    presentWidthField.setTooltip(new Tooltip(INPUT_GREATER_THAN + 1280));
                } else if (Integer.parseInt(newText) >= 1280) {
                    if (NumberUtils.isParsable(renderWidthField.getText())
                            && (Integer.parseInt(newText) == Integer.parseInt(renderWidthField.getText()))) {
                        presentWidthField.pseudoClassStateChanged(INVALID_INPUT, true);
                        presentWidthField.setTooltip(new Tooltip(SAME_RESOLUTIONS));
                    } else {
                        presentWidthField.pseudoClassStateChanged(INVALID_INPUT, false);
                        presentWidthField.setTooltip(null);
                        config.setPresentWidth(Integer.parseInt(newText));
                    }
                }
                recheckTextInput(renderWidthField);
            } catch (NumberFormatException nFE) {
                config.setPresentWidth(0);
                ui.printConsole(INPUT_TOO_LARGE);
                presentWidthField.setText("");
                presentWidthField.appendText(config.getPresentWidth() + "");
            }
        }
    });

    presentHeightField.textProperty().addListener(new ChangeListener<String>() {
        @Override
        public void changed(ObservableValue<? extends String> observable, String oldText, String newText) {
            try {
                if (!NumberUtils.isParsable(newText)
                        || (NumberUtils.isParsable(newText) && Integer.parseInt(newText) < 1)) {
                    presentHeightField.pseudoClassStateChanged(INVALID_INPUT, true);
                    presentHeightField.setTooltip(new Tooltip(POSITIVE_INTEGER));
                } else if (Integer.parseInt(newText) < 720) {
                    presentHeightField.pseudoClassStateChanged(INVALID_INPUT, true);
                    presentHeightField.setTooltip(new Tooltip(INPUT_GREATER_THAN + 720));
                } else if (Integer.parseInt(newText) >= 720) {
                    if (NumberUtils.isParsable(renderHeightField.getText())
                            && (Integer.parseInt(newText) == Integer.parseInt(renderHeightField.getText()))) {
                        presentHeightField.pseudoClassStateChanged(INVALID_INPUT, true);
                        presentHeightField.setTooltip(new Tooltip(SAME_RESOLUTIONS));
                    } else {
                        presentHeightField.pseudoClassStateChanged(INVALID_INPUT, false);
                        presentHeightField.setTooltip(null);
                        config.setPresentHeight(Integer.parseInt(newText));
                    }
                }
                recheckTextInput(renderHeightField);
            } catch (NumberFormatException nFE) {
                config.setPresentHeight(0);
                ui.printConsole(INPUT_TOO_LARGE);
                presentHeightField.setText("");
                presentHeightField.appendText(config.getPresentHeight() + "");
            }
        }
    });

    setWindowsPresentRes.setOnAction(e -> {
        presentWidthField.setText("");
        presentHeightField.setText("");
        presentWidthField.appendText((int) Toolkit.getDefaultToolkit().getScreenSize().getWidth() + "");
        presentHeightField.appendText((int) Toolkit.getDefaultToolkit().getScreenSize().getHeight() + "");
    });

    usePresentRes.setOnAction(e -> {

        presentWidthField.setDisable(false);
        presentHeightField.setDisable(false);
        setWindowsPresentRes.setDisable(false);
        presentWidthField.setText(presentRes[0]);
        presentHeightField.setText(presentRes[1]);
        recheckTextInput(presentWidthField);
        recheckTextInput(presentHeightField);
        recheckTextInput(renderWidthField);
        recheckTextInput(renderHeightField);
    });

    dontUsePresentRes.setOnAction(e -> {
        presentWidthField.setDisable(true);
        presentHeightField.setDisable(true);
        setWindowsPresentRes.setDisable(true);
        config.setPresentWidth(0);
        config.setPresentHeight(0);
        presentRes[0] = presentWidthField.getText();
        presentRes[1] = presentHeightField.getText();
        presentWidthField.setText(config.getPresentWidth() + "");
        presentHeightField.setText(config.getPresentHeight() + "");
        recheckTextInput(renderWidthField);
        recheckTextInput(renderHeightField);
        presentWidthField.pseudoClassStateChanged(INVALID_INPUT, false);
        presentWidthField.setTooltip(null);
        presentHeightField.pseudoClassStateChanged(INVALID_INPUT, false);
        presentHeightField.setTooltip(null);

    });

    aaQualityPicker.setOnAction(e -> {
        if (aaQualityPicker.getValue().equals(AAQUALITIES[0])) {
            config.aaQuality.set(0);
            aaTypePicker.setDisable(true);
        } else {
            aaTypePicker.setDisable(false);
            config.aaQuality.set(aaQualityPicker.getItems().indexOf(aaQualityPicker.getValue()));
        }
    });

    aaTypePicker.setOnAction(e -> {
        config.aaType.replace(0, config.aaType.length(), aaTypePicker.getValue());
    });

    ssaoStrengthPicker.setOnAction(e -> {
        if (ssaoStrengthPicker.getValue().equals(SSAOSTRENGTHS[0])) {
            config.ssaoStrength.set(0);
            ssaoScalePicker.setDisable(true);
            ssaoTypePicker.setDisable(true);
        } else {
            ssaoScalePicker.setDisable(false);
            ssaoTypePicker.setDisable(false);
            config.ssaoStrength.set(ssaoStrengthPicker.getItems().indexOf(ssaoStrengthPicker.getValue()));
        }
    });

    ssaoScalePicker.setOnAction(e -> {
        config.ssaoScale.set(ssaoScalePicker.getItems().indexOf(ssaoScalePicker.getValue()) + 1);
    });

    ssaoTypePicker.setOnAction(e -> {
        config.ssaoType.replace(0, config.ssaoType.length(), ssaoTypePicker.getValue());
    });

    //DOF Override picker is a special case with its own method
    setDOFOverrideEventHandler();

    dofScalingEnabled.setOnAction(e -> {
        config.disableDofScaling.set(0);
    });

    dofScalingDisabled.setOnAction(e -> {
        config.disableDofScaling.set(1);
    });

    dofAddPicker.setOnAction(e -> {
        config.dofBlurAmount.replace(0, config.dofBlurAmount.length(),
                DOF_ADDITIONAL_BLUR_OPTIONS[dofAddPicker.getItems().indexOf(dofAddPicker.getValue())]);
    });

    fpsLocked.setOnAction(e -> {
        config.unlockFPS.set(0);
        fpsLimitField.setDisable(true);
        recheckTextInput(fpsLimitField);
    });

    fpsUnlocked.setOnAction(e -> {
        config.unlockFPS.set(1);
        fpsLimitField.setDisable(false);
        recheckTextInput(fpsLimitField);
    });

    fpsFixKeyPicker.setOnAction(e -> {
        String fpsFixKeyNew = FPS_FIX_KEYS_HEX[FPS_FIX_KEYS_ARRAY_LIST.indexOf(fpsFixKeyPicker.getValue())]
                .substring(2);
        setFPSFixKey(fpsFixKeyNew);
        fpsFixKey = FPS_FIX_KEYS_HEX[FPS_FIX_KEYS_ARRAY_LIST.indexOf(fpsFixKeyPicker.getValue())].substring(2);
    });

    fpsLimitField.textProperty().addListener(new ChangeListener<String>() {
        @Override
        public void changed(ObservableValue<? extends String> observable, String oldText, String newText) {
            try {
                if (!NumberUtils.isParsable(newText) || Integer.parseInt(newText) < 1) {
                    fpsLimitField.pseudoClassStateChanged(INVALID_INPUT, true);
                    fpsLimitField.setTooltip(new Tooltip(POSITIVE_INTEGER));
                } else if (Integer.parseInt(newText) > 70) {
                    fpsLimitField.pseudoClassStateChanged(INVALID_INPUT, true);
                    fpsLimitField.setTooltip(new Tooltip(INPUT_FPS_TOO_HIGH));
                } else {
                    fpsLimitField.pseudoClassStateChanged(INVALID_INPUT, false);
                    fpsLimitField.setTooltip(
                            new Tooltip(FPS_LIMIT_LABEL.substring(0, FPS_LIMIT_LABEL.length() - 2)));
                    config.FPSlimit.set(Integer.parseInt(newText));
                }
            } catch (NumberFormatException nFE) {
                ui.printConsole(INPUT_TOO_LARGE);
                fpsLimitField.setText("");
            }
        }
    });

    fpsThresholdField.textProperty().addListener(new ChangeListener<String>() {
        @Override
        public void changed(ObservableValue<? extends String> observable, String oldText, String newText) {
            try {
                if (!NumberUtils.isParsable(newText) || Integer.parseInt(newText) < 1) {
                    fpsThresholdField.pseudoClassStateChanged(INVALID_INPUT, true);
                    fpsThresholdField.setTooltip(new Tooltip(POSITIVE_INTEGER));
                } else {
                    fpsThresholdField.pseudoClassStateChanged(INVALID_INPUT, false);
                    fpsThresholdField.setTooltip(
                            new Tooltip(FPS_LIMIT_LABEL.substring(0, FPS_LIMIT_LABEL.length() - 2)));
                    config.FPSthreshold.set(Integer.parseInt(newText));
                }
            } catch (NumberFormatException nFE) {
                ui.printConsole(INPUT_TOO_LARGE);
                fpsThresholdField.setText("");
            }
        }
    });

    texOverridePicker.setOnAction(e -> {
        config.filteringOverride.set(texOverridePicker.getItems().indexOf(texOverridePicker.getValue()));
    });
}

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

public CFBamJavaFXUuidColPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamUuidColObj argFocus, ICFBamTableObj argContainer, Collection<ICFBamUuidColObj> argDataCollection,
        ICFBamJavaFXUuidColChosen whenChosen) {
    super();//w  ww .ja  va  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<ICFBamUuidColObj>();
    tableColumnId = new TableColumn<ICFBamUuidColObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUuidColObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, Long>, TableCell<ICFBamUuidColObj, Long>>() {
                @Override
                public TableCell<ICFBamUuidColObj, Long> call(TableColumn<ICFBamUuidColObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamUuidColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamUuidColObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUuidColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, String>, TableCell<ICFBamUuidColObj, String>>() {
                @Override
                public TableCell<ICFBamUuidColObj, String> call(TableColumn<ICFBamUuidColObj, String> arg) {
                    return new CFStringTableCell<ICFBamUuidColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamUuidColObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUuidColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, String>, TableCell<ICFBamUuidColObj, String>>() {
                @Override
                public TableCell<ICFBamUuidColObj, String> call(TableColumn<ICFBamUuidColObj, String> arg) {
                    return new CFStringTableCell<ICFBamUuidColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamUuidColObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUuidColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, String>, TableCell<ICFBamUuidColObj, String>>() {
                @Override
                public TableCell<ICFBamUuidColObj, String> call(TableColumn<ICFBamUuidColObj, String> arg) {
                    return new CFStringTableCell<ICFBamUuidColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamUuidColObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUuidColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, String>, TableCell<ICFBamUuidColObj, String>>() {
                @Override
                public TableCell<ICFBamUuidColObj, String> call(TableColumn<ICFBamUuidColObj, String> arg) {
                    return new CFStringTableCell<ICFBamUuidColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamUuidColObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUuidColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, String>, TableCell<ICFBamUuidColObj, String>>() {
                @Override
                public TableCell<ICFBamUuidColObj, String> call(TableColumn<ICFBamUuidColObj, String> arg) {
                    return new CFStringTableCell<ICFBamUuidColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnIsNullable = new TableColumn<ICFBamUuidColObj, Boolean>("Is Nullable");
    tableColumnIsNullable.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUuidColObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, Boolean>, TableCell<ICFBamUuidColObj, Boolean>>() {
                @Override
                public TableCell<ICFBamUuidColObj, Boolean> call(TableColumn<ICFBamUuidColObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamUuidColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsNullable);
    tableColumnGenerateId = new TableColumn<ICFBamUuidColObj, Boolean>("Generate Id");
    tableColumnGenerateId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUuidColObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, Boolean>, TableCell<ICFBamUuidColObj, Boolean>>() {
                @Override
                public TableCell<ICFBamUuidColObj, Boolean> call(TableColumn<ICFBamUuidColObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamUuidColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnGenerateId);
    tableColumnDefaultVisibility = new TableColumn<ICFBamUuidColObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUuidColObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, Boolean>, TableCell<ICFBamUuidColObj, Boolean>>() {
                @Override
                public TableCell<ICFBamUuidColObj, Boolean> call(TableColumn<ICFBamUuidColObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamUuidColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnDbName = new TableColumn<ICFBamUuidColObj, String>("Db Name");
    tableColumnDbName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUuidColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, String>, TableCell<ICFBamUuidColObj, String>>() {
                @Override
                public TableCell<ICFBamUuidColObj, String> call(TableColumn<ICFBamUuidColObj, String> arg) {
                    return new CFStringTableCell<ICFBamUuidColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDbName);
    tableColumnInitValue = new TableColumn<ICFBamUuidColObj, UUID>("Init. Value");
    tableColumnInitValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUuidColObj, UUID>, ObservableValue<UUID>>() {
                public ObservableValue<UUID> call(CellDataFeatures<ICFBamUuidColObj, UUID> p) {
                    ICFBamUuidDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        UUID value = obj.getOptionalInitValue();
                        ReadOnlyObjectWrapper<UUID> observable = new ReadOnlyObjectWrapper<UUID>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnInitValue.setCellFactory(
            new Callback<TableColumn<ICFBamUuidColObj, UUID>, TableCell<ICFBamUuidColObj, UUID>>() {
                @Override
                public TableCell<ICFBamUuidColObj, UUID> call(TableColumn<ICFBamUuidColObj, UUID> arg) {
                    return new CFUuidTableCell<ICFBamUuidColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnInitValue);
    tableColumnDefaultValue = new TableColumn<ICFBamUuidColObj, UUID>("Default Value");
    tableColumnDefaultValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUuidColObj, UUID>, ObservableValue<UUID>>() {
                public ObservableValue<UUID> call(CellDataFeatures<ICFBamUuidColObj, UUID> p) {
                    ICFBamUuidDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        UUID value = obj.getOptionalDefaultValue();
                        ReadOnlyObjectWrapper<UUID> observable = new ReadOnlyObjectWrapper<UUID>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDefaultValue.setCellFactory(
            new Callback<TableColumn<ICFBamUuidColObj, UUID>, TableCell<ICFBamUuidColObj, UUID>>() {
                @Override
                public TableCell<ICFBamUuidColObj, UUID> call(TableColumn<ICFBamUuidColObj, UUID> arg) {
                    return new CFUuidTableCell<ICFBamUuidColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultValue);
    tableColumnNullValue = new TableColumn<ICFBamUuidColObj, UUID>("Null Value");
    tableColumnNullValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUuidColObj, UUID>, ObservableValue<UUID>>() {
                public ObservableValue<UUID> call(CellDataFeatures<ICFBamUuidColObj, UUID> p) {
                    ICFBamUuidDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        UUID value = obj.getOptionalNullValue();
                        ReadOnlyObjectWrapper<UUID> observable = new ReadOnlyObjectWrapper<UUID>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnNullValue.setCellFactory(
            new Callback<TableColumn<ICFBamUuidColObj, UUID>, TableCell<ICFBamUuidColObj, UUID>>() {
                @Override
                public TableCell<ICFBamUuidColObj, UUID> call(TableColumn<ICFBamUuidColObj, UUID> arg) {
                    return new CFUuidTableCell<ICFBamUuidColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnNullValue);
    tableColumnUnknownValue = new TableColumn<ICFBamUuidColObj, UUID>("Unknown Value");
    tableColumnUnknownValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUuidColObj, UUID>, ObservableValue<UUID>>() {
                public ObservableValue<UUID> call(CellDataFeatures<ICFBamUuidColObj, UUID> p) {
                    ICFBamUuidDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        UUID value = obj.getOptionalUnknownValue();
                        ReadOnlyObjectWrapper<UUID> observable = new ReadOnlyObjectWrapper<UUID>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnUnknownValue.setCellFactory(
            new Callback<TableColumn<ICFBamUuidColObj, UUID>, TableCell<ICFBamUuidColObj, UUID>>() {
                @Override
                public TableCell<ICFBamUuidColObj, UUID> call(TableColumn<ICFBamUuidColObj, UUID> arg) {
                    return new CFUuidTableCell<ICFBamUuidColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnUnknownValue);
    tableColumnLookupDefSchema = new TableColumn<ICFBamUuidColObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUuidColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamUuidColObj, ICFBamSchemaDefObj> p) {
                    ICFBamUuidColObj 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<ICFBamUuidColObj, ICFBamSchemaDefObj>, TableCell<ICFBamUuidColObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamUuidColObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamUuidColObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamUuidColObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamUuidColObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamUuidColObj> observable, ICFBamUuidColObj oldValue,
                ICFBamUuidColObj 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.choseUuidCol(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");
                }
                ICFBamUuidColObj selectedInstance = getJavaFXFocusAsUuidCol();
                invokeWhenChosen.choseUuidCol(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.CFBamJavaFXTimeColPickerPane.java

public CFBamJavaFXTimeColPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamTimeColObj argFocus, ICFBamTableObj argContainer, Collection<ICFBamTimeColObj> argDataCollection,
        ICFBamJavaFXTimeColChosen whenChosen) {
    super();//from www.  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<ICFBamTimeColObj>();
    tableColumnId = new TableColumn<ICFBamTimeColObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimeColObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamTimeColObj, 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<ICFBamTimeColObj, Long>, TableCell<ICFBamTimeColObj, Long>>() {
                @Override
                public TableCell<ICFBamTimeColObj, Long> call(TableColumn<ICFBamTimeColObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamTimeColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamTimeColObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimeColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTimeColObj, 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<ICFBamTimeColObj, String>, TableCell<ICFBamTimeColObj, String>>() {
                @Override
                public TableCell<ICFBamTimeColObj, String> call(TableColumn<ICFBamTimeColObj, String> arg) {
                    return new CFStringTableCell<ICFBamTimeColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamTimeColObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimeColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTimeColObj, 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<ICFBamTimeColObj, String>, TableCell<ICFBamTimeColObj, String>>() {
                @Override
                public TableCell<ICFBamTimeColObj, String> call(TableColumn<ICFBamTimeColObj, String> arg) {
                    return new CFStringTableCell<ICFBamTimeColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamTimeColObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimeColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTimeColObj, 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<ICFBamTimeColObj, String>, TableCell<ICFBamTimeColObj, String>>() {
                @Override
                public TableCell<ICFBamTimeColObj, String> call(TableColumn<ICFBamTimeColObj, String> arg) {
                    return new CFStringTableCell<ICFBamTimeColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamTimeColObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimeColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTimeColObj, 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<ICFBamTimeColObj, String>, TableCell<ICFBamTimeColObj, String>>() {
                @Override
                public TableCell<ICFBamTimeColObj, String> call(TableColumn<ICFBamTimeColObj, String> arg) {
                    return new CFStringTableCell<ICFBamTimeColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamTimeColObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimeColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTimeColObj, 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<ICFBamTimeColObj, String>, TableCell<ICFBamTimeColObj, String>>() {
                @Override
                public TableCell<ICFBamTimeColObj, String> call(TableColumn<ICFBamTimeColObj, String> arg) {
                    return new CFStringTableCell<ICFBamTimeColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnIsNullable = new TableColumn<ICFBamTimeColObj, Boolean>("Is Nullable");
    tableColumnIsNullable.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimeColObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimeColObj, 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<ICFBamTimeColObj, Boolean>, TableCell<ICFBamTimeColObj, Boolean>>() {
                @Override
                public TableCell<ICFBamTimeColObj, Boolean> call(TableColumn<ICFBamTimeColObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamTimeColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsNullable);
    tableColumnGenerateId = new TableColumn<ICFBamTimeColObj, Boolean>("Generate Id");
    tableColumnGenerateId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimeColObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimeColObj, 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<ICFBamTimeColObj, Boolean>, TableCell<ICFBamTimeColObj, Boolean>>() {
                @Override
                public TableCell<ICFBamTimeColObj, Boolean> call(TableColumn<ICFBamTimeColObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamTimeColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnGenerateId);
    tableColumnDefaultVisibility = new TableColumn<ICFBamTimeColObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimeColObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimeColObj, 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<ICFBamTimeColObj, Boolean>, TableCell<ICFBamTimeColObj, Boolean>>() {
                @Override
                public TableCell<ICFBamTimeColObj, Boolean> call(TableColumn<ICFBamTimeColObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamTimeColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnDbName = new TableColumn<ICFBamTimeColObj, String>("Db Name");
    tableColumnDbName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimeColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTimeColObj, 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<ICFBamTimeColObj, String>, TableCell<ICFBamTimeColObj, String>>() {
                @Override
                public TableCell<ICFBamTimeColObj, String> call(TableColumn<ICFBamTimeColObj, String> arg) {
                    return new CFStringTableCell<ICFBamTimeColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDbName);
    tableColumnInitValue = new TableColumn<ICFBamTimeColObj, Calendar>("Init. Value");
    tableColumnInitValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimeColObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimeColObj, Calendar> p) {
                    ICFBamTimeDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Calendar value = obj.getOptionalInitValue();
                        ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnInitValue.setCellFactory(
            new Callback<TableColumn<ICFBamTimeColObj, Calendar>, TableCell<ICFBamTimeColObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTimeColObj, Calendar> call(TableColumn<ICFBamTimeColObj, Calendar> arg) {
                    return new CFTimeTableCell<ICFBamTimeColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnInitValue);
    tableColumnDefaultValue = new TableColumn<ICFBamTimeColObj, Calendar>("Default Value");
    tableColumnDefaultValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimeColObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimeColObj, Calendar> p) {
                    ICFBamTimeDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Calendar value = obj.getOptionalDefaultValue();
                        ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDefaultValue.setCellFactory(
            new Callback<TableColumn<ICFBamTimeColObj, Calendar>, TableCell<ICFBamTimeColObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTimeColObj, Calendar> call(TableColumn<ICFBamTimeColObj, Calendar> arg) {
                    return new CFTimeTableCell<ICFBamTimeColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultValue);
    tableColumnNullValue = new TableColumn<ICFBamTimeColObj, Calendar>("Null Value");
    tableColumnNullValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimeColObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimeColObj, Calendar> p) {
                    ICFBamTimeDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Calendar value = obj.getOptionalNullValue();
                        ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnNullValue.setCellFactory(
            new Callback<TableColumn<ICFBamTimeColObj, Calendar>, TableCell<ICFBamTimeColObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTimeColObj, Calendar> call(TableColumn<ICFBamTimeColObj, Calendar> arg) {
                    return new CFTimeTableCell<ICFBamTimeColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnNullValue);
    tableColumnUnknownValue = new TableColumn<ICFBamTimeColObj, Calendar>("Unknown Value");
    tableColumnUnknownValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimeColObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimeColObj, Calendar> p) {
                    ICFBamTimeDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Calendar value = obj.getOptionalUnknownValue();
                        ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnUnknownValue.setCellFactory(
            new Callback<TableColumn<ICFBamTimeColObj, Calendar>, TableCell<ICFBamTimeColObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTimeColObj, Calendar> call(TableColumn<ICFBamTimeColObj, Calendar> arg) {
                    return new CFTimeTableCell<ICFBamTimeColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnUnknownValue);
    tableColumnLookupDefSchema = new TableColumn<ICFBamTimeColObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimeColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamTimeColObj, ICFBamSchemaDefObj> p) {
                    ICFBamTimeColObj 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<ICFBamTimeColObj, ICFBamSchemaDefObj>, TableCell<ICFBamTimeColObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamTimeColObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamTimeColObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamTimeColObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamTimeColObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamTimeColObj> observable, ICFBamTimeColObj oldValue,
                ICFBamTimeColObj 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.choseTimeCol(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");
                }
                ICFBamTimeColObj selectedInstance = getJavaFXFocusAsTimeCol();
                invokeWhenChosen.choseTimeCol(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.CFBamJavaFXTimeTypePickerPane.java

public CFBamJavaFXTimeTypePickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamTimeTypeObj argFocus, ICFBamSchemaDefObj argContainer,
        Collection<ICFBamTimeTypeObj> argDataCollection, ICFBamJavaFXTimeTypeChosen whenChosen) {
    super();/*from w  w w  .ja  va2  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<ICFBamTimeTypeObj>();
    tableColumnId = new TableColumn<ICFBamTimeTypeObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimeTypeObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamTimeTypeObj, 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<ICFBamTimeTypeObj, Long>, TableCell<ICFBamTimeTypeObj, Long>>() {
                @Override
                public TableCell<ICFBamTimeTypeObj, Long> call(TableColumn<ICFBamTimeTypeObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamTimeTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamTimeTypeObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimeTypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTimeTypeObj, 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<ICFBamTimeTypeObj, String>, TableCell<ICFBamTimeTypeObj, String>>() {
                @Override
                public TableCell<ICFBamTimeTypeObj, String> call(TableColumn<ICFBamTimeTypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamTimeTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamTimeTypeObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimeTypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTimeTypeObj, 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<ICFBamTimeTypeObj, String>, TableCell<ICFBamTimeTypeObj, String>>() {
                @Override
                public TableCell<ICFBamTimeTypeObj, String> call(TableColumn<ICFBamTimeTypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamTimeTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamTimeTypeObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimeTypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTimeTypeObj, 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<ICFBamTimeTypeObj, String>, TableCell<ICFBamTimeTypeObj, String>>() {
                @Override
                public TableCell<ICFBamTimeTypeObj, String> call(TableColumn<ICFBamTimeTypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamTimeTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamTimeTypeObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimeTypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTimeTypeObj, 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<ICFBamTimeTypeObj, String>, TableCell<ICFBamTimeTypeObj, String>>() {
                @Override
                public TableCell<ICFBamTimeTypeObj, String> call(TableColumn<ICFBamTimeTypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamTimeTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamTimeTypeObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimeTypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTimeTypeObj, 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<ICFBamTimeTypeObj, String>, TableCell<ICFBamTimeTypeObj, String>>() {
                @Override
                public TableCell<ICFBamTimeTypeObj, String> call(TableColumn<ICFBamTimeTypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamTimeTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnIsNullable = new TableColumn<ICFBamTimeTypeObj, Boolean>("Is Nullable");
    tableColumnIsNullable.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimeTypeObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimeTypeObj, 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<ICFBamTimeTypeObj, Boolean>, TableCell<ICFBamTimeTypeObj, Boolean>>() {
                @Override
                public TableCell<ICFBamTimeTypeObj, Boolean> call(TableColumn<ICFBamTimeTypeObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamTimeTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsNullable);
    tableColumnGenerateId = new TableColumn<ICFBamTimeTypeObj, Boolean>("Generate Id");
    tableColumnGenerateId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimeTypeObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimeTypeObj, 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<ICFBamTimeTypeObj, Boolean>, TableCell<ICFBamTimeTypeObj, Boolean>>() {
                @Override
                public TableCell<ICFBamTimeTypeObj, Boolean> call(TableColumn<ICFBamTimeTypeObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamTimeTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnGenerateId);
    tableColumnDefaultVisibility = new TableColumn<ICFBamTimeTypeObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimeTypeObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTimeTypeObj, 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<ICFBamTimeTypeObj, Boolean>, TableCell<ICFBamTimeTypeObj, Boolean>>() {
                @Override
                public TableCell<ICFBamTimeTypeObj, Boolean> call(TableColumn<ICFBamTimeTypeObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamTimeTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnDbName = new TableColumn<ICFBamTimeTypeObj, String>("Db Name");
    tableColumnDbName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimeTypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTimeTypeObj, 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<ICFBamTimeTypeObj, String>, TableCell<ICFBamTimeTypeObj, String>>() {
                @Override
                public TableCell<ICFBamTimeTypeObj, String> call(TableColumn<ICFBamTimeTypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamTimeTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDbName);
    tableColumnInitValue = new TableColumn<ICFBamTimeTypeObj, Calendar>("Init. Value");
    tableColumnInitValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimeTypeObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimeTypeObj, Calendar> p) {
                    ICFBamTimeDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Calendar value = obj.getOptionalInitValue();
                        ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnInitValue.setCellFactory(
            new Callback<TableColumn<ICFBamTimeTypeObj, Calendar>, TableCell<ICFBamTimeTypeObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTimeTypeObj, Calendar> call(
                        TableColumn<ICFBamTimeTypeObj, Calendar> arg) {
                    return new CFTimeTableCell<ICFBamTimeTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnInitValue);
    tableColumnDefaultValue = new TableColumn<ICFBamTimeTypeObj, Calendar>("Default Value");
    tableColumnDefaultValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimeTypeObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimeTypeObj, Calendar> p) {
                    ICFBamTimeDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Calendar value = obj.getOptionalDefaultValue();
                        ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDefaultValue.setCellFactory(
            new Callback<TableColumn<ICFBamTimeTypeObj, Calendar>, TableCell<ICFBamTimeTypeObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTimeTypeObj, Calendar> call(
                        TableColumn<ICFBamTimeTypeObj, Calendar> arg) {
                    return new CFTimeTableCell<ICFBamTimeTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultValue);
    tableColumnNullValue = new TableColumn<ICFBamTimeTypeObj, Calendar>("Null Value");
    tableColumnNullValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimeTypeObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimeTypeObj, Calendar> p) {
                    ICFBamTimeDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Calendar value = obj.getOptionalNullValue();
                        ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnNullValue.setCellFactory(
            new Callback<TableColumn<ICFBamTimeTypeObj, Calendar>, TableCell<ICFBamTimeTypeObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTimeTypeObj, Calendar> call(
                        TableColumn<ICFBamTimeTypeObj, Calendar> arg) {
                    return new CFTimeTableCell<ICFBamTimeTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnNullValue);
    tableColumnUnknownValue = new TableColumn<ICFBamTimeTypeObj, Calendar>("Unknown Value");
    tableColumnUnknownValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimeTypeObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTimeTypeObj, Calendar> p) {
                    ICFBamTimeDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Calendar value = obj.getOptionalUnknownValue();
                        ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnUnknownValue.setCellFactory(
            new Callback<TableColumn<ICFBamTimeTypeObj, Calendar>, TableCell<ICFBamTimeTypeObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTimeTypeObj, Calendar> call(
                        TableColumn<ICFBamTimeTypeObj, Calendar> arg) {
                    return new CFTimeTableCell<ICFBamTimeTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnUnknownValue);
    tableColumnLookupDefSchema = new TableColumn<ICFBamTimeTypeObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTimeTypeObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamTimeTypeObj, ICFBamSchemaDefObj> p) {
                    ICFBamTimeTypeObj 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<ICFBamTimeTypeObj, ICFBamSchemaDefObj>, TableCell<ICFBamTimeTypeObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamTimeTypeObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamTimeTypeObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamTimeTypeObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamTimeTypeObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamTimeTypeObj> observable, ICFBamTimeTypeObj oldValue,
                ICFBamTimeTypeObj 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.choseTimeType(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");
                }
                ICFBamTimeTypeObj selectedInstance = getJavaFXFocusAsTimeType();
                invokeWhenChosen.choseTimeType(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:ui.main.MainViewController.java

private void addContactListener() {
    //this method adds a contacts list listener
    System.gc();//from w w w.j a  va2  s.co  m
    contacts.getSelectionModel().selectedItemProperty().addListener(new ChangeListener() {
        @Override
        public void changed(ObservableValue observable, Object oldValue, Object newValue) {
            if (newValue == null) {
                return;
            }
            conversations.getSelectionModel().clearSelection();
            chatList.getChildren().clear();
            isSingleChat = true;
            if (((RosterEntry) newValue).getType().equals(ItemType.from)) {
                friendRequest.setVisible(true);
            } else {
                friendRequest.setVisible(false);
            }
            Call.dialUser = ((RosterEntry) newValue).getUser();
            String chatterNameTem = ((RosterEntry) newValue).getUser(); //get reciever
            String chatterNameTem2 = chatterNameTem;

            ResultSet rs = DBSingleChat.readMessages(chatterNameTem); //load old messages

            chatterNameTem = chatterNameTem.substring(0, chatterNameTem.indexOf("@"));
            chatterNameTem = Character.toUpperCase(chatterNameTem.charAt(0)) + chatterNameTem.substring(1);

            chatterName.setText(chatterNameTem); //set chat box to recievers contacts
            currentChat = chatManager.createChat(((RosterEntry) newValue).getUser()); //set the current chat
            chatterPresence.setText(contactsManager.getPresence(((RosterEntry) newValue).getUser()));

            VCard vcard = new VCard(); //vcard to load presence
            try {
                vcard.load(connectionManager.getXMPPConnection(), currentChat.getParticipant());
                if (vcard.getAvatar() != null) {
                    BufferedImage img = ImageIO.read(new ByteArrayInputStream(vcard.getAvatar()));
                    Image image = SwingFXUtils.toFXImage(img, null);
                    chatterAvatar.setImage(image);
                } else {
                    chatterAvatar.setImage(defaultAvatar);
                }
            } catch (XMPPException ex) {
                chatterAvatar.setImage(defaultAvatar);
            } catch (IOException ex) {
                Logger.getLogger(MainViewController.class.getName()).log(Level.SEVERE, null, ex);
            } catch (NullPointerException ex) {
                chatterAvatar.setImage(defaultAvatar);
            } finally {
                chatterAvatar.setFitHeight(120);
                chatterAvatar.setFitWidth(100);
            }

            //display old messages -> current chat is required to be set as a prerequisit
            loadChat(chatterNameTem2);
            Task t = new Task() {
                @Override
                protected Object call() throws Exception {
                    Thread.sleep(500);
                    return new Object();
                }
            };

            t.setOnSucceeded(value -> scrollPane.setVvalue(scrollPane.getHmax()));

            Thread thread1 = new Thread(t);
            thread1.start();

            //show extra options
            showExtraComButtons();
        }
    });

}

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

public CFBamJavaFXTZTimeColPickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamTZTimeColObj argFocus, ICFBamTableObj argContainer,
        Collection<ICFBamTZTimeColObj> argDataCollection, ICFBamJavaFXTZTimeColChosen whenChosen) {
    super();/*ww w.j  av a 2s.c  o m*/
    final String S_ProcName = "construct-schema-focus";
    if (formManager == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "formManager");
    }
    cfFormManager = formManager;
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2,
                "argSchema");
    }
    if (whenChosen == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 6,
                "whenChosen");
    }
    invokeWhenChosen = whenChosen;
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    javafxSchema = argSchema;
    javaFXFocus = argFocus;
    javafxContainer = argContainer;
    setJavaFXDataCollection(argDataCollection);
    dataTable = new TableView<ICFBamTZTimeColObj>();
    tableColumnId = new TableColumn<ICFBamTZTimeColObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimeColObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamTZTimeColObj, 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<ICFBamTZTimeColObj, Long>, TableCell<ICFBamTZTimeColObj, Long>>() {
                @Override
                public TableCell<ICFBamTZTimeColObj, Long> call(TableColumn<ICFBamTZTimeColObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamTZTimeColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamTZTimeColObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimeColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeColObj, 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<ICFBamTZTimeColObj, String>, TableCell<ICFBamTZTimeColObj, String>>() {
                @Override
                public TableCell<ICFBamTZTimeColObj, String> call(TableColumn<ICFBamTZTimeColObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZTimeColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamTZTimeColObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimeColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeColObj, 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<ICFBamTZTimeColObj, String>, TableCell<ICFBamTZTimeColObj, String>>() {
                @Override
                public TableCell<ICFBamTZTimeColObj, String> call(TableColumn<ICFBamTZTimeColObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZTimeColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamTZTimeColObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimeColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeColObj, 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<ICFBamTZTimeColObj, String>, TableCell<ICFBamTZTimeColObj, String>>() {
                @Override
                public TableCell<ICFBamTZTimeColObj, String> call(TableColumn<ICFBamTZTimeColObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZTimeColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamTZTimeColObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimeColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeColObj, 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<ICFBamTZTimeColObj, String>, TableCell<ICFBamTZTimeColObj, String>>() {
                @Override
                public TableCell<ICFBamTZTimeColObj, String> call(TableColumn<ICFBamTZTimeColObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZTimeColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamTZTimeColObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimeColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeColObj, 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<ICFBamTZTimeColObj, String>, TableCell<ICFBamTZTimeColObj, String>>() {
                @Override
                public TableCell<ICFBamTZTimeColObj, String> call(TableColumn<ICFBamTZTimeColObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZTimeColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnIsNullable = new TableColumn<ICFBamTZTimeColObj, Boolean>("Is Nullable");
    tableColumnIsNullable.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimeColObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimeColObj, 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<ICFBamTZTimeColObj, Boolean>, TableCell<ICFBamTZTimeColObj, Boolean>>() {
                @Override
                public TableCell<ICFBamTZTimeColObj, Boolean> call(
                        TableColumn<ICFBamTZTimeColObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamTZTimeColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsNullable);
    tableColumnGenerateId = new TableColumn<ICFBamTZTimeColObj, Boolean>("Generate Id");
    tableColumnGenerateId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimeColObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimeColObj, 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<ICFBamTZTimeColObj, Boolean>, TableCell<ICFBamTZTimeColObj, Boolean>>() {
                @Override
                public TableCell<ICFBamTZTimeColObj, Boolean> call(
                        TableColumn<ICFBamTZTimeColObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamTZTimeColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnGenerateId);
    tableColumnDefaultVisibility = new TableColumn<ICFBamTZTimeColObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimeColObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimeColObj, 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<ICFBamTZTimeColObj, Boolean>, TableCell<ICFBamTZTimeColObj, Boolean>>() {
                @Override
                public TableCell<ICFBamTZTimeColObj, Boolean> call(
                        TableColumn<ICFBamTZTimeColObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamTZTimeColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnDbName = new TableColumn<ICFBamTZTimeColObj, String>("Db Name");
    tableColumnDbName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimeColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeColObj, 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<ICFBamTZTimeColObj, String>, TableCell<ICFBamTZTimeColObj, String>>() {
                @Override
                public TableCell<ICFBamTZTimeColObj, String> call(TableColumn<ICFBamTZTimeColObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZTimeColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDbName);
    tableColumnInitValue = new TableColumn<ICFBamTZTimeColObj, Calendar>("Init. Value");
    tableColumnInitValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimeColObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimeColObj, Calendar> p) {
                    ICFBamTZTimeDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Calendar value = obj.getOptionalInitValue();
                        ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnInitValue.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimeColObj, Calendar>, TableCell<ICFBamTZTimeColObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTZTimeColObj, Calendar> call(
                        TableColumn<ICFBamTZTimeColObj, Calendar> arg) {
                    return new CFTZTimeTableCell<ICFBamTZTimeColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnInitValue);
    tableColumnDefaultValue = new TableColumn<ICFBamTZTimeColObj, Calendar>("Default Value");
    tableColumnDefaultValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimeColObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimeColObj, Calendar> p) {
                    ICFBamTZTimeDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Calendar value = obj.getOptionalDefaultValue();
                        ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDefaultValue.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimeColObj, Calendar>, TableCell<ICFBamTZTimeColObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTZTimeColObj, Calendar> call(
                        TableColumn<ICFBamTZTimeColObj, Calendar> arg) {
                    return new CFTZTimeTableCell<ICFBamTZTimeColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultValue);
    tableColumnNullValue = new TableColumn<ICFBamTZTimeColObj, Calendar>("Null Value");
    tableColumnNullValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimeColObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimeColObj, Calendar> p) {
                    ICFBamTZTimeDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Calendar value = obj.getOptionalNullValue();
                        ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnNullValue.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimeColObj, Calendar>, TableCell<ICFBamTZTimeColObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTZTimeColObj, Calendar> call(
                        TableColumn<ICFBamTZTimeColObj, Calendar> arg) {
                    return new CFTZTimeTableCell<ICFBamTZTimeColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnNullValue);
    tableColumnUnknownValue = new TableColumn<ICFBamTZTimeColObj, Calendar>("Unknown Value");
    tableColumnUnknownValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimeColObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimeColObj, Calendar> p) {
                    ICFBamTZTimeDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Calendar value = obj.getOptionalUnknownValue();
                        ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnUnknownValue.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimeColObj, Calendar>, TableCell<ICFBamTZTimeColObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTZTimeColObj, Calendar> call(
                        TableColumn<ICFBamTZTimeColObj, Calendar> arg) {
                    return new CFTZTimeTableCell<ICFBamTZTimeColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnUnknownValue);
    tableColumnLookupDefSchema = new TableColumn<ICFBamTZTimeColObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimeColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamTZTimeColObj, ICFBamSchemaDefObj> p) {
                    ICFBamTZTimeColObj 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<ICFBamTZTimeColObj, ICFBamSchemaDefObj>, TableCell<ICFBamTZTimeColObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamTZTimeColObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamTZTimeColObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamTZTimeColObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamTZTimeColObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamTZTimeColObj> observable,
                ICFBamTZTimeColObj oldValue, ICFBamTZTimeColObj 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.choseTZTimeCol(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");
                }
                ICFBamTZTimeColObj selectedInstance = getJavaFXFocusAsTZTimeCol();
                invokeWhenChosen.choseTZTimeCol(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.CFBamJavaFXTZTimeTypePickerPane.java

public CFBamJavaFXTZTimeTypePickerPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamTZTimeTypeObj argFocus, ICFBamSchemaDefObj argContainer,
        Collection<ICFBamTZTimeTypeObj> argDataCollection, ICFBamJavaFXTZTimeTypeChosen whenChosen) {
    super();//from  w  w  w  . j  av  a  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<ICFBamTZTimeTypeObj>();
    tableColumnId = new TableColumn<ICFBamTZTimeTypeObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimeTypeObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamTZTimeTypeObj, Long> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        long value = obj.getRequiredId();
                        Long wrapped = new Long(value);
                        ReadOnlyObjectWrapper<Long> observable = new ReadOnlyObjectWrapper<Long>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnId.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimeTypeObj, Long>, TableCell<ICFBamTZTimeTypeObj, Long>>() {
                @Override
                public TableCell<ICFBamTZTimeTypeObj, Long> call(TableColumn<ICFBamTZTimeTypeObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamTZTimeTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamTZTimeTypeObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimeTypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeTypeObj, String> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getRequiredName();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnName.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimeTypeObj, String>, TableCell<ICFBamTZTimeTypeObj, String>>() {
                @Override
                public TableCell<ICFBamTZTimeTypeObj, String> call(
                        TableColumn<ICFBamTZTimeTypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZTimeTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamTZTimeTypeObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimeTypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeTypeObj, String> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalShortName();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnShortName.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimeTypeObj, String>, TableCell<ICFBamTZTimeTypeObj, String>>() {
                @Override
                public TableCell<ICFBamTZTimeTypeObj, String> call(
                        TableColumn<ICFBamTZTimeTypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZTimeTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamTZTimeTypeObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimeTypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeTypeObj, String> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalLabel();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnLabel.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimeTypeObj, String>, TableCell<ICFBamTZTimeTypeObj, String>>() {
                @Override
                public TableCell<ICFBamTZTimeTypeObj, String> call(
                        TableColumn<ICFBamTZTimeTypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZTimeTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamTZTimeTypeObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimeTypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeTypeObj, String> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalShortDescription();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnShortDescription.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimeTypeObj, String>, TableCell<ICFBamTZTimeTypeObj, String>>() {
                @Override
                public TableCell<ICFBamTZTimeTypeObj, String> call(
                        TableColumn<ICFBamTZTimeTypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZTimeTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamTZTimeTypeObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimeTypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeTypeObj, String> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalDescription();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDescription.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimeTypeObj, String>, TableCell<ICFBamTZTimeTypeObj, String>>() {
                @Override
                public TableCell<ICFBamTZTimeTypeObj, String> call(
                        TableColumn<ICFBamTZTimeTypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZTimeTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnIsNullable = new TableColumn<ICFBamTZTimeTypeObj, Boolean>("Is Nullable");
    tableColumnIsNullable.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimeTypeObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimeTypeObj, Boolean> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        boolean value = obj.getRequiredIsNullable();
                        Boolean wrapped = new Boolean(value);
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnIsNullable.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimeTypeObj, Boolean>, TableCell<ICFBamTZTimeTypeObj, Boolean>>() {
                @Override
                public TableCell<ICFBamTZTimeTypeObj, Boolean> call(
                        TableColumn<ICFBamTZTimeTypeObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamTZTimeTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsNullable);
    tableColumnGenerateId = new TableColumn<ICFBamTZTimeTypeObj, Boolean>("Generate Id");
    tableColumnGenerateId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimeTypeObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimeTypeObj, Boolean> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Boolean value = obj.getOptionalGenerateId();
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnGenerateId.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimeTypeObj, Boolean>, TableCell<ICFBamTZTimeTypeObj, Boolean>>() {
                @Override
                public TableCell<ICFBamTZTimeTypeObj, Boolean> call(
                        TableColumn<ICFBamTZTimeTypeObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamTZTimeTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnGenerateId);
    tableColumnDefaultVisibility = new TableColumn<ICFBamTZTimeTypeObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimeTypeObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamTZTimeTypeObj, Boolean> p) {
                    ICFBamValueObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        boolean value = obj.getRequiredDefaultVisibility();
                        Boolean wrapped = new Boolean(value);
                        ReadOnlyObjectWrapper<Boolean> observable = new ReadOnlyObjectWrapper<Boolean>();
                        observable.setValue(wrapped);
                        return (observable);
                    }
                }
            });
    tableColumnDefaultVisibility.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimeTypeObj, Boolean>, TableCell<ICFBamTZTimeTypeObj, Boolean>>() {
                @Override
                public TableCell<ICFBamTZTimeTypeObj, Boolean> call(
                        TableColumn<ICFBamTZTimeTypeObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamTZTimeTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnDbName = new TableColumn<ICFBamTZTimeTypeObj, String>("Db Name");
    tableColumnDbName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimeTypeObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamTZTimeTypeObj, String> p) {
                    ICFBamAtomObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        String value = obj.getOptionalDbName();
                        ReadOnlyObjectWrapper<String> observable = new ReadOnlyObjectWrapper<String>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDbName.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimeTypeObj, String>, TableCell<ICFBamTZTimeTypeObj, String>>() {
                @Override
                public TableCell<ICFBamTZTimeTypeObj, String> call(
                        TableColumn<ICFBamTZTimeTypeObj, String> arg) {
                    return new CFStringTableCell<ICFBamTZTimeTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDbName);
    tableColumnInitValue = new TableColumn<ICFBamTZTimeTypeObj, Calendar>("Init. Value");
    tableColumnInitValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimeTypeObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimeTypeObj, Calendar> p) {
                    ICFBamTZTimeDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Calendar value = obj.getOptionalInitValue();
                        ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnInitValue.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimeTypeObj, Calendar>, TableCell<ICFBamTZTimeTypeObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTZTimeTypeObj, Calendar> call(
                        TableColumn<ICFBamTZTimeTypeObj, Calendar> arg) {
                    return new CFTZTimeTableCell<ICFBamTZTimeTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnInitValue);
    tableColumnDefaultValue = new TableColumn<ICFBamTZTimeTypeObj, Calendar>("Default Value");
    tableColumnDefaultValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimeTypeObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimeTypeObj, Calendar> p) {
                    ICFBamTZTimeDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Calendar value = obj.getOptionalDefaultValue();
                        ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDefaultValue.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimeTypeObj, Calendar>, TableCell<ICFBamTZTimeTypeObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTZTimeTypeObj, Calendar> call(
                        TableColumn<ICFBamTZTimeTypeObj, Calendar> arg) {
                    return new CFTZTimeTableCell<ICFBamTZTimeTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultValue);
    tableColumnNullValue = new TableColumn<ICFBamTZTimeTypeObj, Calendar>("Null Value");
    tableColumnNullValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimeTypeObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimeTypeObj, Calendar> p) {
                    ICFBamTZTimeDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Calendar value = obj.getOptionalNullValue();
                        ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnNullValue.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimeTypeObj, Calendar>, TableCell<ICFBamTZTimeTypeObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTZTimeTypeObj, Calendar> call(
                        TableColumn<ICFBamTZTimeTypeObj, Calendar> arg) {
                    return new CFTZTimeTableCell<ICFBamTZTimeTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnNullValue);
    tableColumnUnknownValue = new TableColumn<ICFBamTZTimeTypeObj, Calendar>("Unknown Value");
    tableColumnUnknownValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimeTypeObj, Calendar>, ObservableValue<Calendar>>() {
                public ObservableValue<Calendar> call(CellDataFeatures<ICFBamTZTimeTypeObj, Calendar> p) {
                    ICFBamTZTimeDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        Calendar value = obj.getOptionalUnknownValue();
                        ReadOnlyObjectWrapper<Calendar> observable = new ReadOnlyObjectWrapper<Calendar>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnUnknownValue.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimeTypeObj, Calendar>, TableCell<ICFBamTZTimeTypeObj, Calendar>>() {
                @Override
                public TableCell<ICFBamTZTimeTypeObj, Calendar> call(
                        TableColumn<ICFBamTZTimeTypeObj, Calendar> arg) {
                    return new CFTZTimeTableCell<ICFBamTZTimeTypeObj>();
                }
            });
    dataTable.getColumns().add(tableColumnUnknownValue);
    tableColumnLookupDefSchema = new TableColumn<ICFBamTZTimeTypeObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamTZTimeTypeObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamTZTimeTypeObj, ICFBamSchemaDefObj> p) {
                    ICFBamTZTimeTypeObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        ICFBamSchemaDefObj ref = obj.getOptionalLookupDefSchema();
                        ReadOnlyObjectWrapper<ICFBamSchemaDefObj> observable = new ReadOnlyObjectWrapper<ICFBamSchemaDefObj>();
                        observable.setValue(ref);
                        return (observable);
                    }
                }
            });
    tableColumnLookupDefSchema.setCellFactory(
            new Callback<TableColumn<ICFBamTZTimeTypeObj, ICFBamSchemaDefObj>, TableCell<ICFBamTZTimeTypeObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamTZTimeTypeObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamTZTimeTypeObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamTZTimeTypeObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamTZTimeTypeObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamTZTimeTypeObj> observable,
                ICFBamTZTimeTypeObj oldValue, ICFBamTZTimeTypeObj newValue) {
            setJavaFXFocus(newValue);
            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.choseTZTimeType(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");
                }
                ICFBamTZTimeTypeObj selectedInstance = getJavaFXFocusAsTZTimeType();
                invokeWhenChosen.choseTZTimeType(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.CFBamJavaFXUuidColListPane.java

public CFBamJavaFXUuidColListPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema,
        ICFBamTableObj argContainer, ICFBamUuidColObj argFocus, Collection<ICFBamUuidColObj> argDataCollection,
        ICFRefreshCallback refreshCallback, boolean sortByChain) {
    super();/*w ww .j a  va2  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");
    }
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    javafxSchema = argSchema;
    javaFXFocus = argFocus;
    javafxContainer = argContainer;
    javafxRefreshCallback = refreshCallback;
    javafxSortByChain = sortByChain;
    setJavaFXDataCollection(argDataCollection);
    dataTable = new TableView<ICFBamUuidColObj>();
    tableColumnId = new TableColumn<ICFBamUuidColObj, Long>("Id");
    tableColumnId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUuidColObj, Long>, ObservableValue<Long>>() {
                public ObservableValue<Long> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, Long>, TableCell<ICFBamUuidColObj, Long>>() {
                @Override
                public TableCell<ICFBamUuidColObj, Long> call(TableColumn<ICFBamUuidColObj, Long> arg) {
                    return new CFInt64TableCell<ICFBamUuidColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnId);
    tableColumnName = new TableColumn<ICFBamUuidColObj, String>("Name");
    tableColumnName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUuidColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, String>, TableCell<ICFBamUuidColObj, String>>() {
                @Override
                public TableCell<ICFBamUuidColObj, String> call(TableColumn<ICFBamUuidColObj, String> arg) {
                    return new CFStringTableCell<ICFBamUuidColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnName);
    tableColumnShortName = new TableColumn<ICFBamUuidColObj, String>("Short Name");
    tableColumnShortName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUuidColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, String>, TableCell<ICFBamUuidColObj, String>>() {
                @Override
                public TableCell<ICFBamUuidColObj, String> call(TableColumn<ICFBamUuidColObj, String> arg) {
                    return new CFStringTableCell<ICFBamUuidColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortName);
    tableColumnLabel = new TableColumn<ICFBamUuidColObj, String>("Label");
    tableColumnLabel.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUuidColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, String>, TableCell<ICFBamUuidColObj, String>>() {
                @Override
                public TableCell<ICFBamUuidColObj, String> call(TableColumn<ICFBamUuidColObj, String> arg) {
                    return new CFStringTableCell<ICFBamUuidColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLabel);
    tableColumnShortDescription = new TableColumn<ICFBamUuidColObj, String>("Short Description");
    tableColumnShortDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUuidColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, String>, TableCell<ICFBamUuidColObj, String>>() {
                @Override
                public TableCell<ICFBamUuidColObj, String> call(TableColumn<ICFBamUuidColObj, String> arg) {
                    return new CFStringTableCell<ICFBamUuidColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnShortDescription);
    tableColumnDescription = new TableColumn<ICFBamUuidColObj, String>("Description");
    tableColumnDescription.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUuidColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, String>, TableCell<ICFBamUuidColObj, String>>() {
                @Override
                public TableCell<ICFBamUuidColObj, String> call(TableColumn<ICFBamUuidColObj, String> arg) {
                    return new CFStringTableCell<ICFBamUuidColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDescription);
    tableColumnIsNullable = new TableColumn<ICFBamUuidColObj, Boolean>("Is Nullable");
    tableColumnIsNullable.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUuidColObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, Boolean>, TableCell<ICFBamUuidColObj, Boolean>>() {
                @Override
                public TableCell<ICFBamUuidColObj, Boolean> call(TableColumn<ICFBamUuidColObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamUuidColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnIsNullable);
    tableColumnGenerateId = new TableColumn<ICFBamUuidColObj, Boolean>("Generate Id");
    tableColumnGenerateId.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUuidColObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, Boolean>, TableCell<ICFBamUuidColObj, Boolean>>() {
                @Override
                public TableCell<ICFBamUuidColObj, Boolean> call(TableColumn<ICFBamUuidColObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamUuidColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnGenerateId);
    tableColumnDefaultVisibility = new TableColumn<ICFBamUuidColObj, Boolean>("Default Visibility");
    tableColumnDefaultVisibility.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUuidColObj, Boolean>, ObservableValue<Boolean>>() {
                public ObservableValue<Boolean> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, Boolean>, TableCell<ICFBamUuidColObj, Boolean>>() {
                @Override
                public TableCell<ICFBamUuidColObj, Boolean> call(TableColumn<ICFBamUuidColObj, Boolean> arg) {
                    return new CFBoolTableCell<ICFBamUuidColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultVisibility);
    tableColumnDbName = new TableColumn<ICFBamUuidColObj, String>("Db Name");
    tableColumnDbName.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUuidColObj, String>, ObservableValue<String>>() {
                public ObservableValue<String> call(CellDataFeatures<ICFBamUuidColObj, 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<ICFBamUuidColObj, String>, TableCell<ICFBamUuidColObj, String>>() {
                @Override
                public TableCell<ICFBamUuidColObj, String> call(TableColumn<ICFBamUuidColObj, String> arg) {
                    return new CFStringTableCell<ICFBamUuidColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDbName);
    tableColumnInitValue = new TableColumn<ICFBamUuidColObj, UUID>("Init. Value");
    tableColumnInitValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUuidColObj, UUID>, ObservableValue<UUID>>() {
                public ObservableValue<UUID> call(CellDataFeatures<ICFBamUuidColObj, UUID> p) {
                    ICFBamUuidDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        UUID value = obj.getOptionalInitValue();
                        ReadOnlyObjectWrapper<UUID> observable = new ReadOnlyObjectWrapper<UUID>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnInitValue.setCellFactory(
            new Callback<TableColumn<ICFBamUuidColObj, UUID>, TableCell<ICFBamUuidColObj, UUID>>() {
                @Override
                public TableCell<ICFBamUuidColObj, UUID> call(TableColumn<ICFBamUuidColObj, UUID> arg) {
                    return new CFUuidTableCell<ICFBamUuidColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnInitValue);
    tableColumnDefaultValue = new TableColumn<ICFBamUuidColObj, UUID>("Default Value");
    tableColumnDefaultValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUuidColObj, UUID>, ObservableValue<UUID>>() {
                public ObservableValue<UUID> call(CellDataFeatures<ICFBamUuidColObj, UUID> p) {
                    ICFBamUuidDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        UUID value = obj.getOptionalDefaultValue();
                        ReadOnlyObjectWrapper<UUID> observable = new ReadOnlyObjectWrapper<UUID>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnDefaultValue.setCellFactory(
            new Callback<TableColumn<ICFBamUuidColObj, UUID>, TableCell<ICFBamUuidColObj, UUID>>() {
                @Override
                public TableCell<ICFBamUuidColObj, UUID> call(TableColumn<ICFBamUuidColObj, UUID> arg) {
                    return new CFUuidTableCell<ICFBamUuidColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnDefaultValue);
    tableColumnNullValue = new TableColumn<ICFBamUuidColObj, UUID>("Null Value");
    tableColumnNullValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUuidColObj, UUID>, ObservableValue<UUID>>() {
                public ObservableValue<UUID> call(CellDataFeatures<ICFBamUuidColObj, UUID> p) {
                    ICFBamUuidDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        UUID value = obj.getOptionalNullValue();
                        ReadOnlyObjectWrapper<UUID> observable = new ReadOnlyObjectWrapper<UUID>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnNullValue.setCellFactory(
            new Callback<TableColumn<ICFBamUuidColObj, UUID>, TableCell<ICFBamUuidColObj, UUID>>() {
                @Override
                public TableCell<ICFBamUuidColObj, UUID> call(TableColumn<ICFBamUuidColObj, UUID> arg) {
                    return new CFUuidTableCell<ICFBamUuidColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnNullValue);
    tableColumnUnknownValue = new TableColumn<ICFBamUuidColObj, UUID>("Unknown Value");
    tableColumnUnknownValue.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUuidColObj, UUID>, ObservableValue<UUID>>() {
                public ObservableValue<UUID> call(CellDataFeatures<ICFBamUuidColObj, UUID> p) {
                    ICFBamUuidDefObj obj = p.getValue();
                    if (obj == null) {
                        return (null);
                    } else {
                        UUID value = obj.getOptionalUnknownValue();
                        ReadOnlyObjectWrapper<UUID> observable = new ReadOnlyObjectWrapper<UUID>();
                        observable.setValue(value);
                        return (observable);
                    }
                }
            });
    tableColumnUnknownValue.setCellFactory(
            new Callback<TableColumn<ICFBamUuidColObj, UUID>, TableCell<ICFBamUuidColObj, UUID>>() {
                @Override
                public TableCell<ICFBamUuidColObj, UUID> call(TableColumn<ICFBamUuidColObj, UUID> arg) {
                    return new CFUuidTableCell<ICFBamUuidColObj>();
                }
            });
    dataTable.getColumns().add(tableColumnUnknownValue);
    tableColumnLookupDefSchema = new TableColumn<ICFBamUuidColObj, ICFBamSchemaDefObj>(
            "Defining Schema Definition");
    tableColumnLookupDefSchema.setCellValueFactory(
            new Callback<CellDataFeatures<ICFBamUuidColObj, ICFBamSchemaDefObj>, ObservableValue<ICFBamSchemaDefObj>>() {
                public ObservableValue<ICFBamSchemaDefObj> call(
                        CellDataFeatures<ICFBamUuidColObj, ICFBamSchemaDefObj> p) {
                    ICFBamUuidColObj 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<ICFBamUuidColObj, ICFBamSchemaDefObj>, TableCell<ICFBamUuidColObj, ICFBamSchemaDefObj>>() {
                @Override
                public TableCell<ICFBamUuidColObj, ICFBamSchemaDefObj> call(
                        TableColumn<ICFBamUuidColObj, ICFBamSchemaDefObj> arg) {
                    return new CFReferenceTableCell<ICFBamUuidColObj, ICFBamSchemaDefObj>();
                }
            });
    dataTable.getColumns().add(tableColumnLookupDefSchema);
    dataTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ICFBamUuidColObj>() {
        @Override
        public void changed(ObservableValue<? extends ICFBamUuidColObj> observable, ICFBamUuidColObj oldValue,
                ICFBamUuidColObj newValue) {
            setJavaFXFocus(newValue);
        }
    });

    scrollMenu = new ScrollPane();
    scrollMenu.setVbarPolicy(ScrollBarPolicy.NEVER);
    scrollMenu.setHbarPolicy(ScrollBarPolicy.AS_NEEDED);
    scrollMenu.setFitToHeight(true);
    scrollMenu.setContent(getPanelHBoxMenu());

    setTop(scrollMenu);
    setCenter(dataTable);
    javafxIsInitializing = false;
    if (observableListOfUuidCol != null) {
        dataTable.setItems(observableListOfUuidCol);
    }
    adjustListButtons();
}

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

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