Package javax.swing.event

Examples of javax.swing.event.TreeWillExpandListener


        // Create the drag gesture recognizer for this tree.
        DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_MOVE, new DragSourceHandler());
       
        // Veto collapsing (for now);
        addTreeWillExpandListener(new TreeWillExpandListener() {

            public void treeWillCollapse(TreeExpansionEvent event) throws ExpandVetoException {
                throw new ExpandVetoException(event);
            }
View Full Code Here


                System.out.println("Selection changes" + fact);
            }
        };
        selModel.addTreeSelectionListener(selListener);

        TreeWillExpandListener willExpandListener = new TreeWillExpandListener()
        {
            public void treeWillExpand(TreeExpansionEvent event) throws ExpandVetoException
            {
                // Will expand
            }
View Full Code Here

        return childNode;
    }

    public static void TREES_2()
    {
        TreeWillExpandListener willExpandListener = new TreeWillExpandListener()
        {
            public void treeWillExpand(TreeExpansionEvent event)
                            throws ExpandVetoException
            {
                // Will expand
View Full Code Here

/**
* author: lesya
*/
public class SmartExpander {
  public static void installOn(final JTree tree){
    tree.addTreeWillExpandListener(new TreeWillExpandListener() {
      public void treeWillCollapse(TreeExpansionEvent event) {
        TreePath path = event.getPath();
        Enumeration children = ((TreeNode)path.getLastPathComponent()).children();
        while (children.hasMoreElements()) {
          TreePath childPath = path.pathByAddingChild(children.nextElement());
View Full Code Here

        }
       
       
        public void addTreeExpandListener(){
            jTree.addTreeWillExpandListener(
                new TreeWillExpandListener() {
                    public void treeWillExpand(javax.swing.event.TreeExpansionEvent event) throws javax.swing.tree.ExpandVetoException {
                        SwingTreePathProvider oSwingTreePathProvider = new SwingTreePathProvider(event.getPath());
                        XUnoNode oUnoNode = oSwingTreePathProvider.getLastPathComponent();
                        if (!m_oInspectorPane.expandNode(oUnoNode, oSwingTreePathProvider)){
                            throw new ExpandVetoException(event);
View Full Code Here

            public void treeWillExpand(TreeExpansionEvent e) throws ExpandVetoException {
            }
        }
        ;
        TreeWillExpandListener TreeWillExpandListener1 = new ConcreteTreeWillExpandListener();
        TreeWillExpandListener TreeWillExpandListener2 = new ConcreteTreeWillExpandListener();
        TreeWillExpandListener TreeWillExpandListener3 = new ConcreteTreeWillExpandListener();
        EventListener[] listenersArray = null;
        listenersArray = tree.getTreeWillExpandListeners();
        int initialValue = listenersArray.length;
        tree.addTreeWillExpandListener(TreeWillExpandListener1);
        tree.addTreeWillExpandListener(TreeWillExpandListener2);
View Full Code Here

                collapseMarker.setAuxiliary(event);
            }
        });
        final Marker willExpandMarker = new Marker();
        final Marker willCollapseMarker = new Marker();
        tree.addTreeWillExpandListener(new TreeWillExpandListener() {
            public void treeWillExpand(final TreeExpansionEvent event)
                    throws ExpandVetoException {
                willExpandMarker.setOccurred();
                willExpandMarker.setAuxiliary(event);
            }
View Full Code Here

        assertFalse(tree.isExpanded(unexistedPath));
        tree.setExpandedState(path111, false);
        assertTrue(tree.isExpanded(path1));
        assertTrue(tree.isExpanded(path11));
        assertFalse(tree.isExpanded(path111));
        tree.addTreeWillExpandListener(new TreeWillExpandListener() {
            public void treeWillExpand(TreeExpansionEvent event) throws ExpandVetoException {
                throw new ExpandVetoException(event);
            }

            public void treeWillCollapse(TreeExpansionEvent event) throws ExpandVetoException {
            }
        });
        tree.setExpandedState(path111, true);
        assertTrue(tree.isExpanded(path1));
        assertTrue(tree.isExpanded(path11));
        assertFalse(tree.isExpanded(path111));
        tree.addTreeWillExpandListener(new TreeWillExpandListener() {
            public void treeWillExpand(TreeExpansionEvent event) throws ExpandVetoException {
            }

            public void treeWillCollapse(TreeExpansionEvent event) throws ExpandVetoException {
                throw new ExpandVetoException(event);
View Full Code Here

/**
* author: lesya
*/
public class SmartExpander {
  public static void installOn(final JTree tree){
    tree.addTreeWillExpandListener(new TreeWillExpandListener() {
      public void treeWillCollapse(TreeExpansionEvent event) {
        TreePath path = event.getPath();
        Enumeration children = ((TreeNode)path.getLastPathComponent()).children();
        while (children.hasMoreElements()) {
          TreePath childPath = path.pathByAddingChild(children.nextElement());
View Full Code Here

          setIcon(((JNode) value).getIcon());
        }
        return c;
      }
    });
    tree.addTreeWillExpandListener(new TreeWillExpandListener() {
      @Override
      public void treeWillExpand(TreeExpansionEvent event) throws ExpandVetoException {
        TreePath path = event.getPath();
        Object node = path.getLastPathComponent();
        if (node instanceof JClass) {
View Full Code Here

TOP

Related Classes of javax.swing.event.TreeWillExpandListener

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.