diff --git a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/service/project/internal/ProjectServiceImpl.java b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/service/project/internal/ProjectServiceImpl.java index 031a866aac..db13d1ff9e 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/service/project/internal/ProjectServiceImpl.java +++ b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/service/project/internal/ProjectServiceImpl.java @@ -651,8 +651,9 @@ public void run() { } String projectName = getProjectInfo().getName(); - String title = appTitle + " - " + ((projectName == null || projectName.isEmpty()) - ? "Unnamed" : projectName); + String title = appTitle + " - " + + ((projectName == null || projectName.isEmpty()) ? "Unnamed" + : projectName); if (projectFile == null) { // TODO Use scheme to discover plugin that can provide title // information @@ -884,8 +885,8 @@ public void run() { @Override public void update() { - // no change check as this is done by clean before a new project is - // loaded + // check if there are changes, as you are about to load the same project + changeCheck(); URI currentLocation = null; synchronized (this) { @@ -929,7 +930,11 @@ private boolean changeCheck() { @Override public void run() { - MessageBox mb = new MessageBox(display.getActiveShell(), + Shell shell = display.getActiveShell(); + if (shell == null) { + shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); + } + MessageBox mb = new MessageBox(shell, SWT.YES | SWT.NO | SWT.CANCEL | SWT.ICON_QUESTION); mb.setMessage("Save changes to the current project?"); //$NON-NLS-1$ mb.setText("Unsaved changes"); //$NON-NLS-1$