diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/search/SystemSearchPage.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/search/SystemSearchPage.java index 8b0985efc02..8ec70ea33ef 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/search/SystemSearchPage.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/search/SystemSearchPage.java @@ -370,6 +370,38 @@ public class SystemSearchPage extends DialogPage implements ISearchPage { selectFolderAction.setNeedsProgressMonitor(true); selectFolderAction.setMultipleSelectionMode(false); + // preselection + if (nameCombo.getText().length() > 0) + { + String preconnectionname = getConnectionName(); + if (preconnectionname != null && preconnectionname.length() > 0) + { + ISystemProfile profile = RSECorePlugin.getTheSystemRegistry().getSystemProfileManager().getDefaultPrivateSystemProfile(); + IHost prehost = RSECorePlugin.getTheSystemRegistry().getHost(profile, preconnectionname); + if (prehost != null) + { + // host preselection + selectFolderAction.setDefaultConnection(prehost); + + String prepath = getFolderPath(); + if (prepath != null && prepath.length() > 0) + { + IRemoteFileSubSystem ss = RemoteFileUtility.getFileSubSystem(prehost); + try + { + IRemoteFile selection = ss.getRemoteFileObject(prepath, new NullProgressMonitor()); + if (selection != null) + { + // path preselection + selectFolderAction.setPreSelection(selection); + } + } + catch (Exception e) + {} + } + } + } + } // run the action selectFolderAction.run(); diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/search/SystemSearchRemoteFolderAction.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/search/SystemSearchRemoteFolderAction.java index a87fbb5946c..e06e998ab08 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/search/SystemSearchRemoteFolderAction.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/search/SystemSearchRemoteFolderAction.java @@ -410,11 +410,11 @@ public class SystemSearchRemoteFolderAction extends SystemSelectRemoteFolderActi dlg = new SystemSearchRemoteFolderDialog(shell); else dlg = new SystemSearchRemoteFolderDialog(shell, dlgTitle); - dlg.setShowNewConnectionPrompt(showNewConnectionPrompt); + //dlg.setShowNewConnectionPrompt(showNewConnectionPrompt); dlg.setMultipleSelectionMode(multipleSelectionMode); - dlg.setAllowForMultipleParents(allowForMultipleParents); - if (restrictFolders) - dlg.setRestrictFolders(true); + //dlg.setAllowForMultipleParents(allowForMultipleParents); +// if (restrictFolders) + // dlg.setRestrictFolders(true); if (message != null) dlg.setMessage(message); if (treeTip != null) @@ -422,28 +422,30 @@ public class SystemSearchRemoteFolderAction extends SystemSelectRemoteFolderActi if (systemConnection != null) { if (onlyConnection) - dlg.setSystemConnection(systemConnection); + dlg.setDefaultSystemConnection(systemConnection, true); else - dlg.setDefaultConnection(systemConnection); + dlg.setDefaultSystemConnection(systemConnection, false); } if (systemTypes != null) dlg.setSystemTypes(systemTypes); - if (expandDepth != 0) - dlg.setAutoExpandDepth(expandDepth); + //if (expandDepth != 0) + // dlg.setAutoExpandDepth(expandDepth); if (preSelection != null) dlg.setPreSelection(preSelection); - else if (rootFolderConnection != null) - dlg.setRootFolder(rootFolderConnection, rootFolderAbsPath); + //else if (rootFolderConnection != null) + // dlg.setRootFolder(rootFolderConnection, rootFolderAbsPath); if (showPropertySheet) if (showPropertySheetDetailsButton) dlg.setShowPropertySheet(true, showPropertySheetDetailsButtonInitialState); else dlg.setShowPropertySheet(true); if (addButtonCallback != null) - if ((addLabel!=null) || (addToolTipText!=null)) - dlg.enableAddMode(addButtonCallback, addLabel, addToolTipText); - else - dlg.enableAddMode(addButtonCallback); + { + // if ((addLabel!=null) || (addToolTipText!=null)) + // dlg.enableAddMode(addButtonCallback, addLabel, addToolTipText); + // else + // dlg.enableAddMode(addButtonCallback); + } if (selectionValidator != null) dlg.setSelectionValidator(selectionValidator); diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/search/SystemSearchRemoteFolderDialog.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/search/SystemSearchRemoteFolderDialog.java index 939de9a9ac6..4c71f24481f 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/search/SystemSearchRemoteFolderDialog.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/search/SystemSearchRemoteFolderDialog.java @@ -9,21 +9,20 @@ ********************************************************************************/ package org.eclipse.rse.internal.files.ui.search; -import org.eclipse.rse.files.ui.dialogs.SystemSelectRemoteFileOrFolderDialog; -import org.eclipse.rse.files.ui.widgets.SystemSelectRemoteFileOrFolderForm; +import org.eclipse.rse.files.ui.dialogs.SystemRemoteFolderDialog; import org.eclipse.swt.widgets.Shell; /** * Select dialog for search. */ -public class SystemSearchRemoteFolderDialog extends SystemSelectRemoteFileOrFolderDialog { +public class SystemSearchRemoteFolderDialog extends SystemRemoteFolderDialog { /** * Constructor. * @param shell the parent shell. */ public SystemSearchRemoteFolderDialog(Shell shell) { - super(shell, false); + super(shell); } /** @@ -32,17 +31,20 @@ public class SystemSearchRemoteFolderDialog extends SystemSelectRemoteFileOrFold * @param title the the title of the dialog. */ public SystemSearchRemoteFolderDialog(Shell shell, String title) { - super(shell, title, false); + super(shell, title); } + /** * Creates an instance of the select form for search {@link SystemSearchRemoteFolderForm} * @see org.eclipse.rse.files.ui.dialogs.SystemSelectRemoteFileOrFolderDialog#getForm(boolean) */ + /* protected SystemSelectRemoteFileOrFolderForm getForm(boolean fileMode) { form = new SystemSearchRemoteFolderForm(getMessageLine(), this); setOutputObject(null); outputConnection = null; return form; } + */ } \ No newline at end of file