Package javax.swing

Examples of javax.swing.DefaultCellEditor$EditorDelegate


    private void setUpEditor( JTable l_table )
    {
        //Set up the editor for the integer cells.
        final JTextField l_textField = new JTextField();

        DefaultCellEditor l_textEditor = new DefaultCellEditor( l_textField )
        {
            private static final long serialVersionUID = 3256727286014554675L;


            //Override DefaultCellEditor's getCellEditorValue method
View Full Code Here


    singleValueMetaTableModel = new SingleValueMetaTableModel();

    editor = new InstantEditingTable();
    editor.setDefaultRenderer(Boolean.class, new GenericCellRenderer());
    editor.setDefaultEditor(Boolean.class,
        new DefaultCellEditor(new JComboBox(new Object[]{null, Boolean.TRUE, Boolean.FALSE})));
    editor.setModel(singleValueMetaTableModel);

    setLayout(new BorderLayout());
    // Yes, without a scroll-pane, so that the table looks more like a text-field.
    add(editor, BorderLayout.CENTER);
View Full Code Here

  public void test(TestHarness harness)
  {
    TableColumn c = new TableColumn();
    harness.check(c.getCellEditor(), null);
    c.addPropertyChangeListener(this);
    TableCellEditor editor = new DefaultCellEditor(new JTextField());
    c.setCellEditor(editor);
    harness.check(c.getCellEditor(), editor);
    PropertyChangeEvent e = (PropertyChangeEvent) events.get(0);
    harness.check(e.getPropertyName(), "cellEditor");
    harness.check(e.getOldValue(), null);
View Full Code Here

 
  private void testConstructor4(TestHarness harness
  {
    harness.checkPoint("TableColumn(int, int, TableCellRenderer, TableCellEditor)");
    TableCellRenderer renderer = new DefaultTableCellRenderer();
    TableCellEditor editor = new DefaultCellEditor(new JCheckBox());
    TableColumn c1 = new TableColumn(1, 33, renderer, editor);
    harness.check(c1.getModelIndex(), 1);
    harness.check(c1.getMinWidth(), 15);
    harness.check(c1.getWidth(), 33);
    harness.check(c1.getMaxWidth(), Integer.MAX_VALUE);
View Full Code Here

    return isHeaderEditable;
  }

  protected TableCellEditor createDefaultHeaderEditor()
  {
    return new DefaultCellEditor(new JTextField());
  }
View Full Code Here

       
        for (int row = 0; row < dtm.getRowCount(); row++)
        {
          if (dtm.getDataPointType(row) == EDataPointType.TYPE_DI)
          {
            DefaultCellEditor editor = new DefaultCellEditor(diComboBox);
            rm.addEditorForRow(row, editor);
          }
          else
          {
            //default editor for AI or MI or TI
View Full Code Here

            }

        });

        jTable1.getColumnModel().getColumn(4).setCellEditor(
                new DefaultCellEditor(endEntitiesComboBox));

        final BrowseCellEditor browseCellEditor =
                new BrowseCellEditor(new JTextField(),
                JFileChooser.SAVE_DIALOG);
        browseCellEditor.setClickCountToStart(1);
View Full Code Here

      }else{
        tc.setHeaderValue(Messages.getString("ResourceMappingDialog.ServerResources")); //$NON-NLS-1$
        tc.setPreferredWidth(150);

//        tc.setCellEditor(new ListComboBoxCellEditor(new DefaultComboBoxModel(form.getResources())));
        tc.setCellEditor(new DefaultCellEditor(editorCombo));
      }
      tc.setCellRenderer(new DefaultTableCellRenderer(){
        public Component getTableCellRendererComponent(JTable table, Object value, boolean selected, boolean focused, int row, int column){
          setEnabled(table == null || table.isEnabled());
          super.getTableCellRendererComponent(table, value, selected, focused, row, column);
View Full Code Here

                    return result;
                }
                return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
            }
        });
        table.setDefaultEditor(String.class, new DefaultCellEditor(new JTextField()) {
            public boolean isCellEditable(final EventObject event) {
                return event == null;
            }
        });
View Full Code Here

                        theColor = ColorComponent.getColorByName(theColorName);
                        theColors[i] = theColor;
                    }
                    theCombo = new JComboBox(theColors);
                    theCombo.setRenderer(new ListCellColorRenderer());
                    aTable.setDefaultEditor(ColorComponent.class, new DefaultCellEditor(theCombo));
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of javax.swing.DefaultCellEditor$EditorDelegate

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.