implementing copy paste [message #154664] |
Wed, 10 October 2007 08:20 |
Eclipse User |
|
|
|
Hi !!!!
I have implemented a IActionBars and have set GlobalActionHandler
for copy paste action for my own view (SBCSExplorerView)
Problem is how to set the contents of the clipboard .i am able
to get the selection but not not knowing how to set the
contents.Kindly help me ....
i have pasted the code below as to wht i have done soo far :
public class ElementCopyAction extends Action {
protected Clipboard clipboard;
private StructuredViewer viewer;
public ElementCopyAction( StructuredViewer viewer, Clipboard clipboard)
{
super("Copy");
this.viewer =viewer;
this.clipboard = clipboard;
}
public Transfer getTransfer() {
return ElementTransfer.getInstance();
}
public void run() {
IStructuredSelection sel =
(IStructuredSelection)viewer.getSelection();
System.out.println("dsfsjfsjfs"+sel);
SBCSExplorerView[] gadgets =
(SBCSExplorerView[])sel.toList().toArray(new SBCSExplorerView[sel.size()]);
clipboard.setContents(new Object[] {gadgets}, new Transfer[]
{ElementTransfer.getInstance()});
}
}
i am getting a error copy fully not done !!!!!!
Kindly help me plzzzzz it is urgent !!!!!
|
|
|
Powered by
FUDForum. Page generated in 0.03840 seconds