Example usage for javafx.event EventHandler EventHandler

List of usage examples for javafx.event EventHandler EventHandler

Introduction

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

Prototype

EventHandler

Source Link

Usage

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

public CFHBox getPanelHBoxMenu() {
    if (hboxMenu == null) {
        hboxMenu = new CFHBox(10);
        buttonAddTextCol = new CFButton();
        buttonAddTextCol.setMinWidth(200);
        buttonAddTextCol.setText("Add TextCol");
        buttonAddTextCol.setOnAction(new EventHandler<ActionEvent>() {
            @Override/*  www. j a  va 2  s  .c o m*/
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamTextColObj obj = (ICFBamTextColObj) schemaObj.getTextColTableObj().newInstance();
                    ICFBamTextColEditObj edit = (ICFBamTextColEditObj) (obj.beginEdit());
                    if (edit == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "edit");
                    }
                    ICFSecurityTenantObj secTenant = schemaObj.getSecTenant();
                    edit.setRequiredOwnerTenant(secTenant);
                    ICFBamTableObj container = (ICFBamTableObj) (getJavaFXContainer());
                    if (container == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "JavaFXContainer");
                    }
                    edit.setRequiredContainerTable(container);
                    CFBorderPane frame = javafxSchema.getTextColFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamJavaFXTextColPaneCommon jpanelCommon = (ICFBamJavaFXTextColPaneCommon) frame;
                    jpanelCommon.setJavaFXFocus(obj);
                    jpanelCommon.setPaneMode(CFPane.PaneMode.Add);
                    cfFormManager.pushForm(frame);
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonAddTextCol);
        buttonViewSelected = new CFButton();
        buttonViewSelected.setMinWidth(200);
        buttonViewSelected.setText("View Selected");
        buttonViewSelected.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    if (schemaObj == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "schemaObj");
                    }
                    ICFBamTextColObj selectedInstance = getJavaFXFocusAsTextCol();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("TXTC".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getTextColFactory().newViewEditForm(cfFormManager,
                                    selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXTextColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamTextColObj");
                        }
                    }
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonViewSelected);

        buttonEditSelected = new CFButton();
        buttonEditSelected.setMinWidth(200);
        buttonEditSelected.setText("Edit Selected");
        buttonEditSelected.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    if (schemaObj == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "schemaObj");
                    }
                    ICFBamTextColObj selectedInstance = getJavaFXFocusAsTextCol();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("TXTC".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getTextColFactory().newViewEditForm(cfFormManager,
                                    selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXTextColPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamTextColObj");
                        }
                    }
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonEditSelected);

        buttonDeleteSelected = new CFButton();
        buttonDeleteSelected.setMinWidth(200);
        buttonDeleteSelected.setText("Delete Selected");
        buttonDeleteSelected.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    if (schemaObj == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "schemaObj");
                    }
                    ICFBamTextColObj selectedInstance = getJavaFXFocusAsTextCol();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("TXTC".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getTextColFactory()
                                    .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback());
                            ((ICFBamJavaFXTextColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamTextColObj");
                        }
                    }
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonDeleteSelected);

    }
    return (hboxMenu);
}

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

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

public CFHBox getPanelHBoxMenu() {
    if (hboxMenu == null) {
        hboxMenu = new CFHBox(10);
        buttonAddFloatCol = new CFButton();
        buttonAddFloatCol.setMinWidth(200);
        buttonAddFloatCol.setText("Add FloatCol");
        buttonAddFloatCol.setOnAction(new EventHandler<ActionEvent>() {
            @Override/*from   w ww. ja  v  a 2s .com*/
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamFloatColObj obj = (ICFBamFloatColObj) schemaObj.getFloatColTableObj().newInstance();
                    ICFBamFloatColEditObj edit = (ICFBamFloatColEditObj) (obj.beginEdit());
                    if (edit == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "edit");
                    }
                    ICFSecurityTenantObj secTenant = schemaObj.getSecTenant();
                    edit.setRequiredOwnerTenant(secTenant);
                    ICFBamTableObj container = (ICFBamTableObj) (getJavaFXContainer());
                    if (container == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "JavaFXContainer");
                    }
                    edit.setRequiredContainerTable(container);
                    CFBorderPane frame = javafxSchema.getFloatColFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamJavaFXFloatColPaneCommon jpanelCommon = (ICFBamJavaFXFloatColPaneCommon) frame;
                    jpanelCommon.setJavaFXFocus(obj);
                    jpanelCommon.setPaneMode(CFPane.PaneMode.Add);
                    cfFormManager.pushForm(frame);
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonAddFloatCol);
        buttonViewSelected = new CFButton();
        buttonViewSelected.setMinWidth(200);
        buttonViewSelected.setText("View Selected");
        buttonViewSelected.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    if (schemaObj == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "schemaObj");
                    }
                    ICFBamFloatColObj selectedInstance = getJavaFXFocusAsFloatCol();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("FLTC".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getFloatColFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXFloatColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamFloatColObj");
                        }
                    }
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonViewSelected);

        buttonEditSelected = new CFButton();
        buttonEditSelected.setMinWidth(200);
        buttonEditSelected.setText("Edit Selected");
        buttonEditSelected.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    if (schemaObj == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "schemaObj");
                    }
                    ICFBamFloatColObj selectedInstance = getJavaFXFocusAsFloatCol();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("FLTC".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getFloatColFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXFloatColPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamFloatColObj");
                        }
                    }
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonEditSelected);

        buttonDeleteSelected = new CFButton();
        buttonDeleteSelected.setMinWidth(200);
        buttonDeleteSelected.setText("Delete Selected");
        buttonDeleteSelected.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    if (schemaObj == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "schemaObj");
                    }
                    ICFBamFloatColObj selectedInstance = getJavaFXFocusAsFloatCol();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("FLTC".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getFloatColFactory()
                                    .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback());
                            ((ICFBamJavaFXFloatColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamFloatColObj");
                        }
                    }
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonDeleteSelected);

    }
    return (hboxMenu);
}

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

public CFHBox getPanelHBoxMenu() {
    if (hboxMenu == null) {
        hboxMenu = new CFHBox(10);
        buttonAddInt16Col = new CFButton();
        buttonAddInt16Col.setMinWidth(200);
        buttonAddInt16Col.setText("Add Int16Col");
        buttonAddInt16Col.setOnAction(new EventHandler<ActionEvent>() {
            @Override//from w  w  w.j  a v a  2s.c o  m
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamInt16ColObj obj = (ICFBamInt16ColObj) schemaObj.getInt16ColTableObj().newInstance();
                    ICFBamInt16ColEditObj edit = (ICFBamInt16ColEditObj) (obj.beginEdit());
                    if (edit == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "edit");
                    }
                    ICFSecurityTenantObj secTenant = schemaObj.getSecTenant();
                    edit.setRequiredOwnerTenant(secTenant);
                    ICFBamTableObj container = (ICFBamTableObj) (getJavaFXContainer());
                    if (container == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "JavaFXContainer");
                    }
                    edit.setRequiredContainerTable(container);
                    CFBorderPane frame = javafxSchema.getInt16ColFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamJavaFXInt16ColPaneCommon jpanelCommon = (ICFBamJavaFXInt16ColPaneCommon) frame;
                    jpanelCommon.setJavaFXFocus(obj);
                    jpanelCommon.setPaneMode(CFPane.PaneMode.Add);
                    cfFormManager.pushForm(frame);
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonAddInt16Col);
        buttonViewSelected = new CFButton();
        buttonViewSelected.setMinWidth(200);
        buttonViewSelected.setText("View Selected");
        buttonViewSelected.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    if (schemaObj == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "schemaObj");
                    }
                    ICFBamInt16ColObj selectedInstance = getJavaFXFocusAsInt16Col();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("I16C".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getInt16ColFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXInt16ColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamInt16ColObj");
                        }
                    }
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonViewSelected);

        buttonEditSelected = new CFButton();
        buttonEditSelected.setMinWidth(200);
        buttonEditSelected.setText("Edit Selected");
        buttonEditSelected.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    if (schemaObj == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "schemaObj");
                    }
                    ICFBamInt16ColObj selectedInstance = getJavaFXFocusAsInt16Col();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("I16C".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getInt16ColFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXInt16ColPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamInt16ColObj");
                        }
                    }
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonEditSelected);

        buttonDeleteSelected = new CFButton();
        buttonDeleteSelected.setMinWidth(200);
        buttonDeleteSelected.setText("Delete Selected");
        buttonDeleteSelected.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    if (schemaObj == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "schemaObj");
                    }
                    ICFBamInt16ColObj selectedInstance = getJavaFXFocusAsInt16Col();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("I16C".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getInt16ColFactory()
                                    .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback());
                            ((ICFBamJavaFXInt16ColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamInt16ColObj");
                        }
                    }
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonDeleteSelected);

    }
    return (hboxMenu);
}

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

public CFHBox getPanelHBoxMenu() {
    if (hboxMenu == null) {
        hboxMenu = new CFHBox(10);
        buttonAddDateCol = new CFButton();
        buttonAddDateCol.setMinWidth(200);
        buttonAddDateCol.setText("Add DateCol");
        buttonAddDateCol.setOnAction(new EventHandler<ActionEvent>() {
            @Override/* w  w  w  .  j  ava 2s  .  c o  m*/
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamDateColObj obj = (ICFBamDateColObj) schemaObj.getDateColTableObj().newInstance();
                    ICFBamDateColEditObj edit = (ICFBamDateColEditObj) (obj.beginEdit());
                    if (edit == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "edit");
                    }
                    ICFSecurityTenantObj secTenant = schemaObj.getSecTenant();
                    edit.setRequiredOwnerTenant(secTenant);
                    ICFBamTableObj container = (ICFBamTableObj) (getJavaFXContainer());
                    if (container == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "JavaFXContainer");
                    }
                    edit.setRequiredContainerTable(container);
                    CFBorderPane frame = javafxSchema.getDateColFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamJavaFXDateColPaneCommon jpanelCommon = (ICFBamJavaFXDateColPaneCommon) frame;
                    jpanelCommon.setJavaFXFocus(obj);
                    jpanelCommon.setPaneMode(CFPane.PaneMode.Add);
                    cfFormManager.pushForm(frame);
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonAddDateCol);
        buttonViewSelected = new CFButton();
        buttonViewSelected.setMinWidth(200);
        buttonViewSelected.setText("View Selected");
        buttonViewSelected.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    if (schemaObj == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "schemaObj");
                    }
                    ICFBamDateColObj selectedInstance = getJavaFXFocusAsDateCol();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("DATC".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getDateColFactory().newViewEditForm(cfFormManager,
                                    selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXDateColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamDateColObj");
                        }
                    }
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonViewSelected);

        buttonEditSelected = new CFButton();
        buttonEditSelected.setMinWidth(200);
        buttonEditSelected.setText("Edit Selected");
        buttonEditSelected.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    if (schemaObj == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "schemaObj");
                    }
                    ICFBamDateColObj selectedInstance = getJavaFXFocusAsDateCol();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("DATC".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getDateColFactory().newViewEditForm(cfFormManager,
                                    selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXDateColPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamDateColObj");
                        }
                    }
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonEditSelected);

        buttonDeleteSelected = new CFButton();
        buttonDeleteSelected.setMinWidth(200);
        buttonDeleteSelected.setText("Delete Selected");
        buttonDeleteSelected.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    if (schemaObj == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "schemaObj");
                    }
                    ICFBamDateColObj selectedInstance = getJavaFXFocusAsDateCol();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("DATC".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getDateColFactory()
                                    .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback());
                            ((ICFBamJavaFXDateColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamDateColObj");
                        }
                    }
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonDeleteSelected);

    }
    return (hboxMenu);
}

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

public CFHBox getPanelHBoxMenu() {
    if (hboxMenu == null) {
        hboxMenu = new CFHBox(10);
        buttonAddEnumType = new CFButton();
        buttonAddEnumType.setMinWidth(200);
        buttonAddEnumType.setText("Add EnumType");
        buttonAddEnumType.setOnAction(new EventHandler<ActionEvent>() {
            @Override//from w w  w. ja  v  a  2s . c  o  m
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamEnumTypeObj obj = (ICFBamEnumTypeObj) schemaObj.getEnumTypeTableObj().newInstance();
                    ICFBamEnumTypeEditObj edit = (ICFBamEnumTypeEditObj) (obj.beginEdit());
                    if (edit == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "edit");
                    }
                    ICFSecurityTenantObj secTenant = schemaObj.getSecTenant();
                    edit.setRequiredOwnerTenant(secTenant);
                    ICFBamSchemaDefObj container = (ICFBamSchemaDefObj) (getJavaFXContainer());
                    if (container == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "JavaFXContainer");
                    }
                    edit.setRequiredContainerSchemaDef(container);
                    CFBorderPane frame = javafxSchema.getEnumTypeFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamJavaFXEnumTypePaneCommon jpanelCommon = (ICFBamJavaFXEnumTypePaneCommon) frame;
                    jpanelCommon.setJavaFXFocus(obj);
                    jpanelCommon.setPaneMode(CFPane.PaneMode.Add);
                    cfFormManager.pushForm(frame);
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonAddEnumType);
        buttonViewSelected = new CFButton();
        buttonViewSelected.setMinWidth(200);
        buttonViewSelected.setText("View Selected");
        buttonViewSelected.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    if (schemaObj == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "schemaObj");
                    }
                    ICFBamEnumTypeObj selectedInstance = getJavaFXFocusAsEnumType();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("ENMT".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getEnumTypeFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXEnumTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamEnumTypeObj");
                        }
                    }
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonViewSelected);

        buttonEditSelected = new CFButton();
        buttonEditSelected.setMinWidth(200);
        buttonEditSelected.setText("Edit Selected");
        buttonEditSelected.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    if (schemaObj == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "schemaObj");
                    }
                    ICFBamEnumTypeObj selectedInstance = getJavaFXFocusAsEnumType();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("ENMT".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getEnumTypeFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXEnumTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamEnumTypeObj");
                        }
                    }
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonEditSelected);

        buttonDeleteSelected = new CFButton();
        buttonDeleteSelected.setMinWidth(200);
        buttonDeleteSelected.setText("Delete Selected");
        buttonDeleteSelected.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    if (schemaObj == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "schemaObj");
                    }
                    ICFBamEnumTypeObj selectedInstance = getJavaFXFocusAsEnumType();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("ENMT".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getEnumTypeFactory()
                                    .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback());
                            ((ICFBamJavaFXEnumTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamEnumTypeObj");
                        }
                    }
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonDeleteSelected);

    }
    return (hboxMenu);
}

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

public CFHBox getPanelHBoxMenu() {
    if (hboxMenu == null) {
        hboxMenu = new CFHBox(10);
        buttonAddInt32Col = new CFButton();
        buttonAddInt32Col.setMinWidth(200);
        buttonAddInt32Col.setText("Add Int32Col");
        buttonAddInt32Col.setOnAction(new EventHandler<ActionEvent>() {
            @Override//  ww w.ja  va  2  s  . c  o m
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamInt32ColObj obj = (ICFBamInt32ColObj) schemaObj.getInt32ColTableObj().newInstance();
                    ICFBamInt32ColEditObj edit = (ICFBamInt32ColEditObj) (obj.beginEdit());
                    if (edit == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "edit");
                    }
                    ICFSecurityTenantObj secTenant = schemaObj.getSecTenant();
                    edit.setRequiredOwnerTenant(secTenant);
                    ICFBamTableObj container = (ICFBamTableObj) (getJavaFXContainer());
                    if (container == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "JavaFXContainer");
                    }
                    edit.setRequiredContainerTable(container);
                    CFBorderPane frame = javafxSchema.getInt32ColFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamJavaFXInt32ColPaneCommon jpanelCommon = (ICFBamJavaFXInt32ColPaneCommon) frame;
                    jpanelCommon.setJavaFXFocus(obj);
                    jpanelCommon.setPaneMode(CFPane.PaneMode.Add);
                    cfFormManager.pushForm(frame);
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonAddInt32Col);
        buttonViewSelected = new CFButton();
        buttonViewSelected.setMinWidth(200);
        buttonViewSelected.setText("View Selected");
        buttonViewSelected.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    if (schemaObj == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "schemaObj");
                    }
                    ICFBamInt32ColObj selectedInstance = getJavaFXFocusAsInt32Col();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("I32C".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getInt32ColFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXInt32ColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamInt32ColObj");
                        }
                    }
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonViewSelected);

        buttonEditSelected = new CFButton();
        buttonEditSelected.setMinWidth(200);
        buttonEditSelected.setText("Edit Selected");
        buttonEditSelected.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    if (schemaObj == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "schemaObj");
                    }
                    ICFBamInt32ColObj selectedInstance = getJavaFXFocusAsInt32Col();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("I32C".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getInt32ColFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXInt32ColPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamInt32ColObj");
                        }
                    }
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonEditSelected);

        buttonDeleteSelected = new CFButton();
        buttonDeleteSelected.setMinWidth(200);
        buttonDeleteSelected.setText("Delete Selected");
        buttonDeleteSelected.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    if (schemaObj == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "schemaObj");
                    }
                    ICFBamInt32ColObj selectedInstance = getJavaFXFocusAsInt32Col();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("I32C".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getInt32ColFactory()
                                    .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback());
                            ((ICFBamJavaFXInt32ColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamInt32ColObj");
                        }
                    }
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonDeleteSelected);

    }
    return (hboxMenu);
}

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

public CFHBox getPanelHBoxMenu() {
    if (hboxMenu == null) {
        hboxMenu = new CFHBox(10);
        buttonAddTextType = new CFButton();
        buttonAddTextType.setMinWidth(200);
        buttonAddTextType.setText("Add TextType");
        buttonAddTextType.setOnAction(new EventHandler<ActionEvent>() {
            @Override//w w  w. j  a  v  a 2 s  .  co m
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamTextTypeObj obj = (ICFBamTextTypeObj) schemaObj.getTextTypeTableObj().newInstance();
                    ICFBamTextTypeEditObj edit = (ICFBamTextTypeEditObj) (obj.beginEdit());
                    if (edit == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "edit");
                    }
                    ICFSecurityTenantObj secTenant = schemaObj.getSecTenant();
                    edit.setRequiredOwnerTenant(secTenant);
                    ICFBamSchemaDefObj container = (ICFBamSchemaDefObj) (getJavaFXContainer());
                    if (container == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "JavaFXContainer");
                    }
                    edit.setRequiredContainerSchemaDef(container);
                    CFBorderPane frame = javafxSchema.getTextTypeFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamJavaFXTextTypePaneCommon jpanelCommon = (ICFBamJavaFXTextTypePaneCommon) frame;
                    jpanelCommon.setJavaFXFocus(obj);
                    jpanelCommon.setPaneMode(CFPane.PaneMode.Add);
                    cfFormManager.pushForm(frame);
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonAddTextType);
        buttonViewSelected = new CFButton();
        buttonViewSelected.setMinWidth(200);
        buttonViewSelected.setText("View Selected");
        buttonViewSelected.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    if (schemaObj == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "schemaObj");
                    }
                    ICFBamTextTypeObj selectedInstance = getJavaFXFocusAsTextType();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("TXTT".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getTextTypeFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXTextTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamTextTypeObj");
                        }
                    }
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonViewSelected);

        buttonEditSelected = new CFButton();
        buttonEditSelected.setMinWidth(200);
        buttonEditSelected.setText("Edit Selected");
        buttonEditSelected.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    if (schemaObj == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "schemaObj");
                    }
                    ICFBamTextTypeObj selectedInstance = getJavaFXFocusAsTextType();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("TXTT".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getTextTypeFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXTextTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamTextTypeObj");
                        }
                    }
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonEditSelected);

        buttonDeleteSelected = new CFButton();
        buttonDeleteSelected.setMinWidth(200);
        buttonDeleteSelected.setText("Delete Selected");
        buttonDeleteSelected.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    if (schemaObj == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "schemaObj");
                    }
                    ICFBamTextTypeObj selectedInstance = getJavaFXFocusAsTextType();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("TXTT".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getTextTypeFactory()
                                    .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback());
                            ((ICFBamJavaFXTextTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamTextTypeObj");
                        }
                    }
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonDeleteSelected);

    }
    return (hboxMenu);
}

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

public CFHBox getPanelHBoxMenu() {
    if (hboxMenu == null) {
        hboxMenu = new CFHBox(10);
        buttonAddTokenCol = new CFButton();
        buttonAddTokenCol.setMinWidth(200);
        buttonAddTokenCol.setText("Add TokenCol");
        buttonAddTokenCol.setOnAction(new EventHandler<ActionEvent>() {
            @Override// ww w  . j av a2 s .c o m
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamTokenColObj obj = (ICFBamTokenColObj) schemaObj.getTokenColTableObj().newInstance();
                    ICFBamTokenColEditObj edit = (ICFBamTokenColEditObj) (obj.beginEdit());
                    if (edit == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "edit");
                    }
                    ICFSecurityTenantObj secTenant = schemaObj.getSecTenant();
                    edit.setRequiredOwnerTenant(secTenant);
                    ICFBamTableObj container = (ICFBamTableObj) (getJavaFXContainer());
                    if (container == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "JavaFXContainer");
                    }
                    edit.setRequiredContainerTable(container);
                    CFBorderPane frame = javafxSchema.getTokenColFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamJavaFXTokenColPaneCommon jpanelCommon = (ICFBamJavaFXTokenColPaneCommon) frame;
                    jpanelCommon.setJavaFXFocus(obj);
                    jpanelCommon.setPaneMode(CFPane.PaneMode.Add);
                    cfFormManager.pushForm(frame);
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonAddTokenCol);
        buttonViewSelected = new CFButton();
        buttonViewSelected.setMinWidth(200);
        buttonViewSelected.setText("View Selected");
        buttonViewSelected.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    if (schemaObj == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "schemaObj");
                    }
                    ICFBamTokenColObj selectedInstance = getJavaFXFocusAsTokenCol();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("TKNC".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getTokenColFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXTokenColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamTokenColObj");
                        }
                    }
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonViewSelected);

        buttonEditSelected = new CFButton();
        buttonEditSelected.setMinWidth(200);
        buttonEditSelected.setText("Edit Selected");
        buttonEditSelected.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    if (schemaObj == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "schemaObj");
                    }
                    ICFBamTokenColObj selectedInstance = getJavaFXFocusAsTokenCol();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("TKNC".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getTokenColFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXTokenColPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamTokenColObj");
                        }
                    }
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonEditSelected);

        buttonDeleteSelected = new CFButton();
        buttonDeleteSelected.setMinWidth(200);
        buttonDeleteSelected.setText("Delete Selected");
        buttonDeleteSelected.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    if (schemaObj == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "schemaObj");
                    }
                    ICFBamTokenColObj selectedInstance = getJavaFXFocusAsTokenCol();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("TKNC".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getTokenColFactory()
                                    .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback());
                            ((ICFBamJavaFXTokenColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamTokenColObj");
                        }
                    }
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonDeleteSelected);

    }
    return (hboxMenu);
}

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

public CFHBox getPanelHBoxMenu() {
    if (hboxMenu == null) {
        hboxMenu = new CFHBox(10);
        buttonAddUInt32Col = new CFButton();
        buttonAddUInt32Col.setMinWidth(200);
        buttonAddUInt32Col.setText("Add UInt32Col");
        buttonAddUInt32Col.setOnAction(new EventHandler<ActionEvent>() {
            @Override/*w  w w  . jav  a2  s.  com*/
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamUInt32ColObj obj = (ICFBamUInt32ColObj) schemaObj.getUInt32ColTableObj()
                            .newInstance();
                    ICFBamUInt32ColEditObj edit = (ICFBamUInt32ColEditObj) (obj.beginEdit());
                    if (edit == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "edit");
                    }
                    ICFSecurityTenantObj secTenant = schemaObj.getSecTenant();
                    edit.setRequiredOwnerTenant(secTenant);
                    ICFBamTableObj container = (ICFBamTableObj) (getJavaFXContainer());
                    if (container == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "JavaFXContainer");
                    }
                    edit.setRequiredContainerTable(container);
                    CFBorderPane frame = javafxSchema.getUInt32ColFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamJavaFXUInt32ColPaneCommon jpanelCommon = (ICFBamJavaFXUInt32ColPaneCommon) frame;
                    jpanelCommon.setJavaFXFocus(obj);
                    jpanelCommon.setPaneMode(CFPane.PaneMode.Add);
                    cfFormManager.pushForm(frame);
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonAddUInt32Col);
        buttonViewSelected = new CFButton();
        buttonViewSelected.setMinWidth(200);
        buttonViewSelected.setText("View Selected");
        buttonViewSelected.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    if (schemaObj == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "schemaObj");
                    }
                    ICFBamUInt32ColObj selectedInstance = getJavaFXFocusAsUInt32Col();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("U32C".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getUInt32ColFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXUInt32ColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamUInt32ColObj");
                        }
                    }
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonViewSelected);

        buttonEditSelected = new CFButton();
        buttonEditSelected.setMinWidth(200);
        buttonEditSelected.setText("Edit Selected");
        buttonEditSelected.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    if (schemaObj == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "schemaObj");
                    }
                    ICFBamUInt32ColObj selectedInstance = getJavaFXFocusAsUInt32Col();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("U32C".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getUInt32ColFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXUInt32ColPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamUInt32ColObj");
                        }
                    }
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonEditSelected);

        buttonDeleteSelected = new CFButton();
        buttonDeleteSelected.setMinWidth(200);
        buttonDeleteSelected.setText("Delete Selected");
        buttonDeleteSelected.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    if (schemaObj == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "schemaObj");
                    }
                    ICFBamUInt32ColObj selectedInstance = getJavaFXFocusAsUInt32Col();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("U32C".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getUInt32ColFactory()
                                    .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback());
                            ((ICFBamJavaFXUInt32ColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamUInt32ColObj");
                        }
                    }
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonDeleteSelected);

    }
    return (hboxMenu);
}