debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/status/ConnectionStatusReconciler.java
equal
deleted
inserted
replaced
18 package com.nokia.carbide.trk.support.status; |
18 package com.nokia.carbide.trk.support.status; |
19 |
19 |
20 import java.util.ArrayList; |
20 import java.util.ArrayList; |
21 import java.util.List; |
21 import java.util.List; |
22 |
22 |
|
23 import org.eclipse.swt.widgets.Display; |
|
24 import org.eclipse.swt.widgets.Shell; |
23 import org.eclipse.ui.PartInitException; |
25 import org.eclipse.ui.PartInitException; |
24 |
26 |
25 import com.nokia.carbide.remoteconnections.RemoteConnectionsActivator; |
27 import com.nokia.carbide.remoteconnections.RemoteConnectionsActivator; |
26 import com.nokia.carbide.remoteconnections.interfaces.IConnectedService; |
28 import com.nokia.carbide.remoteconnections.interfaces.IConnectedService; |
27 import com.nokia.carbide.remoteconnections.interfaces.IConnection; |
29 import com.nokia.carbide.remoteconnections.interfaces.IConnection; |
126 } |
128 } |
127 showConnectionsView(); |
129 showConnectionsView(); |
128 } |
130 } |
129 |
131 |
130 private void showConnectionsView() { |
132 private void showConnectionsView() { |
131 RunRunnableWhenWorkbenchVisibleJob.start(new Runnable() { |
133 // avoid deadlock if this called as a result of a launch sequence issuing a "select connection" dialog |
132 public void run() { |
134 Shell shell = WorkbenchUtils.getActiveShell(); |
133 // try to show the connections view to start service testers |
135 if (shell == null || !shell.isVisible()) { |
134 try { |
136 RunRunnableWhenWorkbenchVisibleJob.start(new Runnable() { |
135 WorkbenchUtils.getView(CONNECTIONS_VIEW_ID); |
137 public void run() { |
136 } catch (PartInitException e) { |
138 // try to show the connections view to start service testers |
|
139 try { |
|
140 WorkbenchUtils.getView(CONNECTIONS_VIEW_ID); |
|
141 } catch (PartInitException e) { |
|
142 } |
137 } |
143 } |
138 } |
144 }); |
139 }); |
145 } else { |
|
146 Display.getDefault().asyncExec(new Runnable() { |
|
147 public void run() { |
|
148 try { |
|
149 WorkbenchUtils.getView(CONNECTIONS_VIEW_ID); |
|
150 } catch (PartInitException e) { |
|
151 } |
|
152 } |
|
153 }); |
|
154 } |
140 } |
155 } |
141 |
156 |
142 private void reconcileAsCurrent(IConnection connection) { |
157 private void reconcileAsCurrent(IConnection connection) { |
143 if (canBeSetToCurrent(connection)) { |
158 if (canBeSetToCurrent(connection)) { |
144 if (isReady(connection)) { // set as current |
159 if (isReady(connection)) { // set as current |