Examples of TreeSelectionEvent


Examples of javax.swing.event.TreeSelectionEvent

        TreePath path = new TreePath("asd");
        TreePath oldSelection = new TreePath("old");
        TreePath newSelection = new TreePath("new");
        Object source = new Object();
        boolean isNew = true;
        TreeSelectionEvent event = new TreeSelectionEvent(source, path, isNew, oldSelection,
                newSelection);
        model.fireValueChanged(event);
        assertSame(event, listener.event);
        listener.reset();
        model.fireValueChanged(null);
View Full Code Here

Examples of javax.swing.event.TreeSelectionEvent

        assertEquals(0, ((DefaultCellEditor) editor.realEditor).getCellEditorListeners().length);
    }

    public void testValueChanged() throws Exception {
        TreePath treePath = new TreePath("root");
        editor.valueChanged(new TreeSelectionEvent(tree, treePath, true, null, treePath));
        if (isHarmony()) {
            assertEquals(treePath, editor.lastPath);
        } else {
            assertNull(editor.lastPath);
        }
View Full Code Here

Examples of javax.swing.event.TreeSelectionEvent

            for (int counter = 0; counter < cPathCount; counter++) {
                newness[counter] = isNew;
            }

            TreeSelectionEvent event = new TreeSelectionEvent
                    (this, changedPaths, newness, oldLeadSelection, leadPath);

            fireValueChanged(event);
        }
    }
View Full Code Here

Examples of javax.swing.event.TreeSelectionEvent

    /**
     * Notifies listeners of a tree selection change.
     */
    protected void fireTreeSelectionEvent(Object[] selectionPath) {
        TreeSelectionEvent e =
            new TreeSelectionEvent(this, new TreePath(selectionPath), false, null, null);
        synchronized (treeSelectionListeners) {
            Iterator it = treeSelectionListeners.iterator();
            while (it.hasNext()) {
                TreeSelectionListener listener = (TreeSelectionListener) it.next();
                listener.valueChanged(e);
View Full Code Here

Examples of javax.swing.event.TreeSelectionEvent

        assertEquals(0, ((DefaultCellEditor) editor.realEditor).getCellEditorListeners().length);
    }

    public void testValueChanged() throws Exception {
        TreePath treePath = new TreePath("root");
        editor.valueChanged(new TreeSelectionEvent(tree, treePath, true, null, treePath));
        if (isHarmony()) {
            assertEquals(treePath, editor.lastPath);
        } else {
            assertNull(editor.lastPath);
        }
View Full Code Here

Examples of javax.swing.event.TreeSelectionEvent

        TreePath path = new TreePath("asd");
        TreePath oldSelection = new TreePath("old");
        TreePath newSelection = new TreePath("new");
        Object source = new Object();
        boolean isNew = true;
        TreeSelectionEvent event = new TreeSelectionEvent(source, path, isNew, oldSelection,
                newSelection);
        model.fireValueChanged(event);
        assertSame(event, listener.event);
        listener.reset();
        model.fireValueChanged(null);
View Full Code Here

Examples of javax.swing.event.TreeSelectionEvent

      TreePath[] paths = null;
      boolean[] areNew  = new boolean[0];
      TreePath oldLeadSelectionPath = null;
      TreePath newLeadSelectionPath = null;

      TreeSelectionEvent evtTreeSelection = new TreeSelectionEvent(
               (Object) this, //source,
              paths, areNew, oldLeadSelectionPath, newLeadSelectionPath);

      super.fireValueChanged(evtTreeSelection);
   }
View Full Code Here

Examples of javax.swing.event.TreeSelectionEvent

        if (changedPaths == null || changedPaths.size() == 0 ){
            return;
        }

        TreeSelectionEvent event = new TreeSelectionEvent(this,
                                                          PathPlaceHolder.getPathsArray(changedPaths),
                                                          PathPlaceHolder.getAreNewArray(changedPaths),
                                                          oldLeadSelection,
                                                          getLeadSelectionPath());
        fireValueChanged(event);
View Full Code Here

Examples of javax.swing.event.TreeSelectionEvent

    protected void fireTreeSelectionEvent(Object[] selectionPath) {
        if (fireDisabled) {
            return;
        }
       
        TreeSelectionEvent e =
            new TreeSelectionEvent(this, new TreePath(selectionPath), false, null, null);
        synchronized (treeSelectionListeners) {
            for (TreeSelectionListener listener : treeSelectionListeners)
                listener.valueChanged(e);
        }
    }
View Full Code Here

Examples of javax.swing.event.TreeSelectionEvent

        if (changedPaths == null || changedPaths.size() == 0 ){
            return;
        }

        TreeSelectionEvent event = new TreeSelectionEvent(this,
                                                          PathPlaceHolder.getPathsArray(changedPaths),
                                                          PathPlaceHolder.getAreNewArray(changedPaths),
                                                          oldLeadSelection,
                                                          getLeadSelectionPath());
        fireValueChanged(event);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.