Example usage for java.util LinkedList size

List of usage examples for java.util LinkedList size

Introduction

In this page you can find the example usage for java.util LinkedList size.

Prototype

int size

To view the source code for java.util LinkedList size.

Click Source Link

Usage

From source file:com.nhncorp.lucy.security.xss.XssSaxFilter.java

/**
 * @param writer//from ww w  . j  a  va  2s.  c  o m
 * @param neloLogWriter
 * @param stackForObjectTag
 * @param stackForAllowNetworkingValue
 * @param charArraySegment
 * @throws IOException
 */
private void doParseAndFilter(Writer writer, StringWriter neloLogWriter, LinkedList<Element> stackForObjectTag,
        LinkedList<String> stackForAllowNetworkingValue, CharArraySegment charArraySegment) throws IOException {
    Token token;
    while ((token = MarkupSaxParser.parse(charArraySegment)) != null) {
        String tokenName = token.getName();

        if ("description".equals(tokenName)) {

            String description = token.getText();
            Description content = new Description(description);
            content.serialize(writer);

        } else if ("comment".equals(tokenName)) {
            String comment = token.getText();
            if (comment != null && comment.length() != 0) {
                comment = comment.substring(4, comment.length() - 3);
            }

            Comment content = new Comment(comment);
            content.serializeFilteringTagInComment(writer, this.filteringTagInCommentEnabled,
                    this.commentFilter);

            //content.serialize(writer);

        } else if ("iEHExStartTag".endsWith(tokenName)) {
            IEHackExtensionElement iehackElement = new IEHackExtensionElement(token.getText());
            checkIEHackRule(iehackElement);

            if (iehackElement.isDisabled()) { // IE Hack   ? ,  .
                /*   if (this.isNeloLogEnabled) {
                      neloLogWriter.write(this.neloElementRemoveMSG);
                      neloLogWriter.write(iehackElement.getName() + "\n");
                   }*/
                if (!this.withoutComment) {
                    writer.write(REMOVE_TAG_INFO_START);
                    writer.write(iehackElement.getName().replaceAll("<", "&lt;").replaceFirst(">", "&gt;"));
                    writer.write(REMOVE_TAG_INFO_END);
                }
            }

            iehackElement.serialize(writer);

        } else if ("startTag".equals(tokenName)) {
            Token tagNameToken = token.getChild("tagName");
            if (tagNameToken == null) {
                continue;
            }

            String tagName = tagNameToken.getText();
            Element element = new Element(tagName);
            List<Token> attTokens = token.getChildren("attribute");
            if (attTokens != null) {
                for (Token attToken : attTokens) {
                    if (attToken != null) {
                        Token attName = attToken.getChild("attName");
                        Token attValue = attToken.getChild("attValue");
                        if (attName != null && attValue == null) {
                            element.putAttribute(new Attribute(attName.getText()));
                        } else if (attName != null && attValue != null) {
                            String text = attValue.getText();
                            text = CommonUtils.getQuotePair(text);
                            element.putAttribute(new Attribute(attName.getText(), text));
                        }
                    }
                }
            }

            Token closeStartEnd = token.getChild("closeStartEnd");

            if (closeStartEnd != null) {
                element.setStartClose(true);

            }

            doObjectParamStartTagProcess(stackForObjectTag, stackForAllowNetworkingValue, element);

            this.serialize(writer, element, neloLogWriter);

        } else if ("iEHExEndTag".endsWith(tokenName)) {
            IEHackExtensionElement ie = new IEHackExtensionElement(token.getText());
            checkIEHackRule(ie);

            if (!ie.isDisabled()) { // IE Hack   ? , end  .
                //  IE Hack   ?(? )
                String stdName = ie.getName();
                if (stdName != null) {
                    stdName = stdName.replaceFirst("<!--", "<!");
                }
                writer.write(stdName); // <!--[endif]--> ?  IE? ? ? ?    .
            }
        } else if ("endTag".equals(tokenName)) {
            Token tagNameToken = token.getChild("tagName");

            if (tagNameToken == null) {
                continue;
            }

            String tagName = tagNameToken.getText();

            boolean isObjectDisabled = false;
            if ("object".equalsIgnoreCase(tagName) && stackForObjectTag.size() > 0) {
                isObjectDisabled = doObjectEndTagProcess(writer, neloLogWriter, stackForObjectTag,
                        stackForAllowNetworkingValue);

            }

            Element element = new Element(tagName);

            checkRuleRemove(element);

            if (!element.isRemoved()) {
                if (isObjectDisabled) {
                    element.setEnabled(false);
                }

                //TODO    
                // v1.3.3 & v1.5.2 BEFORE if (!element.isDisabled()) {
                if (!element.isDisabled() || this.blockingPrefixEnabled) {
                    checkRule(element);
                }

                if (element.isDisabled()) {
                    if (this.blockingPrefixEnabled) { //BlockingPrefix  ? , <, > ?  Escape ? Element ??  ?? .
                        element.setName(this.blockingPrefix + element.getName());
                        element.setEnabled(true);
                        writer.write("</");
                        writer.write(element.getName());
                        writer.write('>');
                    } else { //BlockingPrefix   ? , <, > ?  Escape .
                        writer.write("&lt;/");
                        writer.write(element.getName());
                        writer.write("&gt;");
                    }
                } else {
                    writer.write("</");
                    writer.write(element.getName());
                    writer.write('>');
                }
            }
        } else {
            Text content = new Text(token.getText());
            content.serialize(writer);
        }
    }
}

From source file:de.innovationgate.wgpublisher.webtml.utils.TMLContext.java

public void removeThreadMainContext() {

    LinkedList<TMLContext> contexts = _threadMainContexts.get();

    if ("true".equals(System.getProperty("de.innovationgate.wga.threadmaincontexts.verbose"))) {
        try {//from w ww.  java2s.  c  o  m
            StackTraceElement[] elements = Thread.currentThread().getStackTrace();
            getlog().info("Thread " + Thread.currentThread().hashCode() + " - Removing main context '"
                    + getpath() + "' (" + System.identityHashCode(this) + ") at position "
                    + (contexts.size() - 1) + ", Stacktrace " + elements[2]);
        } catch (WGAPIException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    if (contexts != null) {
        TMLContext lastContext = contexts.removeLast();
        if (lastContext != this) {
            try {
                getlog().error(
                        "Error in WebTML context management: Thread main context mismatch on removal. Removed: "
                                + this.getpath() + " (" + System.identityHashCode(this) + "), In stack: "
                                + lastContext.getpath() + " (" + System.identityHashCode(lastContext) + ")");
            } catch (WGAPIException e) {
            }
        }
    }

}

From source file:de.innovationgate.wgpublisher.webtml.utils.TMLContext.java

public void makeThreadMainContext() {

    LinkedList<TMLContext> contexts = _threadMainContexts.get();
    if (contexts == null) {
        contexts = new LinkedList<TMLContext>();
        _threadMainContexts.set(contexts);
    }//www  .ja  v  a2 s .  com

    if ("true".equals(System.getProperty("de.innovationgate.wga.threadmaincontexts.verbose"))) {
        try {
            StackTraceElement[] elements = Thread.currentThread().getStackTrace();
            getlog().info("Thread " + Thread.currentThread().hashCode() + " - Registering main context '"
                    + getpath() + "' (" + System.identityHashCode(this) + ") at position " + contexts.size()
                    + ", Stacktrace " + elements[2]);
        } catch (WGAPIException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    contexts.add(this);

    if (contexts.size() == 100) {
        getlog().warn("Size of main contexts list on thread '" + Thread.currentThread().getName()
                + "' exceeds 100 entries. The main contexts management is most likely leaking!");
    }

}

From source file:edu.umn.msi.tropix.persistence.service.impl.TropixObjectServiceImpl.java

public PermissionReport[] getPermissionReports(final String cagridId, final String objectId) {
    final LinkedList<PermissionReport> reports = new LinkedList<PermissionReport>();
    final TropixObject object = getTropixObjectDao().loadTropixObject(objectId);
    if (object instanceof VirtualFolder && ((VirtualFolder) object).getRoot()) {
        final Map<String, PermissionReport> userReports = new HashMap<String, PermissionReport>();
        final PermissionReport ownerReport = getPermissionReport(getTropixObjectDao().getOwner(object.getId()));
        ownerReport.setPermission(PermissionType.Owner);
        reports.add(ownerReport);//from ww w  . j  a v a 2 s  .  c  o  m
        userReports.put(ownerReport.getId(), ownerReport);

        for (final User writeUser : getTropixObjectDao().getVirtualPermissionUsers(objectId, "write")) {
            if (!userReports.containsKey(writeUser.getCagridId())) {
                final PermissionReport report = getPermissionReport(writeUser);
                report.setPermission(PermissionType.Write);
                reports.add(report);
                userReports.put(report.getId(), report);
            }
        }
        for (final User readUser : getTropixObjectDao().getVirtualPermissionUsers(objectId, "read")) {
            if (!userReports.containsKey(readUser.getCagridId())) {
                final PermissionReport report = getPermissionReport(readUser);
                report.setPermission(PermissionType.Read);
                reports.add(report);
            }
        }

        final Map<String, PermissionReport> groupReports = new HashMap<String, PermissionReport>();
        for (final Group writeGroup : getTropixObjectDao().getVirtualPermissionGroups(objectId, "write")) {
            final PermissionReport report = getPermissionReport(writeGroup);
            report.setPermission(PermissionType.Write);
            reports.add(report);
            groupReports.put(report.getId(), report);
        }
        for (final Group readGroup : getTropixObjectDao().getVirtualPermissionGroups(objectId, "read")) {
            final String groupId = readGroup.getId();
            if (!groupReports.containsKey(groupId)) {
                final PermissionReport report = getPermissionReport(readGroup);
                report.setPermission(PermissionType.Read);
                reports.add(report);
            }
        }
    } else if (!(object instanceof VirtualFolder)) {
        final Map<String, PermissionReport> userReports = new HashMap<String, PermissionReport>();
        final Map<String, PermissionReport> groupReports = new HashMap<String, PermissionReport>();
        final Collection<DirectPermission> permissions = getTropixObjectDao().getRoles(objectId);

        for (final DirectPermission permission : permissions) {
            for (final User user : permission.getUsers()) {
                final String userId = user.getCagridId();
                if (userReports.containsKey(userId)) {
                    final PermissionReport report = userReports.get(userId);
                    report.setPermission(getStrongerPermission(getPermissionType(permission.getRole()),
                            report.getPermission()));
                } else {
                    final PermissionReport report = getPermissionReport(user);
                    report.setPermission(getPermissionType(permission.getRole()));
                    reports.add(report);
                    userReports.put(userId, report);
                }
            }

            for (final Group group : permission.getGroups()) {
                final String groupId = group.getId();
                if (groupReports.containsKey(groupId)) {
                    final PermissionReport report = groupReports.get(groupId);
                    report.setPermission(getStrongerPermission(getPermissionType(permission.getRole()),
                            report.getPermission()));
                } else {
                    final PermissionReport report = getPermissionReport(group);
                    report.setPermission(getPermissionType(permission.getRole()));
                    reports.add(report);
                    groupReports.put(groupId, report);
                }
            }
        }

        for (final VirtualFolder virtualFolder : object.getParentVirtualFolders()) {
            final PermissionReport report = new PermissionReport();
            report.setId(virtualFolder.getId());
            report.setName(getVirtualFolderPath(virtualFolder));
            report.setPermissionSource(PermissionSourceType.SharedFolder);
            reports.add(report);
        }
    }
    return reports.toArray(new PermissionReport[reports.size()]);
}

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

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

        vboxMenuAdd = new CFVBox(10);
        buttonAddBlobType = new CFButton();
        buttonAddBlobType.setMinWidth(200);
        buttonAddBlobType.setText("Add BlobType");
        buttonAddBlobType.setOnAction(new EventHandler<ActionEvent>() {
            @Override//from   w  ww. j a  v a  2 s  .  c o m
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamBlobTypeObj obj = (ICFBamBlobTypeObj) schemaObj.getBlobTypeTableObj().newInstance();
                    CFBorderPane frame = javafxSchema.getBlobTypeFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamBlobTypeEditObj edit = (ICFBamBlobTypeEditObj) (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);
                    ICFBamJavaFXBlobTypePaneCommon jpanelCommon = (ICFBamJavaFXBlobTypePaneCommon) 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(buttonAddBlobType);
        }
        buttonAddBlobCol = new CFButton();
        buttonAddBlobCol.setMinWidth(200);
        buttonAddBlobCol.setText("Add BlobCol");
        buttonAddBlobCol.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamBlobColObj obj = (ICFBamBlobColObj) schemaObj.getBlobColTableObj().newInstance();
                    CFBorderPane frame = javafxSchema.getBlobColFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamBlobColEditObj edit = (ICFBamBlobColEditObj) (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);
                    ICFBamJavaFXBlobColPaneCommon jpanelCommon = (ICFBamJavaFXBlobColPaneCommon) 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(buttonAddBlobCol);
        }

        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");
                    }
                    ICFBamBlobDefObj selectedInstance = getJavaFXFocusAsBlobDef();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("BLBD".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getBlobDefFactory().newViewEditForm(cfFormManager,
                                    selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXBlobDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("BLBT".equals(classCode)) {
                            ICFBamBlobTypeObj obj = (ICFBamBlobTypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getBlobTypeFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXBlobTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("BLBC".equals(classCode)) {
                            ICFBamBlobColObj obj = (ICFBamBlobColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getBlobColFactory().newViewEditForm(cfFormManager,
                                    obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXBlobColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamBlobDefObj, ICFBamBlobTypeObj, ICFBamBlobColObj");
                        }
                    }
                } 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");
                    }
                    ICFBamBlobDefObj selectedInstance = getJavaFXFocusAsBlobDef();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("BLBD".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getBlobDefFactory().newViewEditForm(cfFormManager,
                                    selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXBlobDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else if ("BLBT".equals(classCode)) {
                            ICFBamBlobTypeObj obj = (ICFBamBlobTypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getBlobTypeFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXBlobTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else if ("BLBC".equals(classCode)) {
                            ICFBamBlobColObj obj = (ICFBamBlobColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getBlobColFactory().newViewEditForm(cfFormManager,
                                    obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXBlobColPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamBlobDefObj, ICFBamBlobTypeObj, ICFBamBlobColObj");
                        }
                    }
                } 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");
                    }
                    ICFBamBlobDefObj selectedInstance = getJavaFXFocusAsBlobDef();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("BLBD".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getBlobDefFactory()
                                    .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback());
                            ((ICFBamJavaFXBlobDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("BLBT".equals(classCode)) {
                            ICFBamBlobTypeObj obj = (ICFBamBlobTypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getBlobTypeFactory()
                                    .newAskDeleteForm(cfFormManager, obj, getDeleteCallback());
                            ((ICFBamJavaFXBlobTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("BLBC".equals(classCode)) {
                            ICFBamBlobColObj obj = (ICFBamBlobColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getBlobColFactory()
                                    .newAskDeleteForm(cfFormManager, obj, getDeleteCallback());
                            ((ICFBamJavaFXBlobColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamBlobDefObj, ICFBamBlobTypeObj, ICFBamBlobColObj");
                        }
                    }
                } 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.CFBamJavaFXUuidTypeListPane.java

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

        vboxMenuAdd = new CFVBox(10);
        buttonAddUuidType = new CFButton();
        buttonAddUuidType.setMinWidth(200);
        buttonAddUuidType.setText("Add UuidType");
        buttonAddUuidType.setOnAction(new EventHandler<ActionEvent>() {
            @Override//from  ww  w. j a v  a  2  s. c o m
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamUuidTypeObj obj = (ICFBamUuidTypeObj) schemaObj.getUuidTypeTableObj().newInstance();
                    CFBorderPane frame = javafxSchema.getUuidTypeFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamUuidTypeEditObj edit = (ICFBamUuidTypeEditObj) (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);
                    ICFBamJavaFXUuidTypePaneCommon jpanelCommon = (ICFBamJavaFXUuidTypePaneCommon) 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(buttonAddUuidType);
        }
        buttonAddUuidGen = new CFButton();
        buttonAddUuidGen.setMinWidth(200);
        buttonAddUuidGen.setText("Add UuidGen");
        buttonAddUuidGen.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamUuidGenObj obj = (ICFBamUuidGenObj) schemaObj.getUuidGenTableObj().newInstance();
                    CFBorderPane frame = javafxSchema.getUuidGenFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamUuidGenEditObj edit = (ICFBamUuidGenEditObj) (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);
                    ICFBamJavaFXUuidGenPaneCommon jpanelCommon = (ICFBamJavaFXUuidGenPaneCommon) 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(buttonAddUuidGen);
        }

        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");
                    }
                    ICFBamUuidTypeObj selectedInstance = getJavaFXFocusAsUuidType();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("UIDT".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getUuidTypeFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXUuidTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("IGUU".equals(classCode)) {
                            ICFBamUuidGenObj obj = (ICFBamUuidGenObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getUuidGenFactory().newViewEditForm(cfFormManager,
                                    obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXUuidGenPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamUuidTypeObj, ICFBamUuidGenObj");
                        }
                    }
                } 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");
                    }
                    ICFBamUuidTypeObj selectedInstance = getJavaFXFocusAsUuidType();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("UIDT".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getUuidTypeFactory().newViewEditForm(
                                    cfFormManager, selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXUuidTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else if ("IGUU".equals(classCode)) {
                            ICFBamUuidGenObj obj = (ICFBamUuidGenObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getUuidGenFactory().newViewEditForm(cfFormManager,
                                    obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXUuidGenPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamUuidTypeObj, ICFBamUuidGenObj");
                        }
                    }
                } 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");
                    }
                    ICFBamUuidTypeObj selectedInstance = getJavaFXFocusAsUuidType();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("UIDT".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getUuidTypeFactory()
                                    .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback());
                            ((ICFBamJavaFXUuidTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("IGUU".equals(classCode)) {
                            ICFBamUuidGenObj obj = (ICFBamUuidGenObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getUuidGenFactory()
                                    .newAskDeleteForm(cfFormManager, obj, getDeleteCallback());
                            ((ICFBamJavaFXUuidGenPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamUuidTypeObj, ICFBamUuidGenObj");
                        }
                    }
                } 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.CFBamJavaFXTimeDefListPane.java

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

        vboxMenuAdd = new CFVBox(10);
        buttonAddTimeType = new CFButton();
        buttonAddTimeType.setMinWidth(200);
        buttonAddTimeType.setText("Add TimeType");
        buttonAddTimeType.setOnAction(new EventHandler<ActionEvent>() {
            @Override//from   w ww .  j  av  a 2 s. c  o m
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamTimeTypeObj obj = (ICFBamTimeTypeObj) schemaObj.getTimeTypeTableObj().newInstance();
                    CFBorderPane frame = javafxSchema.getTimeTypeFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamTimeTypeEditObj edit = (ICFBamTimeTypeEditObj) (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);
                    ICFBamJavaFXTimeTypePaneCommon jpanelCommon = (ICFBamJavaFXTimeTypePaneCommon) 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(buttonAddTimeType);
        }
        buttonAddTimeCol = new CFButton();
        buttonAddTimeCol.setMinWidth(200);
        buttonAddTimeCol.setText("Add TimeCol");
        buttonAddTimeCol.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamTimeColObj obj = (ICFBamTimeColObj) schemaObj.getTimeColTableObj().newInstance();
                    CFBorderPane frame = javafxSchema.getTimeColFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamTimeColEditObj edit = (ICFBamTimeColEditObj) (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);
                    ICFBamJavaFXTimeColPaneCommon jpanelCommon = (ICFBamJavaFXTimeColPaneCommon) 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(buttonAddTimeCol);
        }

        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");
                    }
                    ICFBamTimeDefObj selectedInstance = getJavaFXFocusAsTimeDef();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("TIMD".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getTimeDefFactory().newViewEditForm(cfFormManager,
                                    selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXTimeDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("TIMT".equals(classCode)) {
                            ICFBamTimeTypeObj obj = (ICFBamTimeTypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getTimeTypeFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXTimeTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("TIMC".equals(classCode)) {
                            ICFBamTimeColObj obj = (ICFBamTimeColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getTimeColFactory().newViewEditForm(cfFormManager,
                                    obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXTimeColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamTimeDefObj, ICFBamTimeTypeObj, ICFBamTimeColObj");
                        }
                    }
                } 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");
                    }
                    ICFBamTimeDefObj selectedInstance = getJavaFXFocusAsTimeDef();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("TIMD".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getTimeDefFactory().newViewEditForm(cfFormManager,
                                    selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXTimeDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else if ("TIMT".equals(classCode)) {
                            ICFBamTimeTypeObj obj = (ICFBamTimeTypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getTimeTypeFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXTimeTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else if ("TIMC".equals(classCode)) {
                            ICFBamTimeColObj obj = (ICFBamTimeColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getTimeColFactory().newViewEditForm(cfFormManager,
                                    obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXTimeColPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamTimeDefObj, ICFBamTimeTypeObj, ICFBamTimeColObj");
                        }
                    }
                } 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");
                    }
                    ICFBamTimeDefObj selectedInstance = getJavaFXFocusAsTimeDef();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("TIMD".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getTimeDefFactory()
                                    .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback());
                            ((ICFBamJavaFXTimeDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("TIMT".equals(classCode)) {
                            ICFBamTimeTypeObj obj = (ICFBamTimeTypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getTimeTypeFactory()
                                    .newAskDeleteForm(cfFormManager, obj, getDeleteCallback());
                            ((ICFBamJavaFXTimeTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("TIMC".equals(classCode)) {
                            ICFBamTimeColObj obj = (ICFBamTimeColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getTimeColFactory()
                                    .newAskDeleteForm(cfFormManager, obj, getDeleteCallback());
                            ((ICFBamJavaFXTimeColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamTimeDefObj, ICFBamTimeTypeObj, ICFBamTimeColObj");
                        }
                    }
                } 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.CFBamJavaFXBoolDefListPane.java

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

        vboxMenuAdd = new CFVBox(10);
        buttonAddBoolType = new CFButton();
        buttonAddBoolType.setMinWidth(200);
        buttonAddBoolType.setText("Add BoolType");
        buttonAddBoolType.setOnAction(new EventHandler<ActionEvent>() {
            @Override/* w  ww .  j  ava  2  s  .c o  m*/
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamBoolTypeObj obj = (ICFBamBoolTypeObj) schemaObj.getBoolTypeTableObj().newInstance();
                    CFBorderPane frame = javafxSchema.getBoolTypeFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamBoolTypeEditObj edit = (ICFBamBoolTypeEditObj) (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);
                    ICFBamJavaFXBoolTypePaneCommon jpanelCommon = (ICFBamJavaFXBoolTypePaneCommon) 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(buttonAddBoolType);
        }
        buttonAddBoolCol = new CFButton();
        buttonAddBoolCol.setMinWidth(200);
        buttonAddBoolCol.setText("Add BoolCol");
        buttonAddBoolCol.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamBoolColObj obj = (ICFBamBoolColObj) schemaObj.getBoolColTableObj().newInstance();
                    CFBorderPane frame = javafxSchema.getBoolColFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamBoolColEditObj edit = (ICFBamBoolColEditObj) (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);
                    ICFBamJavaFXBoolColPaneCommon jpanelCommon = (ICFBamJavaFXBoolColPaneCommon) 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(buttonAddBoolCol);
        }

        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");
                    }
                    ICFBamBoolDefObj selectedInstance = getJavaFXFocusAsBoolDef();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("BOLD".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getBoolDefFactory().newViewEditForm(cfFormManager,
                                    selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXBoolDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("BOLT".equals(classCode)) {
                            ICFBamBoolTypeObj obj = (ICFBamBoolTypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getBoolTypeFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXBoolTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("BOLC".equals(classCode)) {
                            ICFBamBoolColObj obj = (ICFBamBoolColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getBoolColFactory().newViewEditForm(cfFormManager,
                                    obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXBoolColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamBoolDefObj, ICFBamBoolTypeObj, ICFBamBoolColObj");
                        }
                    }
                } 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");
                    }
                    ICFBamBoolDefObj selectedInstance = getJavaFXFocusAsBoolDef();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("BOLD".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getBoolDefFactory().newViewEditForm(cfFormManager,
                                    selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXBoolDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else if ("BOLT".equals(classCode)) {
                            ICFBamBoolTypeObj obj = (ICFBamBoolTypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getBoolTypeFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXBoolTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else if ("BOLC".equals(classCode)) {
                            ICFBamBoolColObj obj = (ICFBamBoolColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getBoolColFactory().newViewEditForm(cfFormManager,
                                    obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXBoolColPaneCommon) frame).setPaneMode(CFPane.PaneMode.Edit);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamBoolDefObj, ICFBamBoolTypeObj, ICFBamBoolColObj");
                        }
                    }
                } 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");
                    }
                    ICFBamBoolDefObj selectedInstance = getJavaFXFocusAsBoolDef();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("BOLD".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getBoolDefFactory()
                                    .newAskDeleteForm(cfFormManager, selectedInstance, getDeleteCallback());
                            ((ICFBamJavaFXBoolDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("BOLT".equals(classCode)) {
                            ICFBamBoolTypeObj obj = (ICFBamBoolTypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getBoolTypeFactory()
                                    .newAskDeleteForm(cfFormManager, obj, getDeleteCallback());
                            ((ICFBamJavaFXBoolTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("BOLC".equals(classCode)) {
                            ICFBamBoolColObj obj = (ICFBamBoolColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getBoolColFactory()
                                    .newAskDeleteForm(cfFormManager, obj, getDeleteCallback());
                            ((ICFBamJavaFXBoolColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamBoolDefObj, ICFBamBoolTypeObj, ICFBamBoolColObj");
                        }
                    }
                } 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.CFBamJavaFXDateDefListPane.java

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

        vboxMenuAdd = new CFVBox(10);
        buttonAddDateType = new CFButton();
        buttonAddDateType.setMinWidth(200);
        buttonAddDateType.setText("Add DateType");
        buttonAddDateType.setOnAction(new EventHandler<ActionEvent>() {
            @Override//  w  ww . j  a v  a  2 s  .c o m
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamDateTypeObj obj = (ICFBamDateTypeObj) schemaObj.getDateTypeTableObj().newInstance();
                    CFBorderPane frame = javafxSchema.getDateTypeFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamDateTypeEditObj edit = (ICFBamDateTypeEditObj) (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);
                    ICFBamJavaFXDateTypePaneCommon jpanelCommon = (ICFBamJavaFXDateTypePaneCommon) 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(buttonAddDateType);
        }
        buttonAddDateCol = new CFButton();
        buttonAddDateCol.setMinWidth(200);
        buttonAddDateCol.setText("Add DateCol");
        buttonAddDateCol.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent e) {
                final String S_ProcName = "handle";
                try {
                    ICFBamSchemaObj schemaObj = (ICFBamSchemaObj) javafxSchema.getSchema();
                    ICFBamDateColObj obj = (ICFBamDateColObj) schemaObj.getDateColTableObj().newInstance();
                    CFBorderPane frame = javafxSchema.getDateColFactory().newAddForm(cfFormManager, obj,
                            getViewEditClosedCallback(), true);
                    ICFBamDateColEditObj edit = (ICFBamDateColEditObj) (obj.beginEdit());
                    if (edit == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "edit");
                    }
                    ICFSecurityTenantObj secTenant = schemaObj.getSecTenant();
                    edit.setRequiredOwnerTenant(secTenant);
                    ICFBamTableObj container = (ICFBamTableObj) (getJavaFXContainer());
                    if (container == null) {
                        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(),
                                S_ProcName, 0, "JavaFXContainer");
                    }
                    edit.setRequiredContainerTable(container);
                    ICFBamJavaFXDateColPaneCommon jpanelCommon = (ICFBamJavaFXDateColPaneCommon) 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(buttonAddDateCol);
        }

        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");
                    }
                    ICFBamDateDefObj selectedInstance = getJavaFXFocusAsDateDef();
                    if (selectedInstance != null) {
                        String classCode = selectedInstance.getClassCode();
                        if ("DATD".equals(classCode)) {
                            CFBorderPane frame = javafxSchema.getDateDefFactory().newViewEditForm(cfFormManager,
                                    selectedInstance, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXDateDefPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("DATT".equals(classCode)) {
                            ICFBamDateTypeObj obj = (ICFBamDateTypeObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getDateTypeFactory()
                                    .newViewEditForm(cfFormManager, obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXDateTypePaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else if ("DATC".equals(classCode)) {
                            ICFBamDateColObj obj = (ICFBamDateColObj) selectedInstance;
                            CFBorderPane frame = javafxSchema.getDateColFactory().newViewEditForm(cfFormManager,
                                    obj, getViewEditClosedCallback(), false);
                            ((ICFBamJavaFXDateColPaneCommon) frame).setPaneMode(CFPane.PaneMode.View);
                            cfFormManager.pushForm(frame);
                        } else {
                            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(),
                                    S_ProcName, "selectedInstance", selectedInstance,
                                    "ICFBamDateDefObj, ICFBamDateTypeObj, ICFBamDateColObj");
                        }
                    }
                } catch (Throwable t) {
                    CFConsole.formException(S_FormName, ((CFButton) e.getSource()).getText(), t);
                }
            }
        });
        hboxMenu.getChildren().add(buttonViewSelected);

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

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

    }
    return (hboxMenu);
}