Package org.jboss.on.embedded.ui.nav

Examples of org.jboss.on.embedded.ui.nav.JONTreeNode


        return resource;
    }

    public List<SelectItem> asSelectItemList()
    {
        JONTreeNode selectedNode = navigationAction.getSelectedNode();
        Collection<JONTreeNode> c = selectedNode.getChildNodes();
        List<SelectItem> result = new ArrayList<SelectItem>();
        if (c != null)
        {
            result.add(new SelectItem("All Types"));
View Full Code Here


    }

    public void findNode(JONTreeNode node, int level)
    {
        NavigationAction navAction = getNavigationAction();
        JONTreeNode retrievedNode = navAction.findNode(node.getPath());

        assert retrievedNode != null;
        assert retrievedNode.getName().equals(node.getName());
        assert retrievedNode.getPath().equals(node.getPath());
    }
View Full Code Here

    // Utility methods

    private void visitNodes(String methodName)
            throws NoSuchMethodException, IllegalAccessException
    {
        JONTreeNode root = getPlatformNode();

        Method method = this.getClass().getMethod(methodName, JONTreeNode.class, Integer.TYPE);
        try
        {
            visitNodes(method, root, 0);
View Full Code Here

    private JONTreeNode getPlatformNode()
    {
        NavigationAction navAction = getNavigationAction();
        navAction.setCurrentPath("bad_path");
        // if the path doesn't match anything the root node is returned
        JONTreeNode root = navAction.getSelectedNode();

        return root;
    }
View Full Code Here

     *
     * @return the breadcrumbs (descending list of parent to children) for this node
     */
    public List<JONTreeNode> getBreadCrumbs()
    {
        JONTreeNode selectedNode = getSelectedNode();
        // add the current node
        List<JONTreeNode> breadcrumbs = new ArrayList();
        breadcrumbs.add(selectedNode);

        JONTreeNode parent = selectedNode.getParent();
        while (parent != null)
        {
            // make sure the most recently added parent ends up at the front of this list
            breadcrumbs.add(0, parent);
            parent = parent.getParent();
        }

        // remove the first breadcrumb node, if its the dummy tree node (which it should be
        if (breadcrumbs.get(0) instanceof DummyTreeNode)
        {
View Full Code Here

    // @TODO if isAvailable is moved to CommonActionUtil, the methods below for enabling tabs should
    // probably move there too or just move it to a Tab related class
    public Map<String, Boolean> getEnabledTabs()
    {
        Map<String, Boolean> enabledTabs = new HashMap<String, Boolean>(4);
        JONTreeNode currentNode = getSelectedNode();
        if (currentNode instanceof TreeNodeWithResource)
        {
            Resource resource = ((TreeNodeWithResource)currentNode).getResource();
            if (hasConfiguration(resource))
                enabledTabs.put(Tabs.CONFIGURATION, true);
View Full Code Here

     * @return UP, DOWN or UNKNOWN (or SUMMARY if this isn't a ResourceTreeNode)
     */
    public String getAvailableStatus()
    {
        String status = "SUMMARY";
        JONTreeNode currentNode = getSelectedNode();
        if (currentNode instanceof TreeNodeWithResource)
        {
            Resource resource = ((TreeNodeWithResource)currentNode).getResource();
            return getAvailableStatus(resource);
        }
View Full Code Here

     * @param node the node to test if its the same as the currently selected node
     * @return true if the given node is the same as the currently selected node, false otherwise
     */
    public boolean equalsSelectedNode(JONTreeNode node)
    {
        JONTreeNode currentNode = getSelectedNode();
        return node.equals(currentNode);
    }
View Full Code Here

    // TODO could consider renaming this getCurrentNavigationNode()
    public JONTreeNode getSelectedNode()
    {
        if (log.isTraceEnabled())
            log.trace("Finding node for path [" + getCurrentPath() + "]...");
        JONTreeNode selectedNode = getRootNode().findNode(getCurrentPath());
        ResourceManager resourceManager = ResourceManagerFactory.resourceManager();
        if (selectedNode == null)
        {
            log.debug("Unable to find node with path [" + this.currentPath + "]; defaulting to platform node...");
            // TODO (ccrouch): I'm seeing this on login now. Comment out for now.
View Full Code Here

        return ((BaseTreeNode)parentResourceNode).findNodeByType(resourceType);
    }

    public Boolean openNodeAdvisor(UITree tree)
    {
        JONTreeNode data = (JONTreeNode)(tree.getTreeNode().getData());
        if (!expandedYet.contains(data) && isWithinNStepsOfPlatform(this.openDepth - 1, data))
        {
            expandedYet.add(data);
            return Boolean.TRUE;
        }
View Full Code Here

TOP

Related Classes of org.jboss.on.embedded.ui.nav.JONTreeNode

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.