Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Jastram2014-11-18 13:07:01 +0000
committerMichael Jastram2014-11-18 13:10:19 +0000
commit232242623ff4a12ad7630320da7517938c8b8142 (patch)
tree5d360ecce5db1fcc6e7d752efe0fb87b72167d5e
parentd31d17a026bf40ee0badfe3d2d747df365c52d30 (diff)
downloadorg.eclipse.rmf-232242623ff4a12ad7630320da7517938c8b8142.tar.gz
org.eclipse.rmf-232242623ff4a12ad7630320da7517938c8b8142.tar.xz
org.eclipse.rmf-232242623ff4a12ad7630320da7517938c8b8142.zip
If there is only one Specification, then open it.
-rw-r--r--org.eclipse.rmf.reqif10.pror.editor/src/org/eclipse/rmf/reqif10/pror/editor/presentation/Reqif10Editor.java34
1 files changed, 23 insertions, 11 deletions
diff --git a/org.eclipse.rmf.reqif10.pror.editor/src/org/eclipse/rmf/reqif10/pror/editor/presentation/Reqif10Editor.java b/org.eclipse.rmf.reqif10.pror.editor/src/org/eclipse/rmf/reqif10/pror/editor/presentation/Reqif10Editor.java
index 76cdfa65..9017516e 100644
--- a/org.eclipse.rmf.reqif10.pror.editor/src/org/eclipse/rmf/reqif10/pror/editor/presentation/Reqif10Editor.java
+++ b/org.eclipse.rmf.reqif10.pror.editor/src/org/eclipse/rmf/reqif10/pror/editor/presentation/Reqif10Editor.java
@@ -1097,8 +1097,14 @@ public class Reqif10Editor extends MultiPageEditorPart implements
getSite().getShell().getDisplay().asyncExec(new Runnable() {
public void run() {
updateProblemIndication();
+ // if the model has exactly one Specification, then open it.
+ if (reqif.getCoreContent().getSpecifications().size() == 1) {
+ openSpecification(reqif.getCoreContent().getSpecifications().get(0));
+ }
}
});
+
+
}
/**
@@ -1162,6 +1168,7 @@ public class Reqif10Editor extends MultiPageEditorPart implements
getEditingDomain());
ConfigurationUtil.setDefaultLabelsIfNecessary(adapterFactory,
editingDomain, reqif);
+
return reqif;
}
@@ -1331,21 +1338,12 @@ public class Reqif10Editor extends MultiPageEditorPart implements
.getSelection())
.getFirstElement();
if (obj instanceof Specification) {
- ReqifSpecificationEditorInput editorInput = new ReqifSpecificationEditorInput(
- Reqif10Editor.this,
- (Specification) obj);
- try {
- IDE.openEditor(
- getSite().getPage(),
- editorInput,
- SpecificationEditor.EDITOR_ID);
- } catch (PartInitException e) {
- e.printStackTrace();
- }
+ openSpecification((Specification)obj);
}
}
}
+
});
}
@@ -1382,6 +1380,20 @@ public class Reqif10Editor extends MultiPageEditorPart implements
return contentOutlinePage;
}
+ /**
+ * Tries to open the given Specification.
+ */
+ private void openSpecification(Specification spec) {
+ ReqifSpecificationEditorInput editorInput = new ReqifSpecificationEditorInput(
+ Reqif10Editor.this, (Specification) spec);
+ try {
+ IDE.openEditor(getSite().getPage(), editorInput,
+ SpecificationEditor.EDITOR_ID, true);
+ } catch (PartInitException e) {
+ e.printStackTrace();
+ }
+ }
+
/**
* This accesses a cached version of the property sheet. <!-- begin-user-doc
* --> Changed return type from {@link IPropertySheetPage} to

Back to the top