Package javax.swing.event

Examples of javax.swing.event.TreeExpansionEvent


                    DefaultTreeModel treeModel = (DefaultTreeModel) activeTree.getModel();
                    TreePath path = new TreePath(treeModel.getPathToRoot(initiallySelectedNode));

                    if (path!=null) {
                        View initiallySelectedManifestation = directoryArea.getSelectedManifestations().iterator().next()
                        initiallySelectedManifestation.getViewListener().actionPerformed(new TreeExpansionEvent(activeTree, path));
                    }

                }
               
                // Find the child that corresponds to our new component.
View Full Code Here


        setupDirectoryTree(directory, false);
        this.add(new DirectoryTitleArea(bundle.getString("DIRECTORY"), null), BorderLayout.NORTH);
        rootNode.removeAllChildren();
        View topManifestation = (View)rootNode.getUserObject();
        if (topManifestation.getViewListener() != null) {
            TreeExpansionEvent event = new TreeExpansionEvent(rootNode.getParentTree(), null);
            topManifestation.getViewListener().actionPerformed(event);
        }
      
        // setup handlers (previously in Bookmark)
        AbstractComponent parentComponent = ((View) rootNode.getUserObject()).getManifestedComponent();
View Full Code Here

    {
        boolean wasExpanded = treeCellUI.isExpanded();
        if (wasExpanded == expand)
            return; // No cambia el estado

        TreeExpansionEvent event = null;
        TreePath treePath = treeCellUI.getTreePath();
        if (hasTreeWillExpandListeners())
        {
            event = new TreeExpansionEvent(this, treePath);
            TreeWillExpandListener[] listeners = getTreeWillExpandListeners();
            try
            {
                for (int i = 0; i < listeners.length; i++)
                {
                    if (expand)
                        listeners[i].treeWillExpand(event);
                    else
                        listeners[i].treeWillCollapse(event);
                }
            }
            catch (ExpandVetoException ex)
            {
                // Cancelada la expansi�n/cancelaci�n
                return;
            }
        }

        treeCellUI.expand(expand);

        // Ha cambiado el estado, notificamos
        if (hasTreeExpansionListeners())
        {
            if (event == null) // Como es un objeto de s�lo lectura si ya se cre� antes lo reutilizamos
                event = new TreeExpansionEvent(this, treePath);

            TreeExpansionListener[] listeners = getTreeExpansionListeners();
            for (int i = 0; i < listeners.length; i++)
            {
                if (expand)
View Full Code Here

      DefaultMutableTreeNode node = (DefaultMutableTreeNode)path.getLastPathComponent();
      final AdminNode info = (AdminNode)node.getUserObject();

      ActionListener listener = new ActionListener() {
         public void actionPerformed(ActionEvent ae) {
            TreeExpansionEvent ex = new TreeExpansionEvent(this, path);
            browser_treeCollapsed(ex);
            browser_treeExpanded(ex);
         }
      };
View Full Code Here

TOP

Related Classes of javax.swing.event.TreeExpansionEvent

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.