Package org.jboss.dashboard.ui.config

Examples of org.jboss.dashboard.ui.config.TreeNode


    }

    public void service(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws FormatterException {
        try {
            int nodeIndex = 0;
            TreeNode an = (TreeNode) getParameter("treenode");
            renderFragment("nodeTab");
            if (an != null) {
                if ((treeStatus.isExpanded(an))) {
                    List children = an.getChildren();
                    if (children != null) {
                        Iterator i = children.iterator();
                        while (i.hasNext()) {
                            TreeNode subNode = (TreeNode) i.next();
                            if (treeStatus.isExpanded(subNode)) {
                                if (i.hasNext()) {
                                    setAttribute("expand_path", "branch_contract.gif");
                                    setAttribute("line_path", "line_expand.gif");
                                } else {
                                    setAttribute("expand_path", "branch_contract_01.gif");
                                    setAttribute("line_path", "spacer.png");
                                }
                                setAttribute("expand_action", "collapse-node");
                            } else {
                                if (i.hasNext()) {
                                    setAttribute("expand_path", "branch_expand_02.gif");
                                    setAttribute("line_path", "line_expand.gif");
                                } else {
                                    setAttribute("expand_path", "branch_expand_01.gif");
                                    setAttribute("line_path", "spacer.png");
                                }
                                setAttribute("expand_action", "expand-node");
                            }

                            if (i.hasNext()) {
                                setAttribute("line_path", "line_expand.gif");
                                setAttribute("branchPath", "branch_02.gif");
                            } else {
                                setAttribute("branchPath", "branch_01.gif");
                                setAttribute("line_path", "spacer.png");
                            }
                            setAttribute("isEditable", subNode.isEditable());
                            setAttribute("path_Node", subNode.getPath());
                            setAttribute("id_Node", subNode.getId());
                            setAttribute("name_Node", StringEscapeUtils.escapeHtml(StringUtils.defaultString(subNode.getName(getLocale()))));
                            setAttribute("icon_Node", subNode.getIconId());
                            setAttribute("iconNodePath", subNode.getIconCategory());
                            setAttribute("parent_Node", subNode.getParent());
                            setAttribute("node", subNode);
                            setAttribute("level_Node", subNode.getLevel());
                            setAttribute("isEdited", getTreeStatus().isEdited(subNode));
                            setAttribute("nodeIndex",nodeIndex++);
                            renderFragment("subNode");
                        }
                    }
View Full Code Here


    public void service(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws FormatterException {
        renderFragment("treeStart");
        List rootNodes = getTree().getRootNodes();
        if (rootNodes != null) {
            for (int i = 0; i < rootNodes.size(); i++) {
                TreeNode mainNode = (TreeNode) rootNodes.get(i);
                if (getTreeStatus().isExpanded(mainNode)) {
                    setAttribute("expand_icon", "ICON_mainnode_minimize");
                    setAttribute("expand_action", "collapse-node");
                } else {
                    setAttribute("expand_icon", "ICON_mainnode_maximize");
                    setAttribute("expand_action", "expand-node");
                }
                setAttribute("path_mainNode", mainNode.getPath());
                setAttribute("id_mainNode", mainNode.getId());
                setAttribute("name_mainNode", StringEscapeUtils.escapeHtml(mainNode.getName(getLocale())));
                setAttribute("icon_mainNode", mainNode.getIconId());
                setAttribute("mainNode", mainNode);
                setAttribute("level_mainNode", mainNode.getLevel());
                renderFragment("mainNode");
            }
        }
        renderFragment("treeEnd");
    }
View Full Code Here

            request.setAttribute(PanelInstancePropertiesFormatter.PANEL_INSTANCE_PROPERTIES, p);
            request.setAttribute(PanelInstancePropertiesFormatter.PANEL_INSTANCE, getPanelInstance());
            request.setAttribute(PanelInstancePropertiesFormatter.FORM_STATUS, getFormStatus());

            TreeNode currentNode = treeStatus.getLastEditedNode(configTree);

            setAttribute("title",
                    getPanelInstance().getProvider().getResource(
                            getPanelInstance().getProvider().getDescription())
                            + " - " +
                            currentNode.getDescription(getLocale()));
            renderFragment("output");
            renderFragment("outputEnd");
        } catch (Exception e) {
            log.error("Error loading panelParameters", e);
        }
View Full Code Here

        WorkspaceImpl workspace = (WorkspaceImpl) getWorkspace();
        WorkspacePermission workspacePerm = WorkspacePermission.newInstance(workspace, WorkspacePermission.ACTION_ADMIN);

        if (getUserStatus().hasPermission(workspacePerm)) {
            Section section = workspace.getSection(new Long(getSelectedSectionId()));
            TreeNode currentNode = getTreeStatus().getLastEditedNode(getConfigTree());
            StringBuffer path = new StringBuffer();
            path.append(currentNode.getPath()).append("/").append(getSectionIds(section));
            path.append("/panels");
            getTreeStatus().navigateToPath(getConfigTree(), path.toString());
        } else {
            getErrorPermission().add("errorGoToPanels");
        }
View Full Code Here

        WorkspaceImpl workspace = (WorkspaceImpl) getWorkspace();
        Section section = workspace.getSection(new Long(getSelectedSectionId()));
        SectionPermission sectionPerm = SectionPermission.newInstance(section, SectionPermission.ACTION_EDIT);

        if (getUserStatus().hasPermission(sectionPerm)) {
            TreeNode currentNode = getTreeStatus().getLastEditedNode(getConfigTree());
            StringBuffer path = new StringBuffer();
            path.append(currentNode.getPath()).append("/").append(getSectionIds(section));
            path.append("/permissions");
            getTreeStatus().navigateToPath(getConfigTree(), path.toString());
        } else {
            getErrorPermission().add("errorGoToPagePermissions");
        }
View Full Code Here

        Section section = workspace.getSection(new Long(getSelectedSectionId()));

        SectionPermission sectionPerm = SectionPermission.newInstance(section, SectionPermission.ACTION_EDIT);

        if (getUserStatus().hasPermission(sectionPerm)) {
            TreeNode currentNode = getTreeStatus().getLastEditedNode(getConfigTree());
            StringBuffer path = new StringBuffer();
            path.append(currentNode.getPath()).append("/").append(getSectionIds(section));
            getTreeStatus().navigateToPath(getConfigTree(), path.toString());
        } else {
            getErrorPermission().add("errorEditSection");
        }
View Full Code Here

        WorkspaceImpl workspace = (WorkspaceImpl) getWorkspace();
        WorkspacePermission workspacePerm = WorkspacePermission.newInstance(workspace, WorkspacePermission.ACTION_ADMIN);

        if (getUserStatus().hasPermission(workspacePerm)) {
            Section section = workspace.getSection(new Long(getSelectedSectionId()));
            TreeNode currentNode = getTreeStatus().getLastEditedNode(getConfigTree());
            StringBuffer path = new StringBuffer();
            path.append(currentNode.getPath()).append("/").append(getSectionIds(section));
            path.append("/panels");
            getTreeStatus().navigateToPath(getConfigTree(), path.toString());
        } else {
            getErrorPermission().add("errorGoToPanels");
        }
View Full Code Here

        WorkspaceImpl workspace = (WorkspaceImpl) getWorkspace();
        Section section = workspace.getSection(new Long(getSelectedSectionId()));
        SectionPermission sectionPerm = SectionPermission.newInstance(section, SectionPermission.ACTION_EDIT);

        if (getUserStatus().hasPermission(sectionPerm)) {
            TreeNode currentNode = getTreeStatus().getLastEditedNode(getConfigTree());
            StringBuffer path = new StringBuffer();
            path.append(currentNode.getPath()).append("/").append(getSectionIds(section));
            path.append("/permissions");
            getTreeStatus().navigateToPath(getConfigTree(), path.toString());
        } else {
            getErrorPermission().add("errorGoToPagePermissions");
        }
View Full Code Here

        Section section = workspace.getSection(new Long(getSelectedSectionId()));

        SectionPermission sectionPerm = SectionPermission.newInstance(section, SectionPermission.ACTION_EDIT);

        if (getUserStatus().hasPermission(sectionPerm)) {
            TreeNode currentNode = getTreeStatus().getLastEditedNode(getConfigTree());
            StringBuffer path = new StringBuffer();
            path.append(currentNode.getPath()).append("/").append(getSectionIds(section));
            getTreeStatus().navigateToPath(getConfigTree(), path.toString());
        } else {
            getErrorPermission().add("errorEditSection");
        }
View Full Code Here

        }
        return null;
    }

    public Collection getPanels() throws Exception {
        TreeNode parent = getParent();
        if (parent instanceof SectionNode) {
            String workspaceId = ((SectionNode) parent).getWorkspaceId();
            Long sectionId = ((SectionNode) parent).getSectionId();
            return ((WorkspaceImpl) UIServices.lookup().getWorkspacesManager().getWorkspace(workspaceId)).getSection(sectionId).getPanels();
        } else if (parent instanceof PanelInstanceNode) {
View Full Code Here

TOP

Related Classes of org.jboss.dashboard.ui.config.TreeNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.