Package javax.swing.plaf.basic

Examples of javax.swing.plaf.basic.BasicComboBoxEditor


        assertTrue(propertyChangeController.isChanged("renderer"));
    }

    public void testGetSetEditor() throws Exception {
        assertNotNull(comboBox.getEditor());
        ComboBoxEditor newEditor = new BasicComboBoxEditor();
        comboBox.setEditor(newEditor);
        assertEquals(newEditor, comboBox.getEditor());
        assertTrue(propertyChangeController.isChanged("editor"));
        comboBox.setEditor(null);
        assertNull(comboBox.getEditor());
View Full Code Here


        assertTrue(propertyChangeController.isChanged("renderer"));
    }

    public void testGetSetEditor() throws Exception {
        assertNotNull(comboBox.getEditor());
        ComboBoxEditor newEditor = new BasicComboBoxEditor();
        comboBox.setEditor(newEditor);
        assertEquals(newEditor, comboBox.getEditor());
        assertTrue(propertyChangeController.isChanged("editor"));
        comboBox.setEditor(null);
        assertNull(comboBox.getEditor());
View Full Code Here

    comboBox = new JComboBox();
    final ComboBoxEditor boxEditor = comboBox.getEditor();
    if (boxEditor instanceof BasicComboBoxEditor)
    {
      final BasicComboBoxEditor basicComboBoxEditor = (BasicComboBoxEditor) boxEditor;
      final Object editorComponent = basicComboBoxEditor.getEditorComponent();
      if (editorComponent instanceof JTextField)
      {
        final JTextField editorTextField = (JTextField) editorComponent;
        editorTextField.setDocument(new NonFilteringPlainDocument());
      }
View Full Code Here

    comboBox = new JComboBox();
    final ComboBoxEditor boxEditor = comboBox.getEditor();
    if (boxEditor instanceof BasicComboBoxEditor)
    {
      final BasicComboBoxEditor basicComboBoxEditor = (BasicComboBoxEditor) boxEditor;
      final Object editorComponent = basicComboBoxEditor.getEditorComponent();
      if (editorComponent instanceof JTextField)
      {
        final JTextField editorTextField = (JTextField) editorComponent;
        editorTextField.setDocument(new NonFilteringPlainDocument());
      }
View Full Code Here

   *
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)     
  {
    BasicComboBoxEditor e = new BasicComboBoxEditor();
    JTextField f = (JTextField) e.getEditorComponent();
    harness.check(f.getColumns(), 9);
    harness.check(f.getBorder(), null);
  }
View Full Code Here

   *
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)     
  {
    BasicComboBoxEditor e = new BasicComboBoxEditor();
    JTextField tf = (JTextField) e.getEditorComponent();
    ActionListener[] listeners = tf.getActionListeners();
    harness.check(listeners.length, 0);
   
    e.addActionListener(this);
    listeners = tf.getActionListeners();
    harness.check(listeners.length, 1);
    harness.check(listeners[0], this);
   
    e.removeActionListener(this);
    listeners = tf.getActionListeners();
    harness.check(listeners.length, 0);
   
    // remove a listener that isn't there
    e.removeActionListener(this);
    listeners = tf.getActionListeners();
    harness.check(listeners.length, 0);

    // try null
    e.removeActionListener(null);
    listeners = tf.getActionListeners();
    harness.check(listeners.length, 0);   
  }
View Full Code Here

   *
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)     
  {
    BasicComboBoxEditor e = new BasicComboBoxEditor();
    JTextField tf = (JTextField) e.getEditorComponent();
    ActionListener[] listeners = tf.getActionListeners();
    harness.check(listeners.length, 0);
   
    e.addActionListener(this);
    listeners = tf.getActionListeners();
    harness.check(listeners.length, 1);
    harness.check(listeners[0], this);
   
    // try null
    e.addActionListener(null);
    listeners = tf.getActionListeners();
    harness.check(listeners.length, 1);   
  }
View Full Code Here

        assertTrue(propertyChangeController.isChanged("renderer"));
    }

    public void testGetSetEditor() throws Exception {
        assertNotNull(comboBox.getEditor());
        ComboBoxEditor newEditor = new BasicComboBoxEditor();
        comboBox.setEditor(newEditor);
        assertEquals(newEditor, comboBox.getEditor());
        assertTrue(propertyChangeController.isChanged("editor"));
        comboBox.setEditor(null);
        assertNull(comboBox.getEditor());
View Full Code Here

    public EditorComponent(JTable t, Color c) {
      super();
      this.setBorder(null);
      color = c;
      this.table = t;
      this.setEditor(new BasicComboBoxEditor() {
        public Component getEditorComponent() {
          return colorEditor;
        }

        public Object getItem() {
View Full Code Here

    public EditorComponent(JTable t, Color c) {
      super();
      this.setBorder(null);
      color = c;
      this.table = t;
      this.setEditor(new BasicComboBoxEditor() {
        public Component getEditorComponent() {
          return colorEditor;
        }

        public Object getItem() {
View Full Code Here

TOP

Related Classes of javax.swing.plaf.basic.BasicComboBoxEditor

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.