Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthieu Helleboid2015-12-23 08:58:36 +0000
committerGerrit Code Review @ Eclipse.org2015-12-23 08:58:36 +0000
commita2a35216f4b45a03106146aa01dace228c9360ae (patch)
treef8dcc7a30c39ae4c409a89094390497d3f1fa8d2
parente7cb7df3fbb0d1fda81fd1a336684ed1aaed655b (diff)
parent6221ea3aeabe2e96a28d4896d81fa3a504e58002 (diff)
downloadorg.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.java13
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.

Back to the top