Package javax.swing.tree

Examples of javax.swing.tree.DefaultTreeCellEditor$DefaultTextField


    }

    @Override
    protected TreeCellEditor createDefaultCellEditor() {
        TreeCellRenderer renderer = tree.getCellRenderer();
        DefaultTreeCellEditor editor;

        if(renderer != null && (renderer instanceof DefaultTreeCellRenderer)) {
            editor = new SynthTreeCellEditor(tree, (DefaultTreeCellRenderer)
                                             renderer);
        }
View Full Code Here


    protected TreeCellEditor createDefaultCellEditor() {
        DefaultTreeCellRenderer renderer = currentCellRenderer instanceof DefaultTreeCellRenderer
            ? (DefaultTreeCellRenderer)currentCellRenderer
            : null;

        return new DefaultTreeCellEditor(tree, renderer);
    }
View Full Code Here

        assertFalse(tree.isExpanded(path2));
    }

    public void testSetCellEditor() {
        PropertyChangeController listener = new PropertyChangeController();
        DefaultTreeCellEditor editor1 = new DefaultTreeCellEditor(tree,
                (DefaultTreeCellRenderer) tree.getCellRenderer());
        DefaultTreeCellEditor editor2 = new DefaultTreeCellEditor(tree,
                (DefaultTreeCellRenderer) tree.getCellRenderer());
        tree.addPropertyChangeListener(listener);
        TreeCellEditor oldEditor = tree.getCellEditor();
        tree.setCellEditor(editor1);
        listener.checkPropertyFired(tree, "cellEditor", oldEditor, editor1);
View Full Code Here

        assertFalse(ui.isEditing(tree));
        ui.startEditing(new TreePath(root), null);
        assertTrue(ui.isEditing(tree));
        ui.cancelEditing(tree);
        assertFalse(ui.isEditing(tree));
        tree.setCellEditor(new DefaultTreeCellEditor(tree, (DefaultTreeCellRenderer) tree
                .getCellRenderer()) {
            @Override
            public boolean shouldSelectCell(final EventObject event) {
                return false;
            }
View Full Code Here

        }
    }

    public void testSetGetCellEditor() {
        assertNull(ui.getCellEditor());
        DefaultTreeCellEditor editor = new DefaultTreeCellEditor(tree,
                new DefaultTreeCellRenderer());
        tree.setCellEditor(editor);
        assertEquals(editor, ui.getCellEditor());
        ui.setCellEditor(new DefaultTreeCellEditor(tree, new DefaultTreeCellRenderer()));
        assertEquals(editor, ui.getCellEditor());
    }
View Full Code Here

        tree.setShowsRootHandles(true);
        assertEquals(1, ui.depthOffset);
    }

    public void testUpdateCellEditor() {
        DefaultTreeCellEditor e1 = new DefaultTreeCellEditor(tree,
                new DefaultTreeCellRenderer());
        tree.setCellEditor(e1);
        assertSame(e1, tree.getCellEditor());
        assertNull(ui.cellEditor);
        assertSame(e1, ui.getCellEditor());
        tree.setEditable(true);
        assertSame(e1, ui.cellEditor);
        assertSame(e1, ui.getCellEditor());
        DefaultTreeCellEditor e2 = new DefaultTreeCellEditor(tree,
                new DefaultTreeCellRenderer());
        ui.cellEditor = e2;
        assertSame(e1, ui.getCellEditor());
        assertSame(e2, ui.cellEditor);
        ui.updateCellEditor();
View Full Code Here

                valueMarker.setOccurred(messageTree);
            }
        };
        ui.installUI(tree);
        final Marker editorMarker = new Marker();
        TreeCellEditor editor = new DefaultTreeCellEditor(tree, new DefaultTreeCellRenderer()) {
            @Override
            public boolean stopCellEditing() {
                editorMarker.setOccurred();
                return super.stopCellEditing();
            }
View Full Code Here

  public ProjectTree() {

    ProjectTreeRenderer renderer = new ProjectTreeRenderer();
    setCellRenderer(renderer);

    DefaultTreeCellEditor editor = new DefaultTreeCellEditor(this,
        renderer, new ProjectTreeEditor(this));
    setCellEditor(editor);
    setEditable(true);

    setRootVisible(true);
View Full Code Here

   *
   * @return the default cell editor.
   */
  protected TreeCellEditor createDefaultCellEditor()
  {
    DefaultTreeCellEditor ed;
    if (currentCellRenderer != null
        && currentCellRenderer instanceof DefaultTreeCellRenderer)
      ed = new DefaultTreeCellEditor(tree,
                                (DefaultTreeCellRenderer) currentCellRenderer);
    else
      ed = new DefaultTreeCellEditor(tree, null);
    return ed;
  }
View Full Code Here

    }

    @Override
    protected TreeCellEditor createDefaultCellEditor() {
        TreeCellRenderer renderer = tree.getCellRenderer();
        DefaultTreeCellEditor editor;

        if(renderer != null && (renderer instanceof DefaultTreeCellRenderer)) {
            editor = new SynthTreeCellEditor(tree, (DefaultTreeCellRenderer)
                                             renderer);
        }
View Full Code Here

TOP

Related Classes of javax.swing.tree.DefaultTreeCellEditor$DefaultTextField

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.