Package javax.swing.tree.DefaultTreeCellEditor

Examples of javax.swing.tree.DefaultTreeCellEditor.DefaultTextField


        assertSame(b, defaultTextField.border);
    }

    public void testDefaultTextField_getSetBorder() throws Exception {
        Border b = BorderFactory.createBevelBorder(0);
        DefaultTreeCellEditor.DefaultTextField defaultTextField = editor.new DefaultTextField(b);
        assertSame(b, defaultTextField.getBorder());
        propertyChangeController = new PropertyChangeController();
        defaultTextField.addPropertyChangeListener(propertyChangeController);
        b = BorderFactory.createEmptyBorder();
        defaultTextField.setBorder(b);
        assertSame(b, defaultTextField.getBorder());
        assertTrue(propertyChangeController.isChanged("border"));
    }
View Full Code Here


        assertSame(b, defaultTextField.getBorder());
        assertTrue(propertyChangeController.isChanged("border"));
    }

    public void testDefaultTextField_getFont() throws Exception {
        DefaultTreeCellEditor.DefaultTextField defaultTextField = editor.new DefaultTextField(
                BorderFactory.createBevelBorder(0));
        assertEquals(UIManager.getFont("TextField.font"), defaultTextField.getFont());
        Font f = new Font("font", 0, 30);
        defaultTextField.setFont(f);
        assertEquals(f, defaultTextField.getFont());
        defaultTextField.setFont(null);
        assertNull(defaultTextField.getFont());
        editor.setFont(f);
        assertNull(defaultTextField.getFont());
        editor.renderer.setFont(f);
        assertNull(defaultTextField.getFont());
        editor.tree.setFont(f);
        assertNull(defaultTextField.getFont());
    }
View Full Code Here

        editor.tree.setFont(f);
        assertNull(defaultTextField.getFont());
    }

    public void testDefaultTextField_getPreferredSize() throws Exception {
        DefaultTreeCellEditor.DefaultTextField defaultTextField = editor.new DefaultTextField(
                BorderFactory.createBevelBorder(0));
        defaultTextField.setText("value");
        assertEquals(new Dimension(new JTextField("value").getPreferredSize().width, 0),
                defaultTextField.getPreferredSize());
        editor.renderer.setPreferredSize(new Dimension(100, 200));
        assertEquals(new Dimension(new JTextField("value").getPreferredSize().width, 200),
                defaultTextField.getPreferredSize());
    }
View Full Code Here

        editor.getTreeCellEditorComponent(tree, "any", false, true, false, 0);
        assertTrue(editor.editingComponent instanceof DefaultTreeCellEditor.DefaultTextField);
        DefaultTreeCellEditor.DefaultTextField defaultTextField = (DefaultTreeCellEditor.DefaultTextField) editor.editingComponent;
        assertEquals(UIManager.getBorder("Tree.editorBorder"), defaultTextField.border);
        Border b = BorderFactory.createBevelBorder(0);
        defaultTextField = editor.new DefaultTextField(b);
        assertSame(b, defaultTextField.border);
    }
View Full Code Here

        assertSame(b, defaultTextField.border);
    }

    public void testDefaultTextField_getSetBorder() throws Exception {
        Border b = BorderFactory.createBevelBorder(0);
        DefaultTreeCellEditor.DefaultTextField defaultTextField = editor.new DefaultTextField(b);
        assertSame(b, defaultTextField.getBorder());
        propertyChangeController = new PropertyChangeController();
        defaultTextField.addPropertyChangeListener(propertyChangeController);
        b = BorderFactory.createEmptyBorder();
        defaultTextField.setBorder(b);
        assertSame(b, defaultTextField.getBorder());
        assertTrue(propertyChangeController.isChanged("border"));
    }
View Full Code Here

        assertSame(b, defaultTextField.getBorder());
        assertTrue(propertyChangeController.isChanged("border"));
    }

    public void testDefaultTextField_getFont() throws Exception {
        DefaultTreeCellEditor.DefaultTextField defaultTextField = editor.new DefaultTextField(
                BorderFactory.createBevelBorder(0));
        assertEquals(UIManager.getFont("TextField.font"), defaultTextField.getFont());
        Font f = new Font("font", 0, 30);
        defaultTextField.setFont(f);
        assertEquals(f, defaultTextField.getFont());
        defaultTextField.setFont(null);
        assertNull(defaultTextField.getFont());
        editor.setFont(f);
        assertNull(defaultTextField.getFont());
        editor.renderer.setFont(f);
        assertNull(defaultTextField.getFont());
        editor.tree.setFont(f);
        assertNull(defaultTextField.getFont());
    }
View Full Code Here

        editor.tree.setFont(f);
        assertNull(defaultTextField.getFont());
    }

    public void testDefaultTextField_getPreferredSize() throws Exception {
        DefaultTreeCellEditor.DefaultTextField defaultTextField = editor.new DefaultTextField(
                BorderFactory.createBevelBorder(0));
        defaultTextField.setText("value");
        assertEquals(new Dimension(new JTextField("value").getPreferredSize().width, 0),
                defaultTextField.getPreferredSize());
        editor.renderer.setPreferredSize(new Dimension(100, 200));
        assertEquals(new Dimension(new JTextField("value").getPreferredSize().width, 200),
                defaultTextField.getPreferredSize());
    }
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.