Examples of DynamicTableCellEditor


Examples of org.apache.tools.ant.gui.customizer.DynamicTableCellEditor

        TableColumn tableColumn = _table.getColumnModel().getColumn(0);
        tableColumn.setCellEditor(new DefaultCellEditor(_combo));

        // Set the second column to use a DynamicEditor
        TableColumn secondCol = _table.getColumnModel().getColumn(1);
        final DynamicTableCellEditor cellEditor = new DynamicTableCellEditor();
        secondCol.setCellEditor(cellEditor);

        // Listen for property changes to update the cell editor with
        // registered types for editing.
        _table.addPropertyChangeListener(new PropertyChangeListener() {
            public void propertyChange(PropertyChangeEvent e) {
                String selection = (String)_table.getModel().getValueAt(
                                _table.getSelectedRow(), 0);
                if(selection != null && !selection.equals("")) {
                    Class type = null;
                    try {
                        type = _attributes.getType(selection);
                        cellEditor.register(selection, type);
                    } catch (ClassNotFoundException exp) {
                        exp.printStackTrace();
                    }
                }
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.