Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [dsdp-tm-dev] Re: dsdp-tm-dev Digest, Vol 46, Issue 10

Hi Vrushali,

I don't think that dialog allows you to do that by itself. I suspect that we would need a new API in order to control the input that way since, I don't see anything that allows for a custom input provider. A bug should be opened for that.

In the meantime, you could try working around this via the following (although it would have warnings for use of internals):

You could write your own input provider like this:

import org.eclipse.rse.internal.files.ui.view.SystemRemoteFileSelectionInputProvider;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;

public class MyFileSelectionInputProvider extends
SystemRemoteFileSelectionInputProvider {

private IRemoteFile _remoteFileInput;

public MyFileSelectionInputProvider(IRemoteFile remoteFileInput){
super(remoteFileInput.getParentRemoteFileSubSystem().getHost());
_remoteFileInput = remoteFileInput;
}

public Object[] getSystemViewRoots() {
return new Object[] {_remoteFileInput};
}
}

Then extend SystemRemoteResourceDialog like this so that your own input provider is used:


public class MyRemoteFileDialog extends SystemRemoteResourceDialog {

public MyRemoteFileDialog(Shell shell, String title, IRemoteFile remoteFileInput) {
super(shell, title, new MyFileSelectionInputProvider(remoteFileInput));
}

public String getVerbiage()
{
return SystemFileResources.RESID_SELECTFILE_VERBIAGE;
}

public String getTreeTip()
{
return SystemFileResources.RESID_SELECTFILE_SELECT_TOOLTIP;
}

public SystemActionViewerFilter getViewerFilter()
{
return null;
}

/**
* Override of parent.
*/
protected Control createContents(Composite parent)
{
Control control = super.createContents(parent);
getSystemTree().addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
handleDoubleClick(event);
}
});
return control;
}

/**
* Handles double clicks in viewer.
* Closes the dialog if a file is double clicked
*/
protected void handleDoubleClick(DoubleClickEvent event)
{
ISystemTree tree = getSystemTree();
IStructuredSelection s = (IStructuredSelection) event.getSelection();
Object element = s.getFirstElement();
if (element == null)
return;
if (isPageComplete() && !tree.isExpandable(element))
{
setReturnCode(OK);
if (processOK())
{
okPressed = true;
close();
}
}
}
}

I hope this helps,
____________________________________
David McKnight
Phone: 905-413-3902 , T/L: 969-3902
Internet: dmcknigh@xxxxxxxxxx
Mail: D1/YFY/8200/TOR
____________________________________

Inactive hide details for vrushali babar <vrush_com@xxxxxxxxx>vrushali babar <vrush_com@xxxxxxxxx>


          vrushali babar <vrush_com@xxxxxxxxx>
          Sent by: dsdp-tm-dev-bounces@xxxxxxxxxxx

          26/05/2009 09:04 AM

          Please respond to
          Target Management developer discussions <dsdp-tm-dev@xxxxxxxxxxx>

To

dsdp-tm-dev@xxxxxxxxxxx

cc


Subject

[dsdp-tm-dev] Re: dsdp-tm-dev Digest, Vol 46, Issue 10
Hi David,

I tried preSelection but it expands the location that I pass as a parameter and does
not restrict.
If the hierarchy is
A
---B
----D
----E
----G
---C
----F
----G
And allowed location path is A/B/*,
It should only display hierarchy for directories/files under A/B/ .
Could you tell me where am I going wrong or any other method?

Thanks a lot,
Vrushali.


--- On
Fri, 5/22/09, dsdp-tm-dev-request@xxxxxxxxxxx <dsdp-tm-dev-request@xxxxxxxxxxx> wrote:


From: dsdp-tm-dev-request@xxxxxxxxxxx <dsdp-tm-dev-request@xxxxxxxxxxx>
Subject: dsdp-tm-dev Digest, Vol 46, Issue 10
To: dsdp-tm-dev@xxxxxxxxxxx
Date: Friday, May 22, 2009, 9:30 PM

Send dsdp-tm-dev mailing list submissions to
dsdp-tm-dev@xxxxxxxxxxx

To subscribe or unsubscribe via the World Wide Web, visit
https://dev.eclipse.org/mailman/listinfo/dsdp-tm-dev
or, via email, send a message with subject or body 'help' to
dsdp-tm-dev-request@xxxxxxxxxxx

You can reach the person managing the list at
dsdp-tm-dev-owner@xxxxxxxxxxx

When replying, please edit your Subject line so it is more specific
than "Re: Contents of dsdp-tm-dev digest..."


Today's Topics:

1. Fw: restricting input for SystemRemoteFileDialog (vrushali babar)
2. Re: Fw: restricting input for SystemRemoteFileDialog
(David McKnight)


----------------------------------------------------------------------

Message: 1
Date: Thu, 21 May 2009 10:37:07 -0700 (PDT)
From: vrushali babar <
vrush_com@xxxxxxxxx>
Subject: [dsdp-tm-dev] Fw: restricting input for
SystemRemoteFileDialog
To: dsdp-tm <
dsdp-tm-dev@xxxxxxxxxxx>
Message-ID: <
268589.33235.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Content-Type: text/plain; charset="iso-8859-1"


Please provide some pointers.

Thanks,
Vrushali.

--- On Wed, 5/20/09, vrushali babar <
vrush_com@xxxxxxxxx> wrote:


From: vrushali babar <
vrush_com@xxxxxxxxx>
Subject: restricting input for SystemRemoteFileDialog
To: "dsdp-tm" <
dsdp-tm-dev@xxxxxxxxxxx>
Date: Wednesday, May 20, 2009, 11:18 PM







Hi,

I'm using SystemRemoteFileDialog to provide remote directory hierarchy.
Currently it is showing the whole directory structure of connected server; I tried filtering
out based on filter string but failed.
Expected scenario - diolog box should only show directory structure under specified
location.

Can anyone guide me in how to restrict the input for SystemRemoteFileDialog?

Thanks in advance,
Vrushali.




-------------- next part --------------
An HTML attachment was scrubbed...
URL:
https://dev.eclipse.org/mailman/private/dsdp-tm-dev/attachments/20090521/94039152/attachment.html

------------------------------

Message: 2
Date: Thu, 21 May 2009 13:45:12 -0400
From: David McKnight <
dmcknigh@xxxxxxxxxx>
Subject: Re: [dsdp-tm-dev] Fw: restricting input for
SystemRemoteFileDialog
To: Target Management developer discussions <
dsdp-tm-dev@xxxxxxxxxxx>
Cc: dsdp-tm <
dsdp-tm-dev@xxxxxxxxxxx>, dsdp-tm-dev-bounces@xxxxxxxxxxx
Message-ID:
<
OF400E6795.833A8179-ON852575BD.00616BD2-852575BD.00616E3D@xxxxxxxxxx>
Content-Type: text/plain; charset="us-ascii"

Skipped content of type multipart/alternative-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
Url :
https://dev.eclipse.org/mailman/private/dsdp-tm-dev/attachments/20090521/b5f4c4da/graycol.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic17174.gif
Type: image/gif
Size: 1255 bytes
Desc: not available
Url :
https://dev.eclipse.org/mailman/private/dsdp-tm-dev/attachments/20090521/b5f4c4da/pic17174.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecblank.gif
Type: image/gif
Size: 45 bytes
Desc: not available
Url :
https://dev.eclipse.org/mailman/private/dsdp-tm-dev/attachments/20090521/b5f4c4da/ecblank.gif

------------------------------

_______________________________________________
dsdp-tm-dev mailing list

dsdp-tm-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dsdp-tm-dev


End of dsdp-tm-dev Digest, Vol 46, Issue 10
*******************************************

_______________________________________________
dsdp-tm-dev mailing list
dsdp-tm-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dsdp-tm-dev

GIF image

GIF image

GIF image


Back to the top