@Test public void testIsCellEditable() { Assert.assertFalse(this.model.isCellEditable(this.referenceGroupA, 0)); Assert.assertFalse(this.model.isCellEditable(this.referenceGroupA, 1)); Assert.assertFalse(this.model.isCellEditable(this.referenceGroupA, 2)); Assert.assertTrue(this.model.isCellEditable(this.referenceGroupA, 3)); Assert.assertTrue(this.model.isCellEditable(this.referenceGroupA, 4)); Assert.assertFalse(this.model.isCellEditable(this.referenceGroupA, 5)); Assert.assertTrue(this.model.isCellEditable(this.referenceGroupA, 6)); Assert.assertTrue(this.model.isCellEditable(this.referenceGroupA, 7)); Assert.assertFalse(this.model.isCellEditable(this.referenceGroupB, 0)); Assert.assertFalse(this.model.isCellEditable(this.referenceGroupB, 1)); Assert.assertFalse(this.model.isCellEditable(this.referenceGroupB, 2)); Assert.assertTrue(this.model.isCellEditable(this.referenceGroupB, 3)); Assert.assertTrue(this.model.isCellEditable(this.referenceGroupB, 4)); Assert.assertTrue(this.model.isCellEditable(this.referenceGroupB, 5)); Assert.assertTrue(this.model.isCellEditable(this.referenceGroupB, 6)); Assert.assertTrue(this.model.isCellEditable(this.referenceGroupB, 7)); Assert.assertFalse(this.model.isCellEditable(this.referenceGroupC, 0)); Assert.assertFalse(this.model.isCellEditable(this.referenceGroupC, 1)); Assert.assertFalse(this.model.isCellEditable(this.referenceGroupC, 2)); Assert.assertTrue(this.model.isCellEditable(this.referenceGroupC, 3)); Assert.assertTrue(this.model.isCellEditable(this.referenceGroupC, 4)); Assert.assertTrue(this.model.isCellEditable(this.referenceGroupC, 5)); Assert.assertFalse(this.model.isCellEditable(this.referenceGroupC, 6)); Assert.assertTrue(this.model.isCellEditable(this.referenceGroupC, 7)); final UUID referenceFunctionA1 = this.model.getChild(this.referenceGroupA, 0); Assert.assertFalse(this.model.isCellEditable(referenceFunctionA1, 0)); Assert.assertFalse(this.model.isCellEditable(referenceFunctionA1, 1)); Assert.assertFalse(this.model.isCellEditable(referenceFunctionA1, 2)); Assert.assertFalse(this.model.isCellEditable(referenceFunctionA1, 3)); Assert.assertFalse(this.model.isCellEditable(referenceFunctionA1, 4)); Assert.assertFalse(this.model.isCellEditable(referenceFunctionA1, 5)); Assert.assertTrue(this.model.isCellEditable(referenceFunctionA1, 6)); Assert.assertTrue(this.model.isCellEditable(referenceFunctionA1, 7)); final UUID referenceFunctionA2 = this.model.getChild(this.referenceGroupA, 1); Assert.assertFalse(this.model.isCellEditable(referenceFunctionA2, 0)); Assert.assertFalse(this.model.isCellEditable(referenceFunctionA2, 1)); Assert.assertFalse(this.model.isCellEditable(referenceFunctionA2, 2)); Assert.assertFalse(this.model.isCellEditable(referenceFunctionA2, 3)); Assert.assertFalse(this.model.isCellEditable(referenceFunctionA2, 4)); Assert.assertTrue(this.model.isCellEditable(referenceFunctionA2, 5)); Assert.assertTrue(this.model.isCellEditable(referenceFunctionA2, 6)); Assert.assertTrue(this.model.isCellEditable(referenceFunctionA2, 7)); final UUID referenceFunctionA3 = this.model.getChild(this.referenceGroupA, 2); Assert.assertFalse(this.model.isCellEditable(referenceFunctionA3, 0)); Assert.assertFalse(this.model.isCellEditable(referenceFunctionA3, 1)); Assert.assertFalse(this.model.isCellEditable(referenceFunctionA3, 2)); Assert.assertFalse(this.model.isCellEditable(referenceFunctionA3, 3)); Assert.assertFalse(this.model.isCellEditable(referenceFunctionA3, 4)); Assert.assertTrue(this.model.isCellEditable(referenceFunctionA3, 5)); Assert.assertFalse(this.model.isCellEditable(referenceFunctionA3, 6)); Assert.assertTrue(this.model.isCellEditable(referenceFunctionA3, 7)); }
@Override public boolean isCellEditable(final Object reference, final int columnIndex) { switch (columnIndex) { case 3: return !(this.rowMapping.get(reference) instanceof SynFunctionRow); case 4: return !(this.rowMapping.get(reference) instanceof SynFunctionRow); case 5: return this.getChildren(this.getParent(reference)).indexOf(reference) > 0; case 6: final List<UUID> siblings = this.getChildren(this.getParent(reference)); return siblings.indexOf(reference) + 1 < siblings.size(); case 7: return true; default: return false; } }
SynFunctionTreeModel extends AbstractTreeTableModel implements ISyntacticalFunctionProvider { @Override public boolean isCellEditable(final Object reference, final int columnIndex) { switch (columnIndex) { case 3: return !(this.rowMapping.get(reference) instanceof SynFunctionRow); case 4: return !(this.rowMapping.get(reference) instanceof SynFunctionRow); case 5: return this.getChildren(this.getParent(reference)).indexOf(reference) > 0; case 6: final List<UUID> siblings = this.getChildren(this.getParent(reference)); return siblings.indexOf(reference) + 1 < siblings.size(); case 7: return true; default: return false; } } }
SynFunctionTreeModel extends AbstractTreeTableModel implements ISyntacticalFunctionProvider { @Override public boolean isCellEditable(final Object reference, final int columnIndex) { switch (columnIndex) { case 3: return !(this.rowMapping.get(reference) instanceof SynFunctionRow); case 4: return !(this.rowMapping.get(reference) instanceof SynFunctionRow); case 5: return this.getChildren(this.getParent(reference)).indexOf(reference) > 0; case 6: final List<UUID> siblings = this.getChildren(this.getParent(reference)); return siblings.indexOf(reference) + 1 < siblings.size(); case 7: return true; default: return false; } } SynFunctionTreeModel(); }
SynFunctionTreeModel extends AbstractTreeTableModel implements ISyntacticalFunctionProvider { @Override public boolean isCellEditable(final Object reference, final int columnIndex) { switch (columnIndex) { case 3: return !(this.rowMapping.get(reference) instanceof SynFunctionRow); case 4: return !(this.rowMapping.get(reference) instanceof SynFunctionRow); case 5: return this.getChildren(this.getParent(reference)).indexOf(reference) > 0; case 6: final List<UUID> siblings = this.getChildren(this.getParent(reference)); return siblings.indexOf(reference) + 1 < siblings.size(); case 7: return true; default: return false; } } SynFunctionTreeModel(); void reset(final ISyntacticalFunctionProvider provider); @Override List<List<AbstractSyntacticalFunctionElement>> provideFunctions(); @Override int getColumnCount(); @Override boolean isCellEditable(final Object reference, final int columnIndex); @Override Object getValueAt(final Object reference, final int columnIndex); @Override UUID getChild(final Object parentReference, final int childIndex); @Override int getChildCount(final Object parentReference); @Override int getIndexOfChild(final Object parentReference, final Object childReference); TreePath addSynFunctionRow(final TreePath parentPath); TreePath addGroupRow(final TreePath parentPath); TreePath addTopLevelGroup(); void moveEntry(final TreePath targetPath, final boolean moveDown); void removeEntry(final TreePath targetPath); void updatedRow(final TreePath updatedPath); }
SynFunctionTreeModel extends AbstractTreeTableModel implements ISyntacticalFunctionProvider { @Override public boolean isCellEditable(final Object reference, final int columnIndex) { switch (columnIndex) { case 3: return !(this.rowMapping.get(reference) instanceof SynFunctionRow); case 4: return !(this.rowMapping.get(reference) instanceof SynFunctionRow); case 5: return this.getChildren(this.getParent(reference)).indexOf(reference) > 0; case 6: final List<UUID> siblings = this.getChildren(this.getParent(reference)); return siblings.indexOf(reference) + 1 < siblings.size(); case 7: return true; default: return false; } } SynFunctionTreeModel(); void reset(final ISyntacticalFunctionProvider provider); @Override List<List<AbstractSyntacticalFunctionElement>> provideFunctions(); @Override int getColumnCount(); @Override boolean isCellEditable(final Object reference, final int columnIndex); @Override Object getValueAt(final Object reference, final int columnIndex); @Override UUID getChild(final Object parentReference, final int childIndex); @Override int getChildCount(final Object parentReference); @Override int getIndexOfChild(final Object parentReference, final Object childReference); TreePath addSynFunctionRow(final TreePath parentPath); TreePath addGroupRow(final TreePath parentPath); TreePath addTopLevelGroup(); void moveEntry(final TreePath targetPath, final boolean moveDown); void removeEntry(final TreePath targetPath); void updatedRow(final TreePath updatedPath);  }