1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 23:25:26 +02:00

[182202] changed to use SystemRemoteFolderDialog.

This commit is contained in:
David McKnight 2007-05-15 13:34:18 +00:00
parent d6403e0b19
commit 7af7baa21c
3 changed files with 55 additions and 19 deletions

View file

@ -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();

View file

@ -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);

View file

@ -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;
}
*/
}