Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPauline DEVILLE2021-04-14 10:29:37 +0000
committervincent lorenzo2021-04-14 14:22:18 +0000
commit1f2269d8cd54aee92231d05fac6cd20e43b0da03 (patch)
tree6495a2535a5f2beafce4632a5c597df823c6e7ad
parent928b62fe6c92938912ed74e215195e3e62bfae25 (diff)
downloadorg.eclipse.papyrus-1f2269d8cd54aee92231d05fac6cd20e43b0da03.tar.gz
org.eclipse.papyrus-1f2269d8cd54aee92231d05fac6cd20e43b0da03.tar.xz
org.eclipse.papyrus-1f2269d8cd54aee92231d05fac6cd20e43b0da03.zip
Bug 571948 - [Core][Editor] When the editor is opening the tool should
display progress informations *Add catch block and throw back the exception *Make the pop-up closable Change-Id: I3b00325a2cc2799454694fb02a32e0180fc1834f Signed-off-by: Pauline DEVILLE <pauline.deville@cea.fr>
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/editor/CoreMultiDiagramEditor.java69
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/internal/services/status/ProgressDialog.java2
2 files changed, 44 insertions, 27 deletions
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/editor/CoreMultiDiagramEditor.java b/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/editor/CoreMultiDiagramEditor.java
index 2a1af34c852..b94f31b759c 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/editor/CoreMultiDiagramEditor.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/editor/CoreMultiDiagramEditor.java
@@ -495,43 +495,55 @@ public class CoreMultiDiagramEditor extends AbstractMultiPageSashEditor implemen
@Override
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
loadingStatusService.trigger(new BeginStatusEvent(Messages.CoreMultiDiagramEditor_StatisDialog_Title, Messages.CoreMultiDiagramEditor_StatisDialog_LoadingPapyrusMessage, 4));
- // Init super
- super.init(site, input);
-
- // Set editor name
- setPartName(input.getName());
+ try {
+ // Init super
+ super.init(site, input);
- initContents();
+ // Set editor name
+ setPartName(input.getName());
+ initContents();
+ } catch (Exception e) {
+ if (loadingStatusService != null) {
+ loadingStatusService.trigger(new EndStatusEvent());
+ }
+ throw e;
+ }
}
@Override
public void createPartControl(Composite parent) {
- loadingStatusService.trigger(new StepStatusEvent(Messages.CoreMultiDiagramEditor_StatisDialog_CreatePartControlMessage));
- super.createPartControl(parent);
+ try {
+ loadingStatusService.trigger(new StepStatusEvent(Messages.CoreMultiDiagramEditor_StatisDialog_CreatePartControlMessage));
+ super.createPartControl(parent);
- // Fire the PreDisplay event synchronously, so that listeners can continue
- // setting up the UI before the contents are actually rendered fully
- getLifecycleManager().firePreDisplay(this);
+ // Fire the PreDisplay event synchronously, so that listeners can continue
+ // setting up the UI before the contents are actually rendered fully
+ getLifecycleManager().firePreDisplay(this);
- // Fire the PostDisplay event asynchronously, to leave time to the Eclipse
- // framework to actually display the contents of the editor
- Display.getDefault().asyncExec(new Runnable() {
+ // Fire the PostDisplay event asynchronously, to leave time to the Eclipse
+ // framework to actually display the contents of the editor
+ Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- // Because we are asynchronous, the editor may already have been disposed
- // (Especially in the case of tests running in the UI Thread)
- try {
- if (servicesRegistry == null) {
- return;
+ @Override
+ public void run() {
+ // Because we are asynchronous, the editor may already have been disposed
+ // (Especially in the case of tests running in the UI Thread)
+ try {
+ if (servicesRegistry == null) {
+ return;
+ }
+ getLifecycleManager().firePostDisplay(CoreMultiDiagramEditor.this);
+ } finally {
+ loadingStatusService.trigger(new EndStatusEvent());
}
- getLifecycleManager().firePostDisplay(CoreMultiDiagramEditor.this);
- } finally {
- loadingStatusService.trigger(new EndStatusEvent());
}
+ });
+ } catch (Exception e) {
+ if (loadingStatusService != null) {
+ loadingStatusService.trigger(new EndStatusEvent());
}
- });
-
+ throw e;
+ }
}
protected void loadModelAndServices() throws PartInitException {
@@ -916,6 +928,11 @@ public class CoreMultiDiagramEditor extends AbstractMultiPageSashEditor implemen
@Override
protected void deactivate() {
+ // Make sure we close the progress dialog if it is deactivate because an exception has been catch (Bug 571948)
+ if (loadingStatusService != null) {
+ loadingStatusService.trigger(new EndStatusEvent());
+ }
+
getLifecycleManager().fireBeforeClose(this);
if (sashModelMngr != null) {
sashModelMngr.getSashModelContentChangedProvider().removeListener(contentChangedListener);
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/internal/services/status/ProgressDialog.java b/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/internal/services/status/ProgressDialog.java
index 6332186f237..9f7c8593d7f 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/internal/services/status/ProgressDialog.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/internal/services/status/ProgressDialog.java
@@ -51,7 +51,7 @@ public class ProgressDialog extends IconAndMessageDialog {
this.message = message;
this.title = title;
setShellStyle(getDefaultOrientation() | SWT.BORDER | SWT.TITLE
- | SWT.APPLICATION_MODAL);
+ | SWT.APPLICATION_MODAL | SWT.CLOSE);
setBlockOnOpen(false);
}

Back to the top