Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » implementing copy paste
implementing copy paste [message #154664] Wed, 10 October 2007 08:20
Eclipse UserFriend
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 !!!!!
Previous Topic:Properties view in formdialog
Next Topic:"Custom Actions" in the MindMap example (GMF Tutorial)
Goto Forum:
  


Current Time: Fri May 09 14:50:47 EDT 2025

Powered by FUDForum. Page generated in 0.03840 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top