/** * Search for the SpecTC of an ExecTC and opens the corresponding editor if possible. * * @param structuredSel the current selection */ private void openSpecNode(IStructuredSelection structuredSel) { ISpecTestCasePO specTc = UINodeBP.getSpecTC(structuredSel); if (specTc != null) { openEditorForSpecTC(specTc); } else { ITestSuitePO testSuite = UINodeBP.getSpecTS(structuredSel); openEditorForSpecTS(testSuite); } }
/** {@inheritDoc} */ public void handleDataChanged(IPersistentObject po, DataState dataState) { if (po instanceof INodePO) { TreeViewer tv = getTreeViewer(); switch (dataState) { case Added: INodePO addedNode = (INodePO) po; INodePO editorNode = (INodePO) getEditorHelper().getEditSupport().getWorkVersion(); if (editorNode.indexOf(addedNode) > -1) { getTreeViewer().refresh(); getTreeViewer().expandAll(); UINodeBP.setFocusAndSelection(new StructuredSelection(addedNode), tv); } break; case Deleted: if (!(po instanceof IProjectPO)) { getTreeViewer().refresh(); setFocus(); } break; case Renamed: createPartName(); break; case StructureModified: if (!handleStructureModified(po)) { return; } break; case ReuseChanged: // nothing yet! break; default: Assert.notReached(); } getEditorHelper().handleDataChanged(po, dataState); } }