Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Re: Cut/copy/paste at the widget level
Re: Cut/copy/paste at the widget level [message #330290] Thu, 24 July 2008 14:20 Go to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

David Huebel wrote:
> What is the best way to declare custom cut/copy/paste behavior for a
> widget instance? If I were doing this at the view level I would
> use retargetable actions, but I need to do this for a single widget in
> a view. All the other widgets in the view should retain their usual
> cut/copy/paste behavior. Right now the widget is an instance of Composite,
> but I could subclass Composite if necessary.

Within eclipse you can use the IFocusService to register a specific
control to the system (using an id, usually).

Then you can activate a handler for that Control using the appropriate
activeWhen clause (and org.eclipse.ui.handlers) or by using a Expression
and IHandlerService#activateHandler(*).

See ISources and http://wiki.eclipse.org/Command_Core_Expressions for a
discussion of variables available, and IFocusService javadoc for a
description of its use.

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Re: Cut/copy/paste at the widget level [message #330507 is a reply to message #330290] Wed, 30 July 2008 16:09 Go to previous message
Eclipse UserFriend
Originally posted by: davidhuebel.example.net

Paul Webster wrote:
> Within eclipse you can use the IFocusService to register a specific
> control to the system (using an id, usually).
>
> Then you can activate a handler for that Control using the appropriate
> activeWhen clause (and org.eclipse.ui.handlers) or by using a Expression
> and IHandlerService#activateHandler(*).
>
> See ISources and http://wiki.eclipse.org/Command_Core_Expressions for a
> discussion of variables available, and IFocusService javadoc for a
> description of its use.
>
> PW
>
>

Thanks! This is exactly what I needed.

-David
Previous Topic:Ctrl+S different behaviour in Eclipse 3.3 and 3.4
Next Topic:Annotation Hilighting
Goto Forum:
  


Current Time: Thu Jul 18 06:27:58 GMT 2024

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

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

Back to the top