Branch merge. debugger_view_renderers
authormentlicher@netbeans.org
Tue, 08 Jun 2010 16:24:33 +0200
branchdebugger_view_renderers
changeset 17458168ecaa97541f
parent 174579 03a104c8674f
parent 174580 a4e6e9dc3140
child 174582 2171a46f3008
Branch merge.
     1.1 --- a/spi.viewmodel/src/org/netbeans/modules/viewmodel/TreeModelNode.java	Mon Jun 07 17:12:07 2010 +0200
     1.2 +++ b/spi.viewmodel/src/org/netbeans/modules/viewmodel/TreeModelNode.java	Tue Jun 08 16:24:33 2010 +0200
     1.3 @@ -1615,6 +1615,10 @@
     1.4          */
     1.5          @Override
     1.6          public boolean canWrite () {
     1.7 +            try {
     1.8 +                return model.canEditCell(object, columnModel.getID());
     1.9 +            } catch (UnknownTypeException ex) {
    1.10 +            }
    1.11              if (nodeColumn) return false;
    1.12              try {
    1.13                  return !model.isReadOnly (object, columnModel.getID ());
     2.1 --- a/spi.viewmodel/test/unit/src/org/netbeans/modules/viewmodel/TableRendererTest.java	Mon Jun 07 17:12:07 2010 +0200
     2.2 +++ b/spi.viewmodel/test/unit/src/org/netbeans/modules/viewmodel/TableRendererTest.java	Tue Jun 08 16:24:33 2010 +0200
     2.3 @@ -175,6 +175,7 @@
     2.4          System.out.println("table rows = "+t.getRowCount());
     2.5          TableCellEditor tce = t.getCellEditor(0, 0);
     2.6          assertTrue(tce+"is not editable.", tce.isCellEditable(getMouseClickAt(t, 0, 0)));
     2.7 +        //assertTrue(t+"is not editable.", t.isCellEditable(0, 0));
     2.8          Component c = tce.getTableCellEditorComponent(t, null, true, 0, 0);
     2.9          //System.err.println("c = "+c);
    2.10          assertTrue("Editor component = "+c, c instanceof EditorComponent);
    2.11 @@ -182,40 +183,47 @@
    2.12  
    2.13          tce = t.getCellEditor(0, 1);
    2.14          assertTrue(tce+"is not editable.", tce.isCellEditable(getMouseClickAt(t, 0, 1)));
    2.15 +        assertTrue(t+"is not editable.", t.isCellEditable(0, 1));
    2.16          c = tce.getTableCellEditorComponent(t, null, true, 0, 1);
    2.17          assertTrue("Editor component = "+c, c instanceof EditorComponent);
    2.18          assertEquals("Editor of 0:col1", ((EditorComponent) c).getText());
    2.19  
    2.20          tce = t.getCellEditor(0, 2);
    2.21          assertTrue(tce+"is not editable.", tce.isCellEditable(getMouseClickAt(t, 0, 2)));
    2.22 +        assertTrue(t+"is not editable.", t.isCellEditable(0, 2));
    2.23          c = tce.getTableCellEditorComponent(t, null, true, 0, 2);
    2.24          assertTrue("Editor component = "+c, c instanceof EditorComponent);
    2.25          assertEquals("Editor of 0:col2", ((EditorComponent) c).getText());
    2.26  
    2.27          tce = t.getCellEditor(1, 0);
    2.28          assertFalse(tce+"is editable.", tce.isCellEditable(getMouseClickAt(t, 1, 0)));
    2.29 +        assertFalse(t+"is editable.", t.isCellEditable(1, 0));
    2.30          c = tce.getTableCellEditorComponent(t, null, true, 1, 0);
    2.31          assertFalse("Editor component = "+c, c instanceof EditorComponent);
    2.32  
    2.33          tce = t.getCellEditor(1, 2);
    2.34          assertFalse(tce+"is editable.", tce.isCellEditable(getMouseClickAt(t, 1, 2)));
    2.35 +        assertFalse(t+"is editable.", t.isCellEditable(1, 2));
    2.36          c = tce.getTableCellEditorComponent(t, null, true, 1, 2);
    2.37          assertFalse("Editor component = "+c, c instanceof EditorComponent);
    2.38  
    2.39          tce = t.getCellEditor(3, 1);
    2.40          assertTrue(tce+"is not editable.", tce.isCellEditable(getMouseClickAt(t, 3, 1)));
    2.41 +        assertTrue(t+"is not editable.", t.isCellEditable(3, 1));
    2.42          c = tce.getTableCellEditorComponent(t, null, true, 3, 1);
    2.43          assertTrue("Editor component = "+c, c instanceof EditorComponent);
    2.44          assertEquals("Editor of 3:col1", ((EditorComponent) c).getText());
    2.45  
    2.46          tce = t.getCellEditor(6, 0);
    2.47          assertTrue(tce+"is not editable.", tce.isCellEditable(getMouseClickAt(t, 6, 0)));
    2.48 +        assertTrue(t+"is not editable.", t.isCellEditable(6, 0));
    2.49          c = tce.getTableCellEditorComponent(t, null, true, 6, 0);
    2.50          assertTrue("Editor component = "+c, c instanceof EditorComponent);
    2.51          assertEquals("Editor of 6:DN", ((EditorComponent) c).getText());
    2.52  
    2.53          tce = t.getCellEditor(9, 2);
    2.54          assertTrue(tce+"is not editable.", tce.isCellEditable(getMouseClickAt(t, 9, 2)));
    2.55 +        assertTrue(t+"is not editable.", t.isCellEditable(9, 2));
    2.56          c = tce.getTableCellEditorComponent(t, null, true, 9, 2);
    2.57          assertTrue("Editor component = "+c, c instanceof EditorComponent);
    2.58          assertEquals("Editor of 9:col2", ((EditorComponent) c).getText());