diff options
author | Matthieu Helleboid | 2015-12-23 08:58:36 +0000 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org | 2015-12-23 08:58:36 +0000 |
commit | a2a35216f4b45a03106146aa01dace228c9360ae (patch) | |
tree | f8dcc7a30c39ae4c409a89094390497d3f1fa8d2 | |
parent | e7cb7df3fbb0d1fda81fd1a336684ed1aaed655b (diff) | |
parent | 6221ea3aeabe2e96a28d4896d81fa3a504e58002 (diff) | |
download | org.eclipse.amalgam-a2a35216f4b45a03106146aa01dace228c9360ae.tar.gz org.eclipse.amalgam-a2a35216f4b45a03106146aa01dace228c9360ae.tar.xz org.eclipse.amalgam-a2a35216f4b45a03106146aa01dace228c9360ae.zip |
Merge "[484383] Activity Explorer is opened when session is closed"
-rw-r--r-- | plugins/org.eclipse.amalgam.explorer.activity.ui/src/org/eclipse/amalgam/explorer/activity/ui/internal/session/listeners/ActivityExplorerSessionListener.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/plugins/org.eclipse.amalgam.explorer.activity.ui/src/org/eclipse/amalgam/explorer/activity/ui/internal/session/listeners/ActivityExplorerSessionListener.java b/plugins/org.eclipse.amalgam.explorer.activity.ui/src/org/eclipse/amalgam/explorer/activity/ui/internal/session/listeners/ActivityExplorerSessionListener.java index 362ef0e7..b81b3e8a 100644 --- a/plugins/org.eclipse.amalgam.explorer.activity.ui/src/org/eclipse/amalgam/explorer/activity/ui/internal/session/listeners/ActivityExplorerSessionListener.java +++ b/plugins/org.eclipse.amalgam.explorer.activity.ui/src/org/eclipse/amalgam/explorer/activity/ui/internal/session/listeners/ActivityExplorerSessionListener.java @@ -96,7 +96,7 @@ public class ActivityExplorerSessionListener implements SessionManagerListener { public void run() { Session currentSession = session2.get(); - if (currentSession != null) { + if ((currentSession != null) && currentSession.isOpen()) { ActivityExplorerEditor editor = ActivityExplorerManager.INSTANCE.getEditorFromSession(currentSession); if (editor == null) { return; @@ -120,18 +120,17 @@ public class ActivityExplorerSessionListener implements SessionManagerListener { protected void notifyOpenedSession(final WeakReference<Session> session2) { if ((session2.get() != null) && !(session2.get().getSemanticResources().isEmpty())) { Runnable runnable = new Runnable() { - @SuppressWarnings("synthetic-access") public void run() { try { final boolean open = ActivityExplorerActivator.getDefault().getPreferenceStore() .getBoolean(PreferenceConstants.P_OPEN_ACTIVITY_EXPLORER); - if (open) { - + Session currentSession = session2.get(); + if (open && (currentSession != null) && currentSession.isOpen()) { IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); if (activePage != null) { - ActivityExplorerEditorInput input = new ActivityExplorerEditorInput(session2.get(), + ActivityExplorerEditorInput input = new ActivityExplorerEditorInput(currentSession, org.eclipse.amalgam.explorer.activity.ui.api.editor.pages.helper.SessionHelper - .getRootSemanticModel(session2.get())); + .getRootSemanticModel(currentSession)); IEditorPart part = activePage.findEditor(input); if (part == null) { @@ -160,7 +159,7 @@ public class ActivityExplorerSessionListener implements SessionManagerListener { public void run() { Session currentSession = session2.get(); - if (currentSession != null) { + if ((currentSession != null) && currentSession.isOpen()) { final ActivityExplorerEditor editor = ActivityExplorerManager.INSTANCE.getEditorFromSession(currentSession); if (editor != null) { // Handle fpages to mark them as dirty. |