Result Navigator working now.
diff --git a/org.eclipse.rmf.reqif10.search.ui/src/org/eclipse/rmf/reqif10/search/ui/ResultNavigator.java b/org.eclipse.rmf.reqif10.search.ui/src/org/eclipse/rmf/reqif10/search/ui/ResultNavigator.java
index e1abefa..b994381 100644
--- a/org.eclipse.rmf.reqif10.search.ui/src/org/eclipse/rmf/reqif10/search/ui/ResultNavigator.java
+++ b/org.eclipse.rmf.reqif10.search.ui/src/org/eclipse/rmf/reqif10/search/ui/ResultNavigator.java
@@ -37,10 +37,7 @@
if (action.getId().equals(NEXT_ID)) {
match = next();
} else if (action.getId().equals(PREV_ID)) {
-// match = prev();
- MessageDialog.openInformation(editor.getSite().getShell(),
- "No implemented", "Previous not yet implemented.");
- return;
+ match = prev();
} else {
throw new IllegalStateException(action + "");
}
@@ -71,7 +68,6 @@
@Override
public void setActiveEditor(IAction action, IEditorPart targetEditor) {
- System.out.println("Activated:" + action);
if (targetEditor instanceof SpecificationEditor) {
this.editor = (SpecificationEditor)targetEditor;
this.spec = ((SpecificationEditor)targetEditor).getSpecification();
@@ -166,18 +162,24 @@
return null;
}
- /**
- * FIXME not working yet.
- */
private SpecHierarchy oneUp(SpecHierarchy sh) {
EObject element = sh;
while (element instanceof SpecHierarchy) {
EObject container = element.eContainer();
int pos = container.eContents().indexOf(element);
if (pos > 0) {
- return (SpecHierarchy) container.eContents().get(pos - 1);
+ sh = (SpecHierarchy) container.eContents().get(pos - 1);
+ while (sh.getChildren().size() > 0) {
+ sh = sh.getChildren().get(sh.getChildren().size() - 1);
+ }
+ return sh;
} else {
- element = container;
+ // Go one up, then as deep as possible
+ if (container instanceof SpecHierarchy) {
+ return (SpecHierarchy) container;
+ } else {
+ return null;
+ }
}
}
return null;