debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/status/ConnectionStatusReconciler.java
branchRCL_2_4
changeset 973 bd54fb1ea34a
parent 965 7942782aa571
equal deleted inserted replaced
968:bff887fe7694 973:bd54fb1ea34a
   128 		}
   128 		}
   129 		showConnectionsView();
   129 		showConnectionsView();
   130 	}
   130 	}
   131 
   131 
   132 	private void showConnectionsView() {
   132 	private void showConnectionsView() {
   133 		// avoid deadlock if this called as a result of a launch sequence issuing a "select connection" dialog
   133 		// avoid deadlock with RunRunnableWhenWorkbenchVisibleJob 
   134 		Shell shell = WorkbenchUtils.getActiveShell();
   134 		// if this called as a result of a launch sequence issuing a "select connection" dialog
   135 		if (shell == null || !shell.isVisible()) {
   135 		final Shell shell = WorkbenchUtils.getActiveShell();
   136 			RunRunnableWhenWorkbenchVisibleJob.start(new Runnable() {
   136 		final boolean isVisible[] = { false };
       
   137 		
       
   138 		if (shell != null) {
       
   139 			Display.getDefault().syncExec(new Runnable() {
   137 				public void run() {
   140 				public void run() {
   138 					// try to show the connections view to start service testers
   141 					isVisible[0] = shell.isVisible();
   139 					try {
       
   140 						WorkbenchUtils.getView(CONNECTIONS_VIEW_ID);
       
   141 					} catch (PartInitException e) {
       
   142 					}
       
   143 				}
   142 				}
   144 			});
   143 			});
       
   144 		}
       
   145 		
       
   146 		Runnable runnable = new Runnable() {
       
   147 			public void run() {
       
   148 				try {
       
   149 					WorkbenchUtils.getView(CONNECTIONS_VIEW_ID);
       
   150 				} catch (PartInitException e) {
       
   151 				}
       
   152 			}
       
   153 		};
       
   154 		
       
   155 		if (!isVisible[0]) {
       
   156 			RunRunnableWhenWorkbenchVisibleJob.start(runnable);
   145 		} else {
   157 		} else {
   146 			Display.getDefault().asyncExec(new Runnable() {
   158 			Display.getDefault().asyncExec(runnable);
   147 				public void run() {
       
   148 					try {
       
   149 						WorkbenchUtils.getView(CONNECTIONS_VIEW_ID);
       
   150 					} catch (PartInitException e) {
       
   151 					}
       
   152 				}
       
   153 			});
       
   154 		}
   159 		}
   155 	}
   160 	}
   156 	
   161 	
   157 	private void reconcileAsCurrent(IConnection connection) {
   162 	private void reconcileAsCurrent(IConnection connection) {
   158 		if (canBeSetToCurrent(connection)) {
   163 		if (canBeSetToCurrent(connection)) {