diff options
| author | Paul Buetow <paul@buetow.org> | 2008-05-21 19:01:48 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2008-05-21 19:01:48 +0000 |
| commit | db4ae1c41883f6f78d8107429f7f4871c45f47d5 (patch) | |
| tree | d84d754176060afddc89b00d6cf7d4b97d3d049f /sources/prefs/editors/VSEditorTable.java | |
| parent | 004458bb854fe4376fe35ec55d7f08853e08895b (diff) | |
Ok inline editor seems to work.
Diffstat (limited to 'sources/prefs/editors/VSEditorTable.java')
| -rw-r--r-- | sources/prefs/editors/VSEditorTable.java | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/sources/prefs/editors/VSEditorTable.java b/sources/prefs/editors/VSEditorTable.java index ef4488f..8d5de52 100644 --- a/sources/prefs/editors/VSEditorTable.java +++ b/sources/prefs/editors/VSEditorTable.java @@ -10,7 +10,7 @@ import javax.swing.table.*; import prefs.*; public class VSEditorTable extends JTable { - private static final int MIN_ROWS = 20; + private static final int MIN_ROWS = 20; private VSPrefs prefs; private ArrayList<VSNode> nodes; private VSEditorTableModel model; @@ -32,9 +32,9 @@ public class VSEditorTable extends JTable { return comp; } - public Component getRendererComponent() { - return comp; - } + public Component getRendererComponent() { + return comp; + } } private class VSEditorTableModel extends AbstractTableModel implements TableCellRenderer { @@ -78,41 +78,41 @@ public class VSEditorTable extends JTable { VSNode node = nodes.get(row); - if (col == 0) { - JTextField field = new JTextField(" "+node.getKey()+":"); - field.setBorder(null); - field.setEditable(false); - field.setBackground(Color.WHITE); - return field; - } + if (col == 0) { + JTextField field = new JTextField(" "+node.getKey()+":"); + field.setBorder(null); + field.setEditable(false); + field.setBackground(Color.WHITE); + return field; + } return node.getRendererComponent(); } } - private class VSTableCellEditor extends AbstractCellEditor implements TableCellEditor { + private class VSTableCellEditor extends AbstractCellEditor implements TableCellEditor { - public Component getTableCellEditorComponent(JTable table, Object object, - boolean isSelected, int row, int col) { + public Component getTableCellEditorComponent(JTable table, Object object, + boolean isSelected, int row, int col) { return nodes.get(row).getComponent(); - } + } - public Object getCellEditorValue() { - return new String(""); + public Object getCellEditorValue() { + return new String(""); + } } - } public VSEditorTable(VSPrefs prefs) { this.prefs = prefs; this.nodes = new ArrayList<VSNode>(); this.model = new VSEditorTableModel(); setModel(model); - setDefaultRenderer(Object.class, model); - setDefaultEditor(Object.class, new VSTableCellEditor()); - setIntercellSpacing(new Dimension(5, 5)); - setRowHeight(25); + setDefaultRenderer(Object.class, model); + setDefaultEditor(Object.class, new VSTableCellEditor()); + setIntercellSpacing(new Dimension(5, 5)); + setRowHeight(25); setBackground(Color.WHITE); - getTableHeader().setVisible(false); + getTableHeader().setVisible(false); TableColumn col = getColumnModel().getColumn(1); col.setMaxWidth(90); col.setResizable(false); |
