mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-21 21:52:10 +02:00
Bug 533399 - Workaround RemoteResourceBrowser layout issue
Ensure that the remote connection has been opened before showing RemoteResourceBrowser dialog so that the dialog's layout would not depend on the state of the connection. Change-Id: Iec70c243b75723de418e55a1f07cd8e9804400b6 Signed-off-by: Chin Huat Ang <chin.huat.ang@intel.com>
This commit is contained in:
parent
ac2363cb92
commit
75e8ed9fc5
1 changed files with 16 additions and 0 deletions
|
@ -43,9 +43,11 @@ import org.eclipse.debug.core.ILaunchConfiguration;
|
|||
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
|
||||
import org.eclipse.jface.window.Window;
|
||||
import org.eclipse.remote.core.IRemoteConnection;
|
||||
import org.eclipse.remote.core.IRemoteServicesManager;
|
||||
import org.eclipse.remote.ui.IRemoteUIConnectionService;
|
||||
import org.eclipse.remote.ui.dialogs.RemoteResourceBrowser;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
|
@ -344,6 +346,20 @@ public class RemoteCDSFMainTab extends CMainTab {
|
|||
|
||||
protected void handleRemoteBrowseSelected() {
|
||||
IRemoteConnection currentConnectionSelected = getCurrentConnection();
|
||||
|
||||
// Try to open the connection before showing RemoteResourceBrowser
|
||||
if (currentConnectionSelected != null && !currentConnectionSelected.isOpen()) {
|
||||
if (currentConnectionSelected.getConnectionType().hasService(IRemoteUIConnectionService.class)) {
|
||||
|
||||
IRemoteUIConnectionService uiConnService = currentConnectionSelected.getConnectionType().getService(IRemoteUIConnectionService.class);
|
||||
uiConnService.openConnectionWithProgress(getShell(), new ProgressMonitorDialog(getShell()), currentConnectionSelected);
|
||||
|
||||
// Don't show RemoteResourceBrowser if the connection cannot be opened
|
||||
if (!currentConnectionSelected.isOpen())
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
RemoteResourceBrowser b = new RemoteResourceBrowser(getControl().getShell(),
|
||||
SWT.NONE);
|
||||
b.setConnection(currentConnectionSelected);
|
||||
|
|
Loading…
Add table
Reference in a new issue