Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » problem pasting resources from clipboard (problem pasting resources from clipboard )
problem pasting resources from clipboard [message #699912] Fri, 22 July 2011 15:09 Go to next message
Mark Walters is currently offline Mark WaltersFriend
Messages: 25
Registered: June 2011
Junior Member
Hi,
I do this:
clipboard = new Clipboard(HandlerUtil.getActivePart(event).getSite().getShell().getDisplay());
IResource[] resourceArray = (IResource[]) resources.toArray(new IResource[resources.size()]);
clipboard.setContents(resourceArray, new Transfer[] {ResourceTransfer.getInstance()});

Which works a treat (event is an ExecutionEvent passed in from the command handler)

But when I then do:
IResource[] resources = (IResource[])clipboard.getContents(ResourceTransfer.getInstance());

resources comes back as null!
If I breakpoint on 'getContents' I can see the clipboard data contains a file resource - as I would expect, but it isn't returned from getContents.
Any help would be awesome, thanks.
Ta,
Mark.


Re: problem pasting resources from clipboard [message #701248 is a reply to message #699912] Sun, 24 July 2011 21:50 Go to previous message
Mark Walters is currently offline Mark WaltersFriend
Messages: 25
Registered: June 2011
Junior Member
fixed it, changed line to:

clipboard.setContents(new Object[] {resourceArray}, new Transfer[] {ResourceTransfer.getInstance()});

I found an example in existing plugin code.
Previous Topic: Problem for TPTP remote Profiling webapplication running in solaris
Next Topic:Eclipse Doesn't Allow Software Installation
Goto Forum:
  


Current Time: Fri Apr 26 23:16:44 GMT 2024

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

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

Back to the top