Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Examples of supporting clipboard?
Examples of supporting clipboard? [message #46574] Fri, 23 May 2003 18:36 Go to next message
Eclipse UserFriend
Originally posted by: purplehayz.earthlink.net

Now that I have a working Table with system properties culled from the
runtime, not eclipse, JVM, I now want to be able to select a cell and copy
the value so I can paste it into an editor (or elsewhere). Can someone
point me to an example and/or supporting material for how to make a view
support the Copy menu item (I've discovered the TableCursor class so I can
select a particular cell fine)?

Thanks and have fun! - Bob

--
Bob Hays, Computer Geek

"In this world you must be oh so smart or oh so pleasant. Well, for years I
was smart. I recommend pleasant."
-- Elwood P. Dowd as played by James Stewart in Harvey
Re: Examples of supporting clipboard? [message #46599 is a reply to message #46574] Fri, 23 May 2003 18:52 Go to previous messageGo to next message
David J. Orme is currently offline David J. OrmeFriend
Messages: 291
Registered: July 2009
Senior Member
Bob Hays, Computer Geek wrote:
> Now that I have a working Table with system properties culled from the
> runtime, not eclipse, JVM, I now want to be able to select a cell and copy
> the value so I can paste it into an editor (or elsewhere). Can someone
> point me to an example and/or supporting material for how to make a view
> support the Copy menu item (I've discovered the TableCursor class so I can
> select a particular cell fine)?

Please see the snippets at

http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/plat form-swt-home/dev.html.

For more places to find SWT information, we maintain a list of SWT links
at:

http://www.swtworkbench.com/community/bin/index.cgi?action=l inks&cat=swt


Best,

Dave
--
Dave Orme
Advanced Systems Concepts
http://www.swtworkbench.com
Re: Examples of supporting clipboard? [message #46749 is a reply to message #46574] Fri, 23 May 2003 18:58 Go to previous messageGo to next message
David J. Orme is currently offline David J. OrmeFriend
Messages: 291
Registered: July 2009
Senior Member
Bob Hays, Computer Geek wrote:
> Now that I have a working Table with system properties culled from the
> runtime, not eclipse, JVM, I now want to be able to select a cell and copy
> the value so I can paste it into an editor (or elsewhere). Can someone
> point me to an example and/or supporting material for how to make a view
> support the Copy menu item (I've discovered the TableCursor class so I can
> select a particular cell fine)?

The previous post only has the information on how to actually use the
clipboard. In order to hook the copy action, you need to have your view
do something like the following inside your createPartControl() method:

IActionBars bars = getViewSite().getActionBars();
bars.setGlobalActionHandler(
IWorkbenchActionConstants.COPY,
new Action() {
public void run() {
// Put your code here
});


Best,

Dave
--
Dave Orme
Advanced Systems Concepts
http://www.swtworkbench.com
Re: Examples of supporting clipboard? [message #46947 is a reply to message #46749] Fri, 23 May 2003 20:18 Go to previous message
Eclipse UserFriend
Originally posted by: purplehayz.earthlink.net

THIS is probably what I needed! Thanks, I'd already perused the SWT pages
and samples quite a bit (that's how I learned about the TableCursor class,
for example).

Thanks and have fun! - Bob

On 5/23/03 1:58 PM, in article balqvs$5c8$1@rogue.oti.com, "David J. Orme"
<daveo@asc-iseries.com> wrote:

> Bob Hays, Computer Geek wrote:
>> Now that I have a working Table with system properties culled from the
>> runtime, not eclipse, JVM, I now want to be able to select a cell and copy
>> the value so I can paste it into an editor (or elsewhere). Can someone
>> point me to an example and/or supporting material for how to make a view
>> support the Copy menu item (I've discovered the TableCursor class so I can
>> select a particular cell fine)?
>
> The previous post only has the information on how to actually use the
> clipboard. In order to hook the copy action, you need to have your view
> do something like the following inside your createPartControl() method:
>
> IActionBars bars = getViewSite().getActionBars();
> bars.setGlobalActionHandler(
> IWorkbenchActionConstants.COPY,
> new Action() {
> public void run() {
> // Put your code here
> });
>
>
> Best,
>
> Dave

--
Bob Hays, Computer Geek

"In this world you must be oh so smart or oh so pleasant. Well, for years I
was smart. I recommend pleasant."
-- Elwood P. Dowd as played by James Stewart in Harvey
Previous Topic:Thanks
Next Topic:JDBC problem
Goto Forum:
  


Current Time: Thu Dec 26 19:33:57 GMT 2024

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

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

Back to the top