Package javax.swing

Examples of javax.swing.DefaultCellEditor$EditorDelegate


                 Sets the cell editor to show up as a JComboBox for columns of type JComboBox.
                 It is not necesary to set a different cell renderer than the default for this case
                 */
                if (theColumn.getItems() != null) {
                    theCombo = new JComboBox(theColumn.getItems());
                    aTable.setDefaultEditor(JComboBox.class, new DefaultCellEditor(theCombo));
                }
            }
        }
    }
View Full Code Here


            data.add(row);
        }

        table_ = new JTable(data, header);

        DefaultCellEditor no_editor = new DefaultCellEditor(new JTextField())
        {
            public boolean isCellEditable(EventObject anEvent)
            {
                return false;
            }
View Full Code Here

        header_.add("Attribute");
        header_.add("Value" );

        renderer_    = new DrawObjectTableCellRenderer();
        editor_      = new DrawObjectTableCellEditor();
        no_editor_   = new DefaultCellEditor(new JTextField())
        {
            public boolean isCellEditable(EventObject anEvent)
            { return false; }
        };
View Full Code Here

    box.addItem("");
    box.addFocusListener(this);
    for (int i = 0; i < nodes.getLength(); i++)
      box.addItem(((Element) nodes.item(i)).getAttribute("Name"));
    tbl.getColumnModel().getColumn(col).setCellEditor(
        new DefaultCellEditor(box));
  }
View Full Code Here

        };
        JTable table = new JTable(model);
        Icon icon = new TestTableIcon();
        JCheckBox check = (JCheckBox) table.getDefaultRenderer(Boolean.class);
        check.setIcon(icon);
        DefaultCellEditor editor = (DefaultCellEditor) table.getDefaultEditor(Boolean.class);
        ((JCheckBox) editor.getComponent()).setIcon(icon);

        final JFrame f = new JFrame();
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.getContentPane().add(new JScrollPane(table));
        f.pack();
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

    authTable = new JTable(tableModel);
    authTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    authTable.setPreferredScrollableViewportSize(new Dimension(100, 70));

    TableColumn passwordColumn = authTable.getColumnModel().getColumn(AuthManager.COL_PASSWORD);
    passwordColumn.setCellEditor(new DefaultCellEditor(new JPasswordField()));
    passwordColumn.setCellRenderer(new PasswordCellRenderer());

    JPanel panel = new JPanel(new BorderLayout(0, 5));
    panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),
        JMeterUtils.getResString("auths_stored"))); //$NON-NLS-1$
View Full Code Here

    public TableCellEditor getCellEditor(int row, int column) {
        Attribute<?,?> attr = ((EntityDataModel)getModel()).getAttribute(column);
        if (attr == null)
            return super.getCellEditor(row, column);
        if (attr.isCollection())
            return new DefaultCellEditor((JComboBox)getCellRenderer(row, column));
        return super.getCellEditor(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

    JComboBox foreground = new JComboBox(foregroundColors);
    foreground.setMaximumRowCount(15);
    foreground.setRenderer(new ColorListCellRenderer());

    DefaultCellEditor backgroundEditor = new DefaultCellEditor(background);
    DefaultCellEditor foregroundEditor = new DefaultCellEditor(foreground);
    JTextField textField = new JTextField();
    textField.addKeyListener(
      new ExpressionRuleContext(filterModel, textField));
    table.getColumnModel().getColumn(0).setCellEditor(
      new DefaultCellEditor(textField));
    table.getColumnModel().getColumn(1).setCellEditor(backgroundEditor);
    table.getColumnModel().getColumn(2).setCellEditor(foregroundEditor);

    background.addItemListener(new ColorItemListener(background));
    foreground.addItemListener(new ColorItemListener(foreground));
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.