Community
Participate
Working Groups
Currently the "ok" button in SystemRemoteFileDialog is always enabled and hence the user can select anything and click "ok". I think this should be extended so there are methods available to set when the "ok" button should be enabled. Possible Methods: setAllowFolderSelection(boolean) setAllowFileSelection(boolean) setAllowFileAndFolderSelection(boolean) This way the dialog can be used for many different purposes. -----------Enter bugs above this line----------- TM 2.0M6 Testing installation : eclipse-SDK-3.3M6 RSE install : 2.0 Stream Integration Build - I20070405-0600 java.runtime : Sun 1.5.0_11-b03 os.name: : Windows XP, Service Pack 2 ------------------------------------------------
Additionally, I think that SystemRemoteFolderDialog should not even show files but only folders.
Martin, the SystemRemoteFolderDialog does not show files (at least in the cases where I've used). Is there a case where you do see files?
This looks like an API addition to me, or am I mistaken? I'd prefer getting API changes done before RC3.
I've been taking a look at this for Dave and these are the issue's: SystemResourceSelectionForm, which is used by the SystemRemoteResourceDialog, is in the package org.eclipse.rse.internal.ui.view. Ideally it shouldn't be in an internal package, but by having it in the rse.ui package we don't have a dependency on rse.subsystems.files.core. To validate the selected object is a file or folder we do something like: adapter.getRemoteType(selectedObjects[i]).equals(ISystemFileRemoteTypes.TYPE_FILE) ISystemFileRemoteTypes is in rse.subsystems.files.core though, so that can't be done from where SystemResourceSelectionForm is currently. As Dave told me the idea behind SystemResourceSelectionForm is for selecting any resource, so moving it to files package wouldn't really make sense either. I looked at IValidatorRemoteSelection next and they require SystemMessage's to be returned if the selection is not valid and return null if the selection is valid. Since we don't have SystemMessage's for invalid selections I tried using the FileResources.properties in files.ui and a generic SystemMessage. This would require the validator's to be in the files.ui package because of the dependency on that properties file, which doesn't make much sense since the validator's aren't ui elements. Even if we used the FileResources.properties and a generic SystemMessages like this: invalid = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_GENERIC_E); invalid.makeSubstitution(FileResources.ACTION_SELECT_FILE_TOOLTIP); We don't have a good message to use about selecting a folder or archive which is used in the search dialog for selecting a folder and probably in the Project actions. Should we defer this till 3.0 or how should we go about this?
Adding Dave D for additional opinions.
As discussed on committer meeting 2007-06-05: Validators can be used for enablement, so this does not require an API change.
*** Bug 189429 has been marked as a duplicate of this bug. ***
*** Bug 187011 has been marked as a duplicate of this bug. ***
As I previously mentioned we don't have any real SystemMessages to use and they are required when the selection is not valid by the selection validator. We could use the following Strings and use a generic SystemMessage and pass these strings in: FileResources.ACTION_SELECT_FILE_TOOLTIP = "Select file from remote system" FileResources.ACTION_SELECT_DIRECTORY_TOOLTIP = "Select folder from remote system" Though we don't have one for Select Folder dialog where Archives are usually allowed, so using the string above isn't a good idea for that. Martin, what do you think? Should we just defer this to 3.0 or should I use these strings in the places they can be and have the other dialogs just work the way they are now?
I think that in general we should avoid re-using Strings that are meant for something else. This is a hack which could have adverse effects in the future, and is not worth it for now. I think there's other stuff with higher priority to attack for 2.0.1.
Agreed. Assigning to Future.
(In reply to comment #4) Kevin it looks like the ability to use a Validator in order to restrict resource selection to certain types (files, folders, particular types of files) is a requirement for fixing the regression in bug 231346. The IValidatorRemoteSelection is a UI interface, so corresponding implementations require org.eclipse.rse.ui anyways. Does the new SimpleSystemMessage API and its current use help for creating proper Validators that clients can use? - It seems to me, that some pre-defined validator(s) for remote files and folders should live in org.eclipse.rse.files.ui, as a subclass of ValidatorRemoteSelection. By living in files.ui, the Validator can use the existing SystemMessages or NLS Strings from files.ui. I could imagine an API Class with a Constructor like this: new RemoteFileValidator(boolean allowFiles, boolean allowFolders, String filter)