diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/actions/SystemSelectRemoteFileAction.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/actions/SystemSelectRemoteFileAction.java index 1c3bd6cb8a3..18cd95641ad 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/actions/SystemSelectRemoteFileAction.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/actions/SystemSelectRemoteFileAction.java @@ -13,21 +13,23 @@ * Contributors: * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Xuan Chen (IBM) - [220999] [api] Need to change class SystemSelectRemoteFileAction to use SystemRemoteFileDialog + * Xuan Chen (IBM) - [220999] [api] Also need to remove unnecessary APIs ********************************************************************************/ package org.eclipse.rse.files.ui.actions; import java.util.ArrayList; import java.util.List; +import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.viewers.ViewerFilter; import org.eclipse.rse.core.IRSESystemType; import org.eclipse.rse.core.model.IHost; -import org.eclipse.rse.files.ui.ISystemAddFileListener; import org.eclipse.rse.files.ui.dialogs.SystemRemoteFileDialog; import org.eclipse.rse.internal.files.ui.FileResources; -import org.eclipse.rse.subsystems.files.core.model.RemoteFileFilterString; +import org.eclipse.rse.subsystems.files.core.model.RemoteFileUtility; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; +import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem; import org.eclipse.rse.ui.SystemActionViewerFilter; import org.eclipse.rse.ui.actions.SystemBaseDialogAction; import org.eclipse.rse.ui.dialogs.SystemRemoteResourceDialog; @@ -44,10 +46,7 @@ import org.eclipse.swt.widgets.Shell; *
- * When a library is selected, the caller is called back to decide to enable the Add
- * button or not.
- */
- public void enableAddMode(ISystemAddFileListener caller)
- {
- this.addButtonCallback = caller;
- }
- /**
- * Overloaded method that allows setting the label and tooltip text of the Add button.
- * If you pass null for the label, the default is used ("Add").
- */
- public void enableAddMode(ISystemAddFileListener caller, String addLabel, String addToolTipText)
- {
- enableAddMode(caller);
- this.addLabel = addLabel;
- this.addToolTipText = addToolTipText;
- }
-
/**
* Show the property sheet on the right hand side, to show the properties of the
* selected object.
@@ -459,6 +407,8 @@ public class SystemSelectRemoteFileAction extends SystemBaseDialogAction
dlg.setMultipleSelectionMode(multipleSelectionMode);
+ dlg.setShowNewConnectionPrompt(showNewConnectionPrompt);
+
if (systemConnection != null)
{
dlg.setDefaultSystemConnection(systemConnection, onlyConnection);
@@ -547,13 +497,4 @@ public class SystemSelectRemoteFileAction extends SystemBaseDialogAction
viewerFilters.add(filter);
}
- /**
- * Sets whether to allow folder selection. The default selection validator will use this to
- * determine whether the OK button will be enabled when a folder is selected. The default
- * is true
.
- * @param allow true
to allow folder selection, false
otherwise.
- */
- public void setAllowFolderSelection(boolean allow) {
- allowFolderSelection = allow;
- }
}
\ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/actions/SystemSelectRemoteFolderAction.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/actions/SystemSelectRemoteFolderAction.java
index ffa12d14c7b..c1195c0d2cd 100644
--- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/actions/SystemSelectRemoteFolderAction.java
+++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/actions/SystemSelectRemoteFolderAction.java
@@ -13,17 +13,20 @@
* Contributors:
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* Xuan Chen (IBM) - [220995] [api] Need to add setCustomViewFilter API to SystemSelectRemoteFileAction
+ * Xuan Chen (IBM) - [220995] [api] Need to remove unnecessary APIs.
********************************************************************************/
package org.eclipse.rse.files.ui.actions;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.files.ui.ISystemAddFileListener;
import org.eclipse.rse.files.ui.dialogs.SystemRemoteFileDialog;
import org.eclipse.rse.files.ui.dialogs.SystemRemoteFolderDialog;
import org.eclipse.rse.internal.files.ui.FileResources;
+import org.eclipse.rse.subsystems.files.core.model.RemoteFileUtility;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
+import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem;
import org.eclipse.rse.ui.SystemActionViewerFilter;
import org.eclipse.rse.ui.actions.SystemBaseDialogAction;
import org.eclipse.rse.ui.dialogs.SystemRemoteResourceDialog;
@@ -40,10 +43,7 @@ import org.eclipse.swt.widgets.Shell;
*
- * When a library is selected, the caller is called back to decide to enable the Add - * button or not. - */ - public void enableAddMode(ISystemAddFileListener caller) - { - this.addButtonCallback = caller; - } - /** - * Overloaded method that allows setting the label and tooltip text of the Add button. - * If you pass null for the label, the default is used ("Add"). - */ - public void enableAddMode(ISystemAddFileListener caller, String addLabel, String addToolTipText) - { - enableAddMode(caller); - this.addLabel = addLabel; - this.addToolTipText = addToolTipText; - } - /** * Show the property sheet on the right hand side, to show the properties of the * selected object. @@ -338,14 +308,6 @@ public class SystemSelectRemoteFolderAction extends SystemBaseDialogAction this.multipleSelectionMode = multiple; } - /* - * Indicates whether to allow selection of objects from differnet parents - */ - public void setAllowForMultipleParents(boolean multiple) - { - this.allowForMultipleParents = multiple; - } - /** * Specify a validator to use when the user selects a remote file or folder. * This allows you to decide if OK should be enabled or not for that remote file or folder. @@ -487,16 +449,18 @@ public class SystemSelectRemoteFolderAction extends SystemBaseDialogAction dlg = new SystemSelectRemoteFileOrFolderDialog(shell, false); // false => folder vs file mode else dlg = new SystemSelectRemoteFileOrFolderDialog(shell, dlgTitle, false); // false => folder vs file mode - + */ dlg.setShowNewConnectionPrompt(showNewConnectionPrompt); dlg.setMultipleSelectionMode(multipleSelectionMode); + + /* dlg.setAllowForMultipleParents(allowForMultipleParents); if (restrictFolders) dlg.setRestrictFolders(true); - - + + if (systemConnection != null) { if (onlyConnection) @@ -519,6 +483,7 @@ public class SystemSelectRemoteFolderAction extends SystemBaseDialogAction */ if (preSelection != null) dlg.setPreSelection(preSelection); + /* else if (rootFolderConnection != null) dlg.setRootFolder(rootFolderConnection, rootFolderAbsPath); diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemRemoteResourceDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemRemoteResourceDialog.java index 67c1eeb5173..c4852ac436f 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemRemoteResourceDialog.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemRemoteResourceDialog.java @@ -14,6 +14,7 @@ * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Martin Oberhuber (Wind River) - [190442] made SystemActionViewerFilter API * Kevin Doyle (IBM) - [198114] Allowed to move file into existing folder/archive on first attempt + * Xuan Chen (IBM) - [220999] [api] Need to change class SystemSelectRemoteFileAction to use SystemRemoteFileDialog ********************************************************************************/ package org.eclipse.rse.ui.dialogs; @@ -53,6 +54,7 @@ public abstract class SystemRemoteResourceDialog extends SystemPromptDialog { _form = new SystemResourceSelectionForm(getShell(), parent, this, _inputProvider, getVerbiage(), _multipleSelectionMode, getMessageLine()); initForm(); + _form.setPreSelection(_preSelection); createMessageLine(parent); return _form.getInitialFocusControl(); } @@ -247,7 +249,13 @@ public abstract class SystemRemoteResourceDialog extends SystemPromptDialog else setOutputObject(null); return closeDialog; - } + } + + public void setShowNewConnectionPrompt(boolean showNewConnectionPrompt) + { + _inputProvider.setAllowNewConnection(showNewConnectionPrompt); + } + /** * Private method. *