Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbblajer2006-11-23 18:57:12 +0000
committerbblajer2006-11-23 18:57:12 +0000
commit5823d9bdc90f7e20da703e6166bbd2278dd7882f (patch)
treee420e8a696fa17269e02f9cc2165aacceb24ab4f /plugins/org.eclipse.gmf.runtime.lite/src/org
parent2e019ddfed65030d2612e4c9a112c245743b4377 (diff)
downloadorg.eclipse.gmf-tooling-5823d9bdc90f7e20da703e6166bbd2278dd7882f.tar.gz
org.eclipse.gmf-tooling-5823d9bdc90f7e20da703e6166bbd2278dd7882f.tar.xz
org.eclipse.gmf-tooling-5823d9bdc90f7e20da703e6166bbd2278dd7882f.zip
[163214]: Lite runtime should support generation to a View
[164843]: Make it possible to specify the editing domain with which the editor/viewer should operate
Diffstat (limited to 'plugins/org.eclipse.gmf.runtime.lite/src/org')
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/parts/DiagramViewPart.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/parts/DiagramViewPart.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/parts/DiagramViewPart.java
index b2cd45f14..0ddfb2093 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/parts/DiagramViewPart.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/parts/DiagramViewPart.java
@@ -97,16 +97,19 @@ public abstract class DiagramViewPart extends ViewPart implements IDiagramManage
return editingDomain;
}
+ protected abstract void createActions();
+
/**
* Shows the given diagram in the viewer.
* @param editingDomain the editing domain that should be used for loading the diagram or <code>null</code> if the viewer should create {@link #createEditingDomain() a default instance}.
* @param diagramURI the URI to load the diagram from.
*/
- public final void showDiagram(TransactionalEditingDomain editingDomain, URI diagramURI) {
+ public final boolean showDiagram(TransactionalEditingDomain editingDomain, URI diagramURI) {
DiagramDisplayer oldDiagramDisplayer = myDiagramDisplayer;
+ boolean result = false;
if (diagramURI == null) {
if (oldDiagramDisplayer == null) {
- return;
+ return true;
}
myBook.showPage(myUninitializedControl);
} else {
@@ -114,16 +117,19 @@ public abstract class DiagramViewPart extends ViewPart implements IDiagramManage
editingDomain = createEditingDomain();
}
myDiagramDisplayer = new DiagramDisplayer(this, createEditDomain(), editingDomain);
- myDiagramDisplayer.createViewer(myBook);
try {
setInput(diagramURI);
+ myDiagramDisplayer.createViewer(myBook);
+ createActions();
myBook.showPage(myDiagramDisplayer.getTopLevelControl());
+ result = true;
} catch (CoreException e) {
Activator.getDefault().getLog().log(e.getStatus());
ErrorDialog.openError(getSite().getShell(), "Error", "Failed to open diagram", e.getStatus());
if (myDiagramDisplayer.getTopLevelControl() != null && !myDiagramDisplayer.getTopLevelControl().isDisposed()) {
myDiagramDisplayer.getTopLevelControl().dispose();
myDiagramDisplayer.dispose();
+ myDiagramDisplayer = oldDiagramDisplayer;
//prevent navigation from the old diagram.
oldDiagramDisplayer = null;
}
@@ -133,8 +139,12 @@ public abstract class DiagramViewPart extends ViewPart implements IDiagramManage
oldDiagramDisplayer.getTopLevelControl().dispose();
oldDiagramDisplayer.dispose();
}
+ updateActionBars();
+ return result;
}
+ protected abstract void updateActionBars();
+
public void configureGraphicalViewer() {
getGraphicalViewer().getControl().setBackground(ColorConstants.listBackground);
}

Back to the top