diff -r f3ba21170329 -r 279604933063 java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/gui/Panel.java --- a/java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/gui/Panel.java Sun Oct 07 15:11:42 2012 +0200 +++ b/java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/gui/Panel.java Sun Oct 07 16:15:00 2012 +0200 @@ -34,6 +34,7 @@ */ public class Panel extends javax.swing.JPanel { + private static final int SLOUPEC_NÁZVU = 0; private static final Logger log = Logger.getLogger(Panel.class.getSimpleName()); private static final ResourceBundle překlady = ResourceBundle.getBundle("cz.frantovo.rozsireneAtributy.Překlady"); private Model model; @@ -45,7 +46,7 @@ initComponents(); tabulka = new JTable(model); - tabulka.getColumnModel().getColumn(0).setCellEditor(new EditorNázvůAtributů()); + nastavEditor(); tabulka.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); posuvnýPanel.setViewportView(tabulka); @@ -66,10 +67,20 @@ }); } + private void nastavEditor() { + tabulka.getColumnModel().getColumn(SLOUPEC_NÁZVU).setCellEditor(new EditorNázvůAtributů()); + } + private Model getModel() { return model; } + public void setModel(Model model) { + this.model = model; + tabulka.setModel(model); + nastavEditor(); + } + private void zobrazChybovouHlášku(String hláška, Throwable chyba) { JOptionPane.showMessageDialog(this, hláška, překlady.getString("chyba"), JOptionPane.ERROR_MESSAGE); log.log(Level.WARNING, hláška, chyba);