mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-09 18:15:23 +02:00
[182202] changed to use SystemRemoteFolderDialog.
This commit is contained in:
parent
d6403e0b19
commit
7af7baa21c
3 changed files with 55 additions and 19 deletions
|
@ -370,6 +370,38 @@ public class SystemSearchPage extends DialogPage implements ISearchPage {
|
||||||
selectFolderAction.setNeedsProgressMonitor(true);
|
selectFolderAction.setNeedsProgressMonitor(true);
|
||||||
selectFolderAction.setMultipleSelectionMode(false);
|
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
|
// run the action
|
||||||
selectFolderAction.run();
|
selectFolderAction.run();
|
||||||
|
|
||||||
|
|
|
@ -410,11 +410,11 @@ public class SystemSearchRemoteFolderAction extends SystemSelectRemoteFolderActi
|
||||||
dlg = new SystemSearchRemoteFolderDialog(shell);
|
dlg = new SystemSearchRemoteFolderDialog(shell);
|
||||||
else
|
else
|
||||||
dlg = new SystemSearchRemoteFolderDialog(shell, dlgTitle);
|
dlg = new SystemSearchRemoteFolderDialog(shell, dlgTitle);
|
||||||
dlg.setShowNewConnectionPrompt(showNewConnectionPrompt);
|
//dlg.setShowNewConnectionPrompt(showNewConnectionPrompt);
|
||||||
dlg.setMultipleSelectionMode(multipleSelectionMode);
|
dlg.setMultipleSelectionMode(multipleSelectionMode);
|
||||||
dlg.setAllowForMultipleParents(allowForMultipleParents);
|
//dlg.setAllowForMultipleParents(allowForMultipleParents);
|
||||||
if (restrictFolders)
|
// if (restrictFolders)
|
||||||
dlg.setRestrictFolders(true);
|
// dlg.setRestrictFolders(true);
|
||||||
if (message != null)
|
if (message != null)
|
||||||
dlg.setMessage(message);
|
dlg.setMessage(message);
|
||||||
if (treeTip != null)
|
if (treeTip != null)
|
||||||
|
@ -422,28 +422,30 @@ public class SystemSearchRemoteFolderAction extends SystemSelectRemoteFolderActi
|
||||||
if (systemConnection != null)
|
if (systemConnection != null)
|
||||||
{
|
{
|
||||||
if (onlyConnection)
|
if (onlyConnection)
|
||||||
dlg.setSystemConnection(systemConnection);
|
dlg.setDefaultSystemConnection(systemConnection, true);
|
||||||
else
|
else
|
||||||
dlg.setDefaultConnection(systemConnection);
|
dlg.setDefaultSystemConnection(systemConnection, false);
|
||||||
}
|
}
|
||||||
if (systemTypes != null)
|
if (systemTypes != null)
|
||||||
dlg.setSystemTypes(systemTypes);
|
dlg.setSystemTypes(systemTypes);
|
||||||
if (expandDepth != 0)
|
//if (expandDepth != 0)
|
||||||
dlg.setAutoExpandDepth(expandDepth);
|
// dlg.setAutoExpandDepth(expandDepth);
|
||||||
if (preSelection != null)
|
if (preSelection != null)
|
||||||
dlg.setPreSelection(preSelection);
|
dlg.setPreSelection(preSelection);
|
||||||
else if (rootFolderConnection != null)
|
//else if (rootFolderConnection != null)
|
||||||
dlg.setRootFolder(rootFolderConnection, rootFolderAbsPath);
|
// dlg.setRootFolder(rootFolderConnection, rootFolderAbsPath);
|
||||||
if (showPropertySheet)
|
if (showPropertySheet)
|
||||||
if (showPropertySheetDetailsButton)
|
if (showPropertySheetDetailsButton)
|
||||||
dlg.setShowPropertySheet(true, showPropertySheetDetailsButtonInitialState);
|
dlg.setShowPropertySheet(true, showPropertySheetDetailsButtonInitialState);
|
||||||
else
|
else
|
||||||
dlg.setShowPropertySheet(true);
|
dlg.setShowPropertySheet(true);
|
||||||
if (addButtonCallback != null)
|
if (addButtonCallback != null)
|
||||||
if ((addLabel!=null) || (addToolTipText!=null))
|
{
|
||||||
dlg.enableAddMode(addButtonCallback, addLabel, addToolTipText);
|
// if ((addLabel!=null) || (addToolTipText!=null))
|
||||||
else
|
// dlg.enableAddMode(addButtonCallback, addLabel, addToolTipText);
|
||||||
dlg.enableAddMode(addButtonCallback);
|
// else
|
||||||
|
// dlg.enableAddMode(addButtonCallback);
|
||||||
|
}
|
||||||
if (selectionValidator != null)
|
if (selectionValidator != null)
|
||||||
dlg.setSelectionValidator(selectionValidator);
|
dlg.setSelectionValidator(selectionValidator);
|
||||||
|
|
||||||
|
|
|
@ -9,21 +9,20 @@
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
package org.eclipse.rse.internal.files.ui.search;
|
package org.eclipse.rse.internal.files.ui.search;
|
||||||
|
|
||||||
import org.eclipse.rse.files.ui.dialogs.SystemSelectRemoteFileOrFolderDialog;
|
import org.eclipse.rse.files.ui.dialogs.SystemRemoteFolderDialog;
|
||||||
import org.eclipse.rse.files.ui.widgets.SystemSelectRemoteFileOrFolderForm;
|
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Select dialog for search.
|
* Select dialog for search.
|
||||||
*/
|
*/
|
||||||
public class SystemSearchRemoteFolderDialog extends SystemSelectRemoteFileOrFolderDialog {
|
public class SystemSearchRemoteFolderDialog extends SystemRemoteFolderDialog {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
* @param shell the parent shell.
|
* @param shell the parent shell.
|
||||||
*/
|
*/
|
||||||
public SystemSearchRemoteFolderDialog(Shell 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.
|
* @param title the the title of the dialog.
|
||||||
*/
|
*/
|
||||||
public SystemSearchRemoteFolderDialog(Shell shell, String title) {
|
public SystemSearchRemoteFolderDialog(Shell shell, String title) {
|
||||||
super(shell, title, false);
|
super(shell, title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an instance of the select form for search {@link SystemSearchRemoteFolderForm}
|
* Creates an instance of the select form for search {@link SystemSearchRemoteFolderForm}
|
||||||
* @see org.eclipse.rse.files.ui.dialogs.SystemSelectRemoteFileOrFolderDialog#getForm(boolean)
|
* @see org.eclipse.rse.files.ui.dialogs.SystemSelectRemoteFileOrFolderDialog#getForm(boolean)
|
||||||
*/
|
*/
|
||||||
|
/*
|
||||||
protected SystemSelectRemoteFileOrFolderForm getForm(boolean fileMode) {
|
protected SystemSelectRemoteFileOrFolderForm getForm(boolean fileMode) {
|
||||||
form = new SystemSearchRemoteFolderForm(getMessageLine(), this);
|
form = new SystemSearchRemoteFolderForm(getMessageLine(), this);
|
||||||
setOutputObject(null);
|
setOutputObject(null);
|
||||||
outputConnection = null;
|
outputConnection = null;
|
||||||
return form;
|
return form;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue