Permalink
Browse files

[371060] [hotbug] "Create a new local server" checkbox disappears

  • Loading branch information...
1 parent f99e7c0 commit c985fd8bf7310c4411529e6639f590828231cf0e eyuen committed Feb 10, 2012
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2011 IBM Corporation and others.
+ * Copyright (c) 2003, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,13 +11,15 @@
package org.eclipse.wst.server.ui.internal.viewers;
import org.eclipse.jface.viewers.*;
+import org.eclipse.swt.SWTException;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.wst.server.core.IRuntimeType;
import org.eclipse.wst.server.discovery.Discovery;
import org.eclipse.wst.server.ui.internal.Messages;
import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
+import org.eclipse.wst.server.ui.internal.Trace;
/**
*
*/
@@ -85,8 +87,17 @@ public void setVisible(boolean visible) {
super.setVisible(visible);
if (visible && initialSelection) {
initialSelection = false;
- if (contentProvider.getInitialSelection() != null)
- treeViewer.setSelection(new StructuredSelection(contentProvider.getInitialSelection()), true);
+ if (contentProvider.getInitialSelection() != null) {
+ try {
+ getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ treeViewer.setSelection(new StructuredSelection(contentProvider.getInitialSelection()), true);
+ }
+ });
+ } catch (SWTException e) {
+ Trace.trace(Trace.STRING_INFO, "Failed to set the default selection on the runtime type tree.", e);
+ }
+ }
}
}

0 comments on commit c985fd8

Please sign in to comment.