|
Lines 11-16
Link Here
|
| 11 |
package org.eclipse.ptp.internal.rdt.ui.scannerinfo; |
11 |
package org.eclipse.ptp.internal.rdt.ui.scannerinfo; |
| 12 |
|
12 |
|
| 13 |
|
13 |
|
|
|
14 |
import org.eclipse.ptp.remote.core.IRemoteConnection; |
| 15 |
import org.eclipse.ptp.remote.core.IRemoteServices; |
| 16 |
import org.eclipse.ptp.remote.ui.IRemoteUIFileManager; |
| 17 |
import org.eclipse.ptp.remote.ui.PTPRemoteUIPlugin; |
| 18 |
import org.eclipse.rse.core.model.IHost; |
| 14 |
import org.eclipse.rse.files.ui.dialogs.SystemRemoteFolderDialog; |
19 |
import org.eclipse.rse.files.ui.dialogs.SystemRemoteFolderDialog; |
| 15 |
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; |
20 |
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; |
| 16 |
import org.eclipse.swt.SWT; |
21 |
import org.eclipse.swt.SWT; |
|
Lines 67-72
Link Here
|
| 67 |
|
72 |
|
| 68 |
private final boolean isEdit; |
73 |
private final boolean isEdit; |
| 69 |
|
74 |
|
|
|
75 |
// TODO: should remove IHost and only use IRemoteServices |
| 76 |
// and IRemoteConnection |
| 77 |
|
| 78 |
// fHost used for RSE connections |
| 79 |
private IHost fHost = null; |
| 80 |
// fRemoteServices and fRemoteConnection used for others |
| 81 |
private IRemoteServices fRemoteServices = null; |
| 82 |
private IRemoteConnection fRemoteConnection = null; |
| 70 |
|
83 |
|
| 71 |
public RemoteIncludeDialog(Shell parent, String title, boolean isEdit) { |
84 |
public RemoteIncludeDialog(Shell parent, String title, boolean isEdit) { |
| 72 |
|
85 |
|
|
Lines 186-197
Link Here
|
| 186 |
shell.dispose(); |
199 |
shell.dispose(); |
| 187 |
} |
200 |
} |
| 188 |
else if(pressed.equals(b_browse)) { |
201 |
else if(pressed.equals(b_browse)) { |
| 189 |
SystemRemoteFolderDialog folderDialog = new SystemRemoteFolderDialog(shell, Messages.RemoteIncludeDialog_select); |
202 |
if (fHost != null) { |
| 190 |
folderDialog.open(); |
203 |
SystemRemoteFolderDialog folderDialog = new SystemRemoteFolderDialog(shell, Messages.RemoteIncludeDialog_select); |
| 191 |
Object remoteObject = folderDialog.getSelectedObject(); |
204 |
folderDialog.open(); |
| 192 |
if(remoteObject instanceof IRemoteFile) { |
205 |
Object remoteObject = folderDialog.getSelectedObject(); |
| 193 |
IRemoteFile folder = (IRemoteFile)remoteObject; |
206 |
if(remoteObject instanceof IRemoteFile) { |
| 194 |
text.setText(folder.getCanonicalPath()); |
207 |
IRemoteFile folder = (IRemoteFile)remoteObject; |
|
|
208 |
text.setText(folder.getCanonicalPath()); |
| 209 |
} |
| 210 |
} else { |
| 211 |
if (!fRemoteConnection.isOpen()) { |
| 212 |
PTPRemoteUIPlugin.getDefault().openConnectionWithProgress(shell, fRemoteConnection); |
| 213 |
} |
| 214 |
if (fRemoteConnection.isOpen()) { |
| 215 |
IRemoteUIFileManager fileMgr = getUIFileManager(); |
| 216 |
if (fileMgr != null) { |
| 217 |
fileMgr.setConnection(fRemoteConnection); |
| 218 |
String path = fileMgr.browseDirectory(shell, Messages.RemoteIncludeDialog_select, "", 0); //$NON-NLS-1$ |
| 219 |
if (path != null) { |
| 220 |
text.setText(path); |
| 221 |
} |
| 222 |
} |
| 223 |
} |
| 195 |
} |
224 |
} |
| 196 |
} |
225 |
} |
| 197 |
} |
226 |
} |
|
Lines 212-215
Link Here
|
| 212 |
return isAllConfigurations; |
241 |
return isAllConfigurations; |
| 213 |
} |
242 |
} |
| 214 |
|
243 |
|
|
|
244 |
public void setHost(IHost host) { |
| 245 |
fHost = host; |
| 246 |
} |
| 247 |
|
| 248 |
public void setConnection(IRemoteServices services, IRemoteConnection connection) { |
| 249 |
fRemoteServices = services; |
| 250 |
fRemoteConnection = connection; |
| 251 |
} |
| 252 |
|
| 253 |
private IRemoteUIFileManager getUIFileManager() { |
| 254 |
if (fRemoteServices != null) { |
| 255 |
return PTPRemoteUIPlugin.getDefault().getRemoteUIServices(fRemoteServices).getUIFileManager(); |
| 256 |
} |
| 257 |
return null; |
| 258 |
} |
| 215 |
} |
259 |
} |