Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Clipboard question
Clipboard question [message #436957] Wed, 26 May 2004 20:30 Go to next message
Mark Victory is currently offline Mark VictoryFriend
Messages: 133
Registered: July 2009
Senior Member
Hi,

I have, I think, an unusual operation to perform on the clipboard.

I would like to capture the entire contents of the clipboard (all the
transfer types) and save the information to a file.

This information would then be returned to the clipboard at a later time.

Is it possible to save the entire clipboard contents as one piece of data to
a file or do I need to iterate over all the transfer types, retrieve their
data and save each one individually?

Thanks,

Mark
Re: Clipboard question [message #436985 is a reply to message #436957] Thu, 27 May 2004 14:19 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
I would advise against this approach.

You need to get each type individually and you need to know how to put that
type back. SWT only supports a subset of the data types that the clipboard
can handle. There is no generic way to suck the bytes out of the clipboard
and then restore them. Each platform will have its own structure for the
data. In some cases, the data may be a temporary handle to memory (e.g. a
pointer to a string) that will not be valid for a long period of time. You
can not assume that all of the data can just be written to a file and put
back later. You need to have knowledge of each data type you are handling.
SWT has the knowledge built in for a subset of data types but not for all.

"Mark Victory" <MVictory@us.ibm.com> wrote in message
news:c92tsg$bmr$1@eclipse.org...
> Hi,
>
> I have, I think, an unusual operation to perform on the clipboard.
>
> I would like to capture the entire contents of the clipboard (all the
> transfer types) and save the information to a file.
>
> This information would then be returned to the clipboard at a later time.
>
> Is it possible to save the entire clipboard contents as one piece of data
to
> a file or do I need to iterate over all the transfer types, retrieve their
> data and save each one individually?
>
> Thanks,
>
> Mark
>
>
Previous Topic:Performance tuning
Next Topic:View in two parts
Goto Forum:
  


Current Time: Sat Apr 27 03:18:33 GMT 2024

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

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

Back to the top