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.CFBamJavaFXUInt16DefListPane.java

public CFHBox getPanelHBoxMenu() {
    if (hboxMenu == null) {
        hboxMenu = new CFHBox(10);
        LinkedList<CFButton> list = new LinkedList<CFButton>();

        vboxMenuAdd = new CFVBox(10);
        buttonAddUInt16Type = new CFButton();
        buttonAddUInt16Type.setMinWidth(200);
        buttonAddUInt16Type.setText("Add UInt16Type");
        buttonAddUInt16Type.setOnAction(new EventHandler<ActionEvent>() {
            @Override//from   w w  w  .  ja  v  a  2 s .  c o m
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamUInt16TypeObj obj = (ICFBamUInt16TypeObj) schemaObj.getUInt16TypeTableObj()
                            .newInstance();
                    CFBorderPane frame = javafxSchema.getUInt16TypeFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamUInt16TypeEditObj edit = (ICFBamUInt16TypeEditObj) (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);
                    ICFBamJavaFXUInt16TypePaneCommon jpanelCommon = (ICFBamJavaFXUInt16TypePaneCommon) frame;
                    jpanelCommon.setJavaFXFocus(obj);
                    jpanelCommon.setPaneMode(CFPane.PaneMode.Add);
                    cfFormManager.pushForm(frame);
                    setLeft(null);
                    adjustListButtons();
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        if (javafxContainer instanceof ICFBamSchemaDefObj) {
            list.add(buttonAddUInt16Type);
        }
        buttonAddUInt16Col = new CFButton();
        buttonAddUInt16Col.setMinWidth(200);
        buttonAddUInt16Col.setText("Add UInt16Col");
        buttonAddUInt16Col.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamUInt16ColObj obj = (ICFBamUInt16ColObj) schemaObj.getUInt16ColTableObj()
                            .newInstance();
                    CFBorderPane frame = javafxSchema.getUInt16ColFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamUInt16ColEditObj edit = (ICFBamUInt16ColEditObj) (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);
                    ICFBamJavaFXUInt16ColPaneCommon jpanelCommon = (ICFBamJavaFXUInt16ColPaneCommon) frame;
                    jpanelCommon.setJavaFXFocus(obj);
                    jpanelCommon.setPaneMode(CFPane.PaneMode.Add);
                    cfFormManager.pushForm(frame);
                    setLeft(null);
                    adjustListButtons();
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        if (javafxContainer instanceof ICFBamTableObj) {
            list.add(buttonAddUInt16Col);
        }

        int len = list.size();
        CFButton arr[] = new CFButton[len];
        Iterator<CFButton> iter = list.iterator();
        int idx = 0;
        while (iter.hasNext()) {
            arr[idx++] = iter.next();
        }
        Arrays.sort(arr, new CompareCFButtonByText());
        for (idx = 0; idx < len; idx++) {
            vboxMenuAdd.getChildren().add(arr[idx]);
        }

        buttonCancelAdd = new CFButton();
        buttonCancelAdd.setMinWidth(200);
        buttonCancelAdd.setText("Cancel Add...");
        buttonCancelAdd.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    setLeft(null);
                    adjustListButtons();
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        vboxMenuAdd.getChildren().add(buttonCancelAdd);

        scrollMenuAdd = new ScrollPane();
        scrollMenuAdd.setMinWidth(240);
        scrollMenuAdd.setMaxWidth(240);
        scrollMenuAdd.setFitToWidth(true);
        scrollMenuAdd.setHbarPolicy(ScrollBarPolicy.NEVER);
        scrollMenuAdd.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
        scrollMenuAdd.setContent(vboxMenuAdd);

        buttonAdd = new CFButton();
        buttonAdd.setMinWidth(200);
        buttonAdd.setText("Add...");
        buttonAdd.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    setLeft(scrollMenuAdd);
                    adjustListButtons();
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonAdd);

        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");
                    }
                    ICFBamUInt16DefObj selectedInstance = getJavaFXFocusAsUInt16Def();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("U16D".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getUInt16DefFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXUInt16DefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("U16T".equals(classCode)) {
                            ICFBamUInt16TypeObj obj = (ICFBamUInt16TypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getUInt16TypeFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXUInt16TypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("U16C".equals(classCode)) {
                            ICFBamUInt16ColObj obj = (ICFBamUInt16ColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getUInt16ColFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXUInt16ColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamUInt16DefObj, ICFBamUInt16TypeObj, ICFBamUInt16ColObj");
                        }
                    }
                } 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");
                    }
                    ICFBamUInt16DefObj selectedInstance = getJavaFXFocusAsUInt16Def();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("U16D".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getUInt16DefFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXUInt16DefPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else if ("U16T".equals(classCode)) {
                            ICFBamUInt16TypeObj obj = (ICFBamUInt16TypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getUInt16TypeFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXUInt16TypePaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else if ("U16C".equals(classCode)) {
                            ICFBamUInt16ColObj obj = (ICFBamUInt16ColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getUInt16ColFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXUInt16ColPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamUInt16DefObj, ICFBamUInt16TypeObj, ICFBamUInt16ColObj");
                        }
                    }
                } 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");
                    }
                    ICFBamUInt16DefObj selectedInstance = getJavaFXFocusAsUInt16Def();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("U16D".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getUInt16DefFactory()
                                    .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback());
                            ((ICFBamJavaFXUInt16DefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("U16T".equals(classCode)) {
                            ICFBamUInt16TypeObj obj = (ICFBamUInt16TypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getUInt16TypeFactory()
                                    .newAskDeleteForm(cfFormManager, obj, getDeleteCallback());
                            ((ICFBamJavaFXUInt16TypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("U16C".equals(classCode)) {
                            ICFBamUInt16ColObj obj = (ICFBamUInt16ColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getUInt16ColFactory()
                                    .newAskDeleteForm(cfFormManager, obj, getDeleteCallback());
                            ((ICFBamJavaFXUInt16ColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamUInt16DefObj, ICFBamUInt16TypeObj, ICFBamUInt16ColObj");
                        }
                    }
                } 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.CFBamJavaFXTZDateDefListPane.java

public CFHBox getPanelHBoxMenu() {
    if (hboxMenu == null) {
        hboxMenu = new CFHBox(10);
        LinkedList<CFButton> list = new LinkedList<CFButton>();

        vboxMenuAdd = new CFVBox(10);
        buttonAddTZDateType = new CFButton();
        buttonAddTZDateType.setMinWidth(200);
        buttonAddTZDateType.setText("Add TZDateType");
        buttonAddTZDateType.setOnAction(new EventHandler<ActionEvent>() {
            @Override// w w  w . j  a va 2  s.  co m
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamTZDateTypeObj obj = (ICFBamTZDateTypeObj) schemaObj.getTZDateTypeTableObj()
                            .newInstance();
                    CFBorderPane frame = javafxSchema.getTZDateTypeFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamTZDateTypeEditObj edit = (ICFBamTZDateTypeEditObj) (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);
                    ICFBamJavaFXTZDateTypePaneCommon jpanelCommon = (ICFBamJavaFXTZDateTypePaneCommon) frame;
                    jpanelCommon.setJavaFXFocus(obj);
                    jpanelCommon.setPaneMode(CFPane.PaneMode.Add);
                    cfFormManager.pushForm(frame);
                    setLeft(null);
                    adjustListButtons();
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        if (javafxContainer instanceof ICFBamSchemaDefObj) {
            list.add(buttonAddTZDateType);
        }
        buttonAddTZDateCol = new CFButton();
        buttonAddTZDateCol.setMinWidth(200);
        buttonAddTZDateCol.setText("Add TZDateCol");
        buttonAddTZDateCol.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamTZDateColObj obj = (ICFBamTZDateColObj) schemaObj.getTZDateColTableObj()
                            .newInstance();
                    CFBorderPane frame = javafxSchema.getTZDateColFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamTZDateColEditObj edit = (ICFBamTZDateColEditObj) (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);
                    ICFBamJavaFXTZDateColPaneCommon jpanelCommon = (ICFBamJavaFXTZDateColPaneCommon) frame;
                    jpanelCommon.setJavaFXFocus(obj);
                    jpanelCommon.setPaneMode(CFPane.PaneMode.Add);
                    cfFormManager.pushForm(frame);
                    setLeft(null);
                    adjustListButtons();
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        if (javafxContainer instanceof ICFBamTableObj) {
            list.add(buttonAddTZDateCol);
        }

        int len = list.size();
        CFButton arr[] = new CFButton[len];
        Iterator<CFButton> iter = list.iterator();
        int idx = 0;
        while (iter.hasNext()) {
            arr[idx++] = iter.next();
        }
        Arrays.sort(arr, new CompareCFButtonByText());
        for (idx = 0; idx < len; idx++) {
            vboxMenuAdd.getChildren().add(arr[idx]);
        }

        buttonCancelAdd = new CFButton();
        buttonCancelAdd.setMinWidth(200);
        buttonCancelAdd.setText("Cancel Add...");
        buttonCancelAdd.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    setLeft(null);
                    adjustListButtons();
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        vboxMenuAdd.getChildren().add(buttonCancelAdd);

        scrollMenuAdd = new ScrollPane();
        scrollMenuAdd.setMinWidth(240);
        scrollMenuAdd.setMaxWidth(240);
        scrollMenuAdd.setFitToWidth(true);
        scrollMenuAdd.setHbarPolicy(ScrollBarPolicy.NEVER);
        scrollMenuAdd.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
        scrollMenuAdd.setContent(vboxMenuAdd);

        buttonAdd = new CFButton();
        buttonAdd.setMinWidth(200);
        buttonAdd.setText("Add...");
        buttonAdd.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    setLeft(scrollMenuAdd);
                    adjustListButtons();
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonAdd);

        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");
                    }
                    ICFBamTZDateDefObj selectedInstance = getJavaFXFocusAsTZDateDef();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("DAZD".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getTZDateDefFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXTZDateDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("DAZT".equals(classCode)) {
                            ICFBamTZDateTypeObj obj = (ICFBamTZDateTypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getTZDateTypeFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXTZDateTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("DAZC".equals(classCode)) {
                            ICFBamTZDateColObj obj = (ICFBamTZDateColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getTZDateColFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXTZDateColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamTZDateDefObj, ICFBamTZDateTypeObj, ICFBamTZDateColObj");
                        }
                    }
                } 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");
                    }
                    ICFBamTZDateDefObj selectedInstance = getJavaFXFocusAsTZDateDef();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("DAZD".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getTZDateDefFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXTZDateDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else if ("DAZT".equals(classCode)) {
                            ICFBamTZDateTypeObj obj = (ICFBamTZDateTypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getTZDateTypeFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXTZDateTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else if ("DAZC".equals(classCode)) {
                            ICFBamTZDateColObj obj = (ICFBamTZDateColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getTZDateColFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXTZDateColPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamTZDateDefObj, ICFBamTZDateTypeObj, ICFBamTZDateColObj");
                        }
                    }
                } 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");
                    }
                    ICFBamTZDateDefObj selectedInstance = getJavaFXFocusAsTZDateDef();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("DAZD".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getTZDateDefFactory()
                                    .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback());
                            ((ICFBamJavaFXTZDateDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("DAZT".equals(classCode)) {
                            ICFBamTZDateTypeObj obj = (ICFBamTZDateTypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getTZDateTypeFactory()
                                    .newAskDeleteForm(cfFormManager, obj, getDeleteCallback());
                            ((ICFBamJavaFXTZDateTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("DAZC".equals(classCode)) {
                            ICFBamTZDateColObj obj = (ICFBamTZDateColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getTZDateColFactory()
                                    .newAskDeleteForm(cfFormManager, obj, getDeleteCallback());
                            ((ICFBamJavaFXTZDateColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamTZDateDefObj, ICFBamTZDateTypeObj, ICFBamTZDateColObj");
                        }
                    }
                } 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.CFBamJavaFXRelationListPane.java

public CFHBox getPanelHBoxMenu() {
    if (hboxMenu == null) {
        hboxMenu = new CFHBox(10);
        buttonAddRelation = new CFButton();
        buttonAddRelation.setMinWidth(200);
        buttonAddRelation.setText("Add Relation");
        buttonAddRelation.setOnAction(new EventHandler<ActionEvent>() {
            @Override/*  www  .j  av  a2 s.co m*/
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamRelationObj obj = (ICFBamRelationObj) schemaObj.getRelationTableObj().newInstance();
                    ICFBamRelationEditObj edit = (ICFBamRelationEditObj) (obj.beginEdit());
                    if (edit == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "edit");
                    }
                    ICFSecurityTenantObj secTenant = schemaObj.getSecTenant();
                    edit.setRequiredOwnerRelTenant(secTenant);
                    ICFBamTableObj container = (ICFBamTableObj) (getJavaFXContainer());
                    if (container == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "JavaFXContainer");
                    }
                    edit.setRequiredContainerFromTable(container);
                    CFBorderPane frame = javafxSchema.getRelationFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamJavaFXRelationPaneCommon jpanelCommon = (ICFBamJavaFXRelationPaneCommon) 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(buttonAddRelation);
        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");
                    }
                    ICFBamRelationObj selectedInstance = getJavaFXFocusAsRelation();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("RELD".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getRelationFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXRelationPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamRelationObj");
                        }
                    }
                } 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");
                    }
                    ICFBamRelationObj selectedInstance = getJavaFXFocusAsRelation();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("RELD".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getRelationFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXRelationPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamRelationObj");
                        }
                    }
                } 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");
                    }
                    ICFBamRelationObj selectedInstance = getJavaFXFocusAsRelation();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("RELD".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getRelationFactory()
                                    .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback());
                            ((ICFBamJavaFXRelationPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamRelationObj");
                        }
                    }
                } 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.CFBamJavaFXUInt64DefListPane.java

public CFHBox getPanelHBoxMenu() {
    if (hboxMenu == null) {
        hboxMenu = new CFHBox(10);
        LinkedList<CFButton> list = new LinkedList<CFButton>();

        vboxMenuAdd = new CFVBox(10);
        buttonAddUInt64Type = new CFButton();
        buttonAddUInt64Type.setMinWidth(200);
        buttonAddUInt64Type.setText("Add UInt64Type");
        buttonAddUInt64Type.setOnAction(new EventHandler<ActionEvent>() {
            @Override//from  ww  w  .  j  a  va  2s . c o  m
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamUInt64TypeObj obj = (ICFBamUInt64TypeObj) schemaObj.getUInt64TypeTableObj()
                            .newInstance();
                    CFBorderPane frame = javafxSchema.getUInt64TypeFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamUInt64TypeEditObj edit = (ICFBamUInt64TypeEditObj) (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);
                    ICFBamJavaFXUInt64TypePaneCommon jpanelCommon = (ICFBamJavaFXUInt64TypePaneCommon) frame;
                    jpanelCommon.setJavaFXFocus(obj);
                    jpanelCommon.setPaneMode(CFPane.PaneMode.Add);
                    cfFormManager.pushForm(frame);
                    setLeft(null);
                    adjustListButtons();
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        if (javafxContainer instanceof ICFBamSchemaDefObj) {
            list.add(buttonAddUInt64Type);
        }
        buttonAddUInt64Col = new CFButton();
        buttonAddUInt64Col.setMinWidth(200);
        buttonAddUInt64Col.setText("Add UInt64Col");
        buttonAddUInt64Col.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamUInt64ColObj obj = (ICFBamUInt64ColObj) schemaObj.getUInt64ColTableObj()
                            .newInstance();
                    CFBorderPane frame = javafxSchema.getUInt64ColFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamUInt64ColEditObj edit = (ICFBamUInt64ColEditObj) (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);
                    ICFBamJavaFXUInt64ColPaneCommon jpanelCommon = (ICFBamJavaFXUInt64ColPaneCommon) frame;
                    jpanelCommon.setJavaFXFocus(obj);
                    jpanelCommon.setPaneMode(CFPane.PaneMode.Add);
                    cfFormManager.pushForm(frame);
                    setLeft(null);
                    adjustListButtons();
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        if (javafxContainer instanceof ICFBamTableObj) {
            list.add(buttonAddUInt64Col);
        }

        int len = list.size();
        CFButton arr[] = new CFButton[len];
        Iterator<CFButton> iter = list.iterator();
        int idx = 0;
        while (iter.hasNext()) {
            arr[idx++] = iter.next();
        }
        Arrays.sort(arr, new CompareCFButtonByText());
        for (idx = 0; idx < len; idx++) {
            vboxMenuAdd.getChildren().add(arr[idx]);
        }

        buttonCancelAdd = new CFButton();
        buttonCancelAdd.setMinWidth(200);
        buttonCancelAdd.setText("Cancel Add...");
        buttonCancelAdd.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    setLeft(null);
                    adjustListButtons();
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        vboxMenuAdd.getChildren().add(buttonCancelAdd);

        scrollMenuAdd = new ScrollPane();
        scrollMenuAdd.setMinWidth(240);
        scrollMenuAdd.setMaxWidth(240);
        scrollMenuAdd.setFitToWidth(true);
        scrollMenuAdd.setHbarPolicy(ScrollBarPolicy.NEVER);
        scrollMenuAdd.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
        scrollMenuAdd.setContent(vboxMenuAdd);

        buttonAdd = new CFButton();
        buttonAdd.setMinWidth(200);
        buttonAdd.setText("Add...");
        buttonAdd.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    setLeft(scrollMenuAdd);
                    adjustListButtons();
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonAdd);

        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");
                    }
                    ICFBamUInt64DefObj selectedInstance = getJavaFXFocusAsUInt64Def();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("U64D".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getUInt64DefFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXUInt64DefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("U64T".equals(classCode)) {
                            ICFBamUInt64TypeObj obj = (ICFBamUInt64TypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getUInt64TypeFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXUInt64TypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("U64C".equals(classCode)) {
                            ICFBamUInt64ColObj obj = (ICFBamUInt64ColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getUInt64ColFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXUInt64ColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamUInt64DefObj, ICFBamUInt64TypeObj, ICFBamUInt64ColObj");
                        }
                    }
                } 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");
                    }
                    ICFBamUInt64DefObj selectedInstance = getJavaFXFocusAsUInt64Def();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("U64D".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getUInt64DefFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXUInt64DefPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else if ("U64T".equals(classCode)) {
                            ICFBamUInt64TypeObj obj = (ICFBamUInt64TypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getUInt64TypeFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXUInt64TypePaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else if ("U64C".equals(classCode)) {
                            ICFBamUInt64ColObj obj = (ICFBamUInt64ColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getUInt64ColFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXUInt64ColPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamUInt64DefObj, ICFBamUInt64TypeObj, ICFBamUInt64ColObj");
                        }
                    }
                } 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");
                    }
                    ICFBamUInt64DefObj selectedInstance = getJavaFXFocusAsUInt64Def();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("U64D".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getUInt64DefFactory()
                                    .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback());
                            ((ICFBamJavaFXUInt64DefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("U64T".equals(classCode)) {
                            ICFBamUInt64TypeObj obj = (ICFBamUInt64TypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getUInt64TypeFactory()
                                    .newAskDeleteForm(cfFormManager, obj, getDeleteCallback());
                            ((ICFBamJavaFXUInt64TypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("U64C".equals(classCode)) {
                            ICFBamUInt64ColObj obj = (ICFBamUInt64ColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getUInt64ColFactory()
                                    .newAskDeleteForm(cfFormManager, obj, getDeleteCallback());
                            ((ICFBamJavaFXUInt64ColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamUInt64DefObj, ICFBamUInt64TypeObj, ICFBamUInt64ColObj");
                        }
                    }
                } 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.CFBamJavaFXNmTokenDefListPane.java

public CFHBox getPanelHBoxMenu() {
    if (hboxMenu == null) {
        hboxMenu = new CFHBox(10);
        LinkedList<CFButton> list = new LinkedList<CFButton>();

        vboxMenuAdd = new CFVBox(10);
        buttonAddNmTokenType = new CFButton();
        buttonAddNmTokenType.setMinWidth(200);
        buttonAddNmTokenType.setText("Add NmTokenType");
        buttonAddNmTokenType.setOnAction(new EventHandler<ActionEvent>() {
            @Override//from   w  ww .  j  a  va  2 s.c  om
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamNmTokenTypeObj obj = (ICFBamNmTokenTypeObj) schemaObj.getNmTokenTypeTableObj()
                            .newInstance();
                    CFBorderPane frame = javafxSchema.getNmTokenTypeFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamNmTokenTypeEditObj edit = (ICFBamNmTokenTypeEditObj) (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);
                    ICFBamJavaFXNmTokenTypePaneCommon jpanelCommon = (ICFBamJavaFXNmTokenTypePaneCommon) frame;
                    jpanelCommon.setJavaFXFocus(obj);
                    jpanelCommon.setPaneMode(CFPane.PaneMode.Add);
                    cfFormManager.pushForm(frame);
                    setLeft(null);
                    adjustListButtons();
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        if (javafxContainer instanceof ICFBamSchemaDefObj) {
            list.add(buttonAddNmTokenType);
        }
        buttonAddNmTokenCol = new CFButton();
        buttonAddNmTokenCol.setMinWidth(200);
        buttonAddNmTokenCol.setText("Add NmTokenCol");
        buttonAddNmTokenCol.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamNmTokenColObj obj = (ICFBamNmTokenColObj) schemaObj.getNmTokenColTableObj()
                            .newInstance();
                    CFBorderPane frame = javafxSchema.getNmTokenColFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamNmTokenColEditObj edit = (ICFBamNmTokenColEditObj) (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);
                    ICFBamJavaFXNmTokenColPaneCommon jpanelCommon = (ICFBamJavaFXNmTokenColPaneCommon) frame;
                    jpanelCommon.setJavaFXFocus(obj);
                    jpanelCommon.setPaneMode(CFPane.PaneMode.Add);
                    cfFormManager.pushForm(frame);
                    setLeft(null);
                    adjustListButtons();
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        if (javafxContainer instanceof ICFBamTableObj) {
            list.add(buttonAddNmTokenCol);
        }

        int len = list.size();
        CFButton arr[] = new CFButton[len];
        Iterator<CFButton> iter = list.iterator();
        int idx = 0;
        while (iter.hasNext()) {
            arr[idx++] = iter.next();
        }
        Arrays.sort(arr, new CompareCFButtonByText());
        for (idx = 0; idx < len; idx++) {
            vboxMenuAdd.getChildren().add(arr[idx]);
        }

        buttonCancelAdd = new CFButton();
        buttonCancelAdd.setMinWidth(200);
        buttonCancelAdd.setText("Cancel Add...");
        buttonCancelAdd.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    setLeft(null);
                    adjustListButtons();
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        vboxMenuAdd.getChildren().add(buttonCancelAdd);

        scrollMenuAdd = new ScrollPane();
        scrollMenuAdd.setMinWidth(240);
        scrollMenuAdd.setMaxWidth(240);
        scrollMenuAdd.setFitToWidth(true);
        scrollMenuAdd.setHbarPolicy(ScrollBarPolicy.NEVER);
        scrollMenuAdd.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
        scrollMenuAdd.setContent(vboxMenuAdd);

        buttonAdd = new CFButton();
        buttonAdd.setMinWidth(200);
        buttonAdd.setText("Add...");
        buttonAdd.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    setLeft(scrollMenuAdd);
                    adjustListButtons();
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonAdd);

        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");
                    }
                    ICFBamNmTokenDefObj selectedInstance = getJavaFXFocusAsNmTokenDef();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("NTKD".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getNmTokenDefFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXNmTokenDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("NTKT".equals(classCode)) {
                            ICFBamNmTokenTypeObj obj = (ICFBamNmTokenTypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getNmTokenTypeFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXNmTokenTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("NTKC".equals(classCode)) {
                            ICFBamNmTokenColObj obj = (ICFBamNmTokenColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getNmTokenColFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXNmTokenColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamNmTokenDefObj, ICFBamNmTokenTypeObj, ICFBamNmTokenColObj");
                        }
                    }
                } 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");
                    }
                    ICFBamNmTokenDefObj selectedInstance = getJavaFXFocusAsNmTokenDef();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("NTKD".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getNmTokenDefFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXNmTokenDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else if ("NTKT".equals(classCode)) {
                            ICFBamNmTokenTypeObj obj = (ICFBamNmTokenTypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getNmTokenTypeFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXNmTokenTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else if ("NTKC".equals(classCode)) {
                            ICFBamNmTokenColObj obj = (ICFBamNmTokenColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getNmTokenColFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXNmTokenColPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamNmTokenDefObj, ICFBamNmTokenTypeObj, ICFBamNmTokenColObj");
                        }
                    }
                } 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");
                    }
                    ICFBamNmTokenDefObj selectedInstance = getJavaFXFocusAsNmTokenDef();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("NTKD".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getNmTokenDefFactory()
                                    .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback());
                            ((ICFBamJavaFXNmTokenDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("NTKT".equals(classCode)) {
                            ICFBamNmTokenTypeObj obj = (ICFBamNmTokenTypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getNmTokenTypeFactory()
                                    .newAskDeleteForm(cfFormManager, obj, getDeleteCallback());
                            ((ICFBamJavaFXNmTokenTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("NTKC".equals(classCode)) {
                            ICFBamNmTokenColObj obj = (ICFBamNmTokenColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getNmTokenColFactory()
                                    .newAskDeleteForm(cfFormManager, obj, getDeleteCallback());
                            ((ICFBamJavaFXNmTokenColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamNmTokenDefObj, ICFBamNmTokenTypeObj, ICFBamNmTokenColObj");
                        }
                    }
                } 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.CFBamJavaFXNmTokensDefListPane.java

public CFHBox getPanelHBoxMenu() {
    if (hboxMenu == null) {
        hboxMenu = new CFHBox(10);
        LinkedList<CFButton> list = new LinkedList<CFButton>();

        vboxMenuAdd = new CFVBox(10);
        buttonAddNmTokensType = new CFButton();
        buttonAddNmTokensType.setMinWidth(200);
        buttonAddNmTokensType.setText("Add NmTokensType");
        buttonAddNmTokensType.setOnAction(new EventHandler<ActionEvent>() {
            @Override//w w w.ja v  a  2 s.  c o  m
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamNmTokensTypeObj obj = (ICFBamNmTokensTypeObj) schemaObj.getNmTokensTypeTableObj()
                            .newInstance();
                    CFBorderPane frame = javafxSchema.getNmTokensTypeFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamNmTokensTypeEditObj edit = (ICFBamNmTokensTypeEditObj) (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);
                    ICFBamJavaFXNmTokensTypePaneCommon jpanelCommon = (ICFBamJavaFXNmTokensTypePaneCommon) frame;
                    jpanelCommon.setJavaFXFocus(obj);
                    jpanelCommon.setPaneMode(CFPane.PaneMode.Add);
                    cfFormManager.pushForm(frame);
                    setLeft(null);
                    adjustListButtons();
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        if (javafxContainer instanceof ICFBamSchemaDefObj) {
            list.add(buttonAddNmTokensType);
        }
        buttonAddNmTokensCol = new CFButton();
        buttonAddNmTokensCol.setMinWidth(200);
        buttonAddNmTokensCol.setText("Add NmTokensCol");
        buttonAddNmTokensCol.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamNmTokensColObj obj = (ICFBamNmTokensColObj) schemaObj.getNmTokensColTableObj()
                            .newInstance();
                    CFBorderPane frame = javafxSchema.getNmTokensColFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamNmTokensColEditObj edit = (ICFBamNmTokensColEditObj) (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);
                    ICFBamJavaFXNmTokensColPaneCommon jpanelCommon = (ICFBamJavaFXNmTokensColPaneCommon) frame;
                    jpanelCommon.setJavaFXFocus(obj);
                    jpanelCommon.setPaneMode(CFPane.PaneMode.Add);
                    cfFormManager.pushForm(frame);
                    setLeft(null);
                    adjustListButtons();
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        if (javafxContainer instanceof ICFBamTableObj) {
            list.add(buttonAddNmTokensCol);
        }

        int len = list.size();
        CFButton arr[] = new CFButton[len];
        Iterator<CFButton> iter = list.iterator();
        int idx = 0;
        while (iter.hasNext()) {
            arr[idx++] = iter.next();
        }
        Arrays.sort(arr, new CompareCFButtonByText());
        for (idx = 0; idx < len; idx++) {
            vboxMenuAdd.getChildren().add(arr[idx]);
        }

        buttonCancelAdd = new CFButton();
        buttonCancelAdd.setMinWidth(200);
        buttonCancelAdd.setText("Cancel Add...");
        buttonCancelAdd.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    setLeft(null);
                    adjustListButtons();
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        vboxMenuAdd.getChildren().add(buttonCancelAdd);

        scrollMenuAdd = new ScrollPane();
        scrollMenuAdd.setMinWidth(240);
        scrollMenuAdd.setMaxWidth(240);
        scrollMenuAdd.setFitToWidth(true);
        scrollMenuAdd.setHbarPolicy(ScrollBarPolicy.NEVER);
        scrollMenuAdd.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
        scrollMenuAdd.setContent(vboxMenuAdd);

        buttonAdd = new CFButton();
        buttonAdd.setMinWidth(200);
        buttonAdd.setText("Add...");
        buttonAdd.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    setLeft(scrollMenuAdd);
                    adjustListButtons();
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonAdd);

        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");
                    }
                    ICFBamNmTokensDefObj selectedInstance = getJavaFXFocusAsNmTokensDef();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("NTSD".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getNmTokensDefFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXNmTokensDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("NTST".equals(classCode)) {
                            ICFBamNmTokensTypeObj obj = (ICFBamNmTokensTypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getNmTokensTypeFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXNmTokensTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("NTSC".equals(classCode)) {
                            ICFBamNmTokensColObj obj = (ICFBamNmTokensColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getNmTokensColFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXNmTokensColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamNmTokensDefObj, ICFBamNmTokensTypeObj, ICFBamNmTokensColObj");
                        }
                    }
                } 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");
                    }
                    ICFBamNmTokensDefObj selectedInstance = getJavaFXFocusAsNmTokensDef();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("NTSD".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getNmTokensDefFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXNmTokensDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else if ("NTST".equals(classCode)) {
                            ICFBamNmTokensTypeObj obj = (ICFBamNmTokensTypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getNmTokensTypeFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXNmTokensTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else if ("NTSC".equals(classCode)) {
                            ICFBamNmTokensColObj obj = (ICFBamNmTokensColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getNmTokensColFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXNmTokensColPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamNmTokensDefObj, ICFBamNmTokensTypeObj, ICFBamNmTokensColObj");
                        }
                    }
                } 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");
                    }
                    ICFBamNmTokensDefObj selectedInstance = getJavaFXFocusAsNmTokensDef();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("NTSD".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getNmTokensDefFactory()
                                    .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback());
                            ((ICFBamJavaFXNmTokensDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("NTST".equals(classCode)) {
                            ICFBamNmTokensTypeObj obj = (ICFBamNmTokensTypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getNmTokensTypeFactory()
                                    .newAskDeleteForm(cfFormManager, obj, getDeleteCallback());
                            ((ICFBamJavaFXNmTokensTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("NTSC".equals(classCode)) {
                            ICFBamNmTokensColObj obj = (ICFBamNmTokensColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getNmTokensColFactory()
                                    .newAskDeleteForm(cfFormManager, obj, getDeleteCallback());
                            ((ICFBamJavaFXNmTokensColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamNmTokensDefObj, ICFBamNmTokensTypeObj, ICFBamNmTokensColObj");
                        }
                    }
                } 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.CFBamJavaFXTimestampDefListPane.java

public CFHBox getPanelHBoxMenu() {
    if (hboxMenu == null) {
        hboxMenu = new CFHBox(10);
        LinkedList<CFButton> list = new LinkedList<CFButton>();

        vboxMenuAdd = new CFVBox(10);
        buttonAddTimestampType = new CFButton();
        buttonAddTimestampType.setMinWidth(200);
        buttonAddTimestampType.setText("Add TimestampType");
        buttonAddTimestampType.setOnAction(new EventHandler<ActionEvent>() {
            @Override/* ww w . j  av a  2 s . c o m*/
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamTimestampTypeObj obj = (ICFBamTimestampTypeObj) schemaObj.getTimestampTypeTableObj()
                            .newInstance();
                    CFBorderPane frame = javafxSchema.getTimestampTypeFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamTimestampTypeEditObj edit = (ICFBamTimestampTypeEditObj) (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);
                    ICFBamJavaFXTimestampTypePaneCommon jpanelCommon = (ICFBamJavaFXTimestampTypePaneCommon) frame;
                    jpanelCommon.setJavaFXFocus(obj);
                    jpanelCommon.setPaneMode(CFPane.PaneMode.Add);
                    cfFormManager.pushForm(frame);
                    setLeft(null);
                    adjustListButtons();
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        if (javafxContainer instanceof ICFBamSchemaDefObj) {
            list.add(buttonAddTimestampType);
        }
        buttonAddTimestampCol = new CFButton();
        buttonAddTimestampCol.setMinWidth(200);
        buttonAddTimestampCol.setText("Add TimestampCol");
        buttonAddTimestampCol.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamTimestampColObj obj = (ICFBamTimestampColObj) schemaObj.getTimestampColTableObj()
                            .newInstance();
                    CFBorderPane frame = javafxSchema.getTimestampColFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamTimestampColEditObj edit = (ICFBamTimestampColEditObj) (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);
                    ICFBamJavaFXTimestampColPaneCommon jpanelCommon = (ICFBamJavaFXTimestampColPaneCommon) frame;
                    jpanelCommon.setJavaFXFocus(obj);
                    jpanelCommon.setPaneMode(CFPane.PaneMode.Add);
                    cfFormManager.pushForm(frame);
                    setLeft(null);
                    adjustListButtons();
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        if (javafxContainer instanceof ICFBamTableObj) {
            list.add(buttonAddTimestampCol);
        }

        int len = list.size();
        CFButton arr[] = new CFButton[len];
        Iterator<CFButton> iter = list.iterator();
        int idx = 0;
        while (iter.hasNext()) {
            arr[idx++] = iter.next();
        }
        Arrays.sort(arr, new CompareCFButtonByText());
        for (idx = 0; idx < len; idx++) {
            vboxMenuAdd.getChildren().add(arr[idx]);
        }

        buttonCancelAdd = new CFButton();
        buttonCancelAdd.setMinWidth(200);
        buttonCancelAdd.setText("Cancel Add...");
        buttonCancelAdd.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    setLeft(null);
                    adjustListButtons();
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        vboxMenuAdd.getChildren().add(buttonCancelAdd);

        scrollMenuAdd = new ScrollPane();
        scrollMenuAdd.setMinWidth(240);
        scrollMenuAdd.setMaxWidth(240);
        scrollMenuAdd.setFitToWidth(true);
        scrollMenuAdd.setHbarPolicy(ScrollBarPolicy.NEVER);
        scrollMenuAdd.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
        scrollMenuAdd.setContent(vboxMenuAdd);

        buttonAdd = new CFButton();
        buttonAdd.setMinWidth(200);
        buttonAdd.setText("Add...");
        buttonAdd.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    setLeft(scrollMenuAdd);
                    adjustListButtons();
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonAdd);

        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");
                    }
                    ICFBamTimestampDefObj selectedInstance = getJavaFXFocusAsTimestampDef();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("TSPD".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getTimestampDefFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXTimestampDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("TSPT".equals(classCode)) {
                            ICFBamTimestampTypeObj obj = (ICFBamTimestampTypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getTimestampTypeFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXTimestampTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("TSPC".equals(classCode)) {
                            ICFBamTimestampColObj obj = (ICFBamTimestampColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getTimestampColFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXTimestampColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamTimestampDefObj, ICFBamTimestampTypeObj, ICFBamTimestampColObj");
                        }
                    }
                } 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");
                    }
                    ICFBamTimestampDefObj selectedInstance = getJavaFXFocusAsTimestampDef();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("TSPD".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getTimestampDefFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXTimestampDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else if ("TSPT".equals(classCode)) {
                            ICFBamTimestampTypeObj obj = (ICFBamTimestampTypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getTimestampTypeFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXTimestampTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else if ("TSPC".equals(classCode)) {
                            ICFBamTimestampColObj obj = (ICFBamTimestampColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getTimestampColFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXTimestampColPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamTimestampDefObj, ICFBamTimestampTypeObj, ICFBamTimestampColObj");
                        }
                    }
                } 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");
                    }
                    ICFBamTimestampDefObj selectedInstance = getJavaFXFocusAsTimestampDef();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("TSPD".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getTimestampDefFactory()
                                    .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback());
                            ((ICFBamJavaFXTimestampDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("TSPT".equals(classCode)) {
                            ICFBamTimestampTypeObj obj = (ICFBamTimestampTypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getTimestampTypeFactory()
                                    .newAskDeleteForm(cfFormManager, obj, getDeleteCallback());
                            ((ICFBamJavaFXTimestampTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("TSPC".equals(classCode)) {
                            ICFBamTimestampColObj obj = (ICFBamTimestampColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getTimestampColFactory()
                                    .newAskDeleteForm(cfFormManager, obj, getDeleteCallback());
                            ((ICFBamJavaFXTimestampColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamTimestampDefObj, ICFBamTimestampTypeObj, ICFBamTimestampColObj");
                        }
                    }
                } 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.CFBamJavaFXNumberColListPane.java

public CFHBox getPanelHBoxMenu() {
    if (hboxMenu == null) {
        hboxMenu = new CFHBox(10);
        buttonAddNumberCol = new CFButton();
        buttonAddNumberCol.setMinWidth(200);
        buttonAddNumberCol.setText("Add NumberCol");
        buttonAddNumberCol.setOnAction(new EventHandler<ActionEvent>() {
            @Override/*  ww 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();
                    ICFBamNumberColObj obj = (ICFBamNumberColObj) schemaObj.getNumberColTableObj()
                            .newInstance();
                    ICFBamNumberColEditObj edit = (ICFBamNumberColEditObj) (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.getNumberColFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamJavaFXNumberColPaneCommon jpanelCommon = (ICFBamJavaFXNumberColPaneCommon) 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(buttonAddNumberCol);
        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");
                    }
                    ICFBamNumberColObj selectedInstance = getJavaFXFocusAsNumberCol();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("NUMC".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getNumberColFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXNumberColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamNumberColObj");
                        }
                    }
                } 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");
                    }
                    ICFBamNumberColObj selectedInstance = getJavaFXFocusAsNumberCol();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("NUMC".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getNumberColFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXNumberColPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamNumberColObj");
                        }
                    }
                } 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");
                    }
                    ICFBamNumberColObj selectedInstance = getJavaFXFocusAsNumberCol();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("NUMC".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getNumberColFactory()
                                    .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback());
                            ((ICFBamJavaFXNumberColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamNumberColObj");
                        }
                    }
                } 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.CFBamJavaFXTZTimestampDefListPane.java

public CFHBox getPanelHBoxMenu() {
    if (hboxMenu == null) {
        hboxMenu = new CFHBox(10);
        LinkedList<CFButton> list = new LinkedList<CFButton>();

        vboxMenuAdd = new CFVBox(10);
        buttonAddTZTimestampType = new CFButton();
        buttonAddTZTimestampType.setMinWidth(200);
        buttonAddTZTimestampType.setText("Add TZTimestampType");
        buttonAddTZTimestampType.setOnAction(new EventHandler<ActionEvent>() {
            @Override/*w ww. ja v  a2s. co  m*/
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamTZTimestampTypeObj obj = (ICFBamTZTimestampTypeObj) schemaObj
                            .getTZTimestampTypeTableObj().newInstance();
                    CFBorderPane frame = javafxSchema.getTZTimestampTypeFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamTZTimestampTypeEditObj edit = (ICFBamTZTimestampTypeEditObj) (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);
                    ICFBamJavaFXTZTimestampTypePaneCommon jpanelCommon = (ICFBamJavaFXTZTimestampTypePaneCommon) frame;
                    jpanelCommon.setJavaFXFocus(obj);
                    jpanelCommon.setPaneMode(CFPane.PaneMode.Add);
                    cfFormManager.pushForm(frame);
                    setLeft(null);
                    adjustListButtons();
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        if (javafxContainer instanceof ICFBamSchemaDefObj) {
            list.add(buttonAddTZTimestampType);
        }
        buttonAddTZTimestampCol = new CFButton();
        buttonAddTZTimestampCol.setMinWidth(200);
        buttonAddTZTimestampCol.setText("Add TZTimestampCol");
        buttonAddTZTimestampCol.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamTZTimestampColObj obj = (ICFBamTZTimestampColObj) schemaObj
                            .getTZTimestampColTableObj().newInstance();
                    CFBorderPane frame = javafxSchema.getTZTimestampColFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamTZTimestampColEditObj edit = (ICFBamTZTimestampColEditObj) (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);
                    ICFBamJavaFXTZTimestampColPaneCommon jpanelCommon = (ICFBamJavaFXTZTimestampColPaneCommon) frame;
                    jpanelCommon.setJavaFXFocus(obj);
                    jpanelCommon.setPaneMode(CFPane.PaneMode.Add);
                    cfFormManager.pushForm(frame);
                    setLeft(null);
                    adjustListButtons();
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        if (javafxContainer instanceof ICFBamTableObj) {
            list.add(buttonAddTZTimestampCol);
        }

        int len = list.size();
        CFButton arr[] = new CFButton[len];
        Iterator<CFButton> iter = list.iterator();
        int idx = 0;
        while (iter.hasNext()) {
            arr[idx++] = iter.next();
        }
        Arrays.sort(arr, new CompareCFButtonByText());
        for (idx = 0; idx < len; idx++) {
            vboxMenuAdd.getChildren().add(arr[idx]);
        }

        buttonCancelAdd = new CFButton();
        buttonCancelAdd.setMinWidth(200);
        buttonCancelAdd.setText("Cancel Add...");
        buttonCancelAdd.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    setLeft(null);
                    adjustListButtons();
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        vboxMenuAdd.getChildren().add(buttonCancelAdd);

        scrollMenuAdd = new ScrollPane();
        scrollMenuAdd.setMinWidth(240);
        scrollMenuAdd.setMaxWidth(240);
        scrollMenuAdd.setFitToWidth(true);
        scrollMenuAdd.setHbarPolicy(ScrollBarPolicy.NEVER);
        scrollMenuAdd.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
        scrollMenuAdd.setContent(vboxMenuAdd);

        buttonAdd = new CFButton();
        buttonAdd.setMinWidth(200);
        buttonAdd.setText("Add...");
        buttonAdd.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    setLeft(scrollMenuAdd);
                    adjustListButtons();
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonAdd);

        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");
                    }
                    ICFBamTZTimestampDefObj selectedInstance = getJavaFXFocusAsTZTimestampDef();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("ZSTD".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getTZTimestampDefFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXTZTimestampDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("ZSTT".equals(classCode)) {
                            ICFBamTZTimestampTypeObj obj = (ICFBamTZTimestampTypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getTZTimestampTypeFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXTZTimestampTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("ZSTC".equals(classCode)) {
                            ICFBamTZTimestampColObj obj = (ICFBamTZTimestampColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getTZTimestampColFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXTZTimestampColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamTZTimestampDefObj, ICFBamTZTimestampTypeObj, ICFBamTZTimestampColObj");
                        }
                    }
                } 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");
                    }
                    ICFBamTZTimestampDefObj selectedInstance = getJavaFXFocusAsTZTimestampDef();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("ZSTD".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getTZTimestampDefFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXTZTimestampDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else if ("ZSTT".equals(classCode)) {
                            ICFBamTZTimestampTypeObj obj = (ICFBamTZTimestampTypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getTZTimestampTypeFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXTZTimestampTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else if ("ZSTC".equals(classCode)) {
                            ICFBamTZTimestampColObj obj = (ICFBamTZTimestampColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getTZTimestampColFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXTZTimestampColPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamTZTimestampDefObj, ICFBamTZTimestampTypeObj, ICFBamTZTimestampColObj");
                        }
                    }
                } 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");
                    }
                    ICFBamTZTimestampDefObj selectedInstance = getJavaFXFocusAsTZTimestampDef();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("ZSTD".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getTZTimestampDefFactory()
                                    .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback());
                            ((ICFBamJavaFXTZTimestampDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("ZSTT".equals(classCode)) {
                            ICFBamTZTimestampTypeObj obj = (ICFBamTZTimestampTypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getTZTimestampTypeFactory()
                                    .newAskDeleteForm(cfFormManager, obj, getDeleteCallback());
                            ((ICFBamJavaFXTZTimestampTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("ZSTC".equals(classCode)) {
                            ICFBamTZTimestampColObj obj = (ICFBamTZTimestampColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getTZTimestampColFactory()
                                    .newAskDeleteForm(cfFormManager, obj, getDeleteCallback());
                            ((ICFBamJavaFXTZTimestampColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamTZTimestampDefObj, ICFBamTZTimestampTypeObj, ICFBamTZTimestampColObj");
                        }
                    }
                } 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.CFBamJavaFXNumberTypeListPane.java

public CFHBox getPanelHBoxMenu() {
    if (hboxMenu == null) {
        hboxMenu = new CFHBox(10);
        buttonAddNumberType = new CFButton();
        buttonAddNumberType.setMinWidth(200);
        buttonAddNumberType.setText("Add NumberType");
        buttonAddNumberType.setOnAction(new EventHandler<ActionEvent>() {
            @Override//from  www .j  av  a2  s  .c o  m
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamNumberTypeObj obj = (ICFBamNumberTypeObj) schemaObj.getNumberTypeTableObj()
                            .newInstance();
                    ICFBamNumberTypeEditObj edit = (ICFBamNumberTypeEditObj) (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.getNumberTypeFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamJavaFXNumberTypePaneCommon jpanelCommon = (ICFBamJavaFXNumberTypePaneCommon) 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(buttonAddNumberType);
        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");
                    }
                    ICFBamNumberTypeObj selectedInstance = getJavaFXFocusAsNumberType();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("NUMT".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getNumberTypeFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXNumberTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamNumberTypeObj");
                        }
                    }
                } 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");
                    }
                    ICFBamNumberTypeObj selectedInstance = getJavaFXFocusAsNumberType();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("NUMT".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getNumberTypeFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXNumberTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamNumberTypeObj");
                        }
                    }
                } 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");
                    }
                    ICFBamNumberTypeObj selectedInstance = getJavaFXFocusAsNumberType();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("NUMT".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getNumberTypeFactory()
                                    .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback());
                            ((ICFBamJavaFXNumberTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance, "ICFBamNumberTypeObj");
                        }
                    }
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonDeleteSelected);

    }
    return (hboxMenu);
}