Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Haug2015-05-17 19:18:19 +0000
committerJuergen Haug2015-05-17 19:18:19 +0000
commitd8a96ed7e05faed32b3c1c76b23b22d06f4c3fd5 (patch)
tree94d6b1f230efa627c138f9de958e99cadcad7aab /plugins/org.eclipse.etrice.ui.common.base
parentc43822b7a67b3691d77fc4cb49cf2f2d3832e11e (diff)
downloadorg.eclipse.etrice-d8a96ed7e05faed32b3c1c76b23b22d06f4c3fd5.tar.gz
org.eclipse.etrice-d8a96ed7e05faed32b3c1c76b23b22d06f4c3fd5.tar.xz
org.eclipse.etrice-d8a96ed7e05faed32b3c1c76b23b22d06f4c3fd5.zip
Bug 467379 [ui] fixed npe of progress monitor during diagram save
Diffstat (limited to 'plugins/org.eclipse.etrice.ui.common.base')
-rw-r--r--plugins/org.eclipse.etrice.ui.common.base/src/org/eclipse/etrice/ui/common/base/editor/DiagramEditorBase.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/org.eclipse.etrice.ui.common.base/src/org/eclipse/etrice/ui/common/base/editor/DiagramEditorBase.java b/plugins/org.eclipse.etrice.ui.common.base/src/org/eclipse/etrice/ui/common/base/editor/DiagramEditorBase.java
index 364b388f9..c820d0b92 100644
--- a/plugins/org.eclipse.etrice.ui.common.base/src/org/eclipse/etrice/ui/common/base/editor/DiagramEditorBase.java
+++ b/plugins/org.eclipse.etrice.ui.common.base/src/org/eclipse/etrice/ui/common/base/editor/DiagramEditorBase.java
@@ -117,10 +117,14 @@ public abstract class DiagramEditorBase extends DiagramEditor implements IInputU
}
@Override
- public void doSave(final IProgressMonitor monitor) {
+ public void doSave(IProgressMonitor monitor) {
+ if(monitor == null)
+ monitor = new NullProgressMonitor();
+
boolean isValid = validateResourcesBeforeSave(monitor);
if(isValid)
super.doSave(monitor);
+
// deactivate saveOnFocus for better usability
// avoid retrigger loop from message box
saveOnFocusListener.setActive(isValid);
@@ -185,6 +189,8 @@ public abstract class DiagramEditorBase extends DiagramEditor implements IInputU
List<Issue> result = resourceValidator.validate(res, CheckMode.NORMAL_AND_FAST, new CancelIndicator() {
public boolean isCanceled() {
+ if(monitor == null)
+ return false;
return monitor.isCanceled();
}
});
@@ -229,7 +235,7 @@ public abstract class DiagramEditorBase extends DiagramEditor implements IInputU
superClassChanged();
if (!dirtyAlready && isDirty())
- doSave(null);
+ doSave(new NullProgressMonitor());
Diagram diagram = getDiagramTypeProvider().getDiagram();
EObject diagramBo = diagram.getLink().getBusinessObjects().iterator().next();

Back to the top