Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Deprecated method.
Deprecated method. [message #213286] Tue, 04 April 2006 19:10 Go to next message
Eclipse UserFriend
Originally posted by: jsk_lam.hotmail.com

Hi,

I have the following code snippets:

public class myEditor extends MultiPageEditorPart {
...
protected void createActions() {

IAction zoomIn = new ZoomInAction(getDelegatingZoomManager());
IAction zoomOut = new ZoomOutAction(getDelegatingZoomManager());

addAction(zoomIn);
addAction(zoomOut);

// getSite().getKeyBindingService().registerAction(zoomIn);
// getSite().getKeyBindingService().registerAction(zoomOut);
}
}

The getSite().getKeyBindingService() has been deprecated in Eclipse 3.1.
However, my program still work as expected after I've removed the 2 lines
shown above.

My question is, is the getSite.getKeyBindingService().registAction() really needed
in Eclipse 3.1?

Thanks
SL.
Re: Deprecated method. [message #213294 is a reply to message #213286] Wed, 05 April 2006 05:20 Go to previous messageGo to next message
Andreas Schosser is currently offline Andreas SchosserFriend
Messages: 30
Registered: July 2009
Member
The IKeyBindingService allows to assign keys to certain commands / actions
(see interface IKeyBindingService).
If you register the two zoom actions with the site's key-binding service,
you will be able to
- zoom in by pressing 'Strg' + '='
- zoom out by pressing 'Str' + '-'
Unfortunately, I don't know how to replace the deprecated method calls
either.

Anyone who can help us?
Thanks.

Andreas

--
A. Schosser
Mind8 GmbH

sl wrote:

> Hi,
>
> I have the following code snippets:
>
> public class myEditor extends MultiPageEditorPart {
> ...
> protected void createActions() {
>
> IAction zoomIn = new ZoomInAction(getDelegatingZoomManager());
> IAction zoomOut = new ZoomOutAction(getDelegatingZoomManager());
>
> addAction(zoomIn);
> addAction(zoomOut);
>
> // getSite().getKeyBindingService().registerAction(zoomIn);
> // getSite().getKeyBindingService().registerAction(zoomOut);
> }
> }
>
> The getSite().getKeyBindingService() has been deprecated in Eclipse 3.1.
> However, my program still work as expected after I've removed the 2 lines
> shown above.
>
> My question is, is the getSite.getKeyBindingService().registAction()
> really needed
> in Eclipse 3.1?
>
> Thanks
> SL.
>
Re: Deprecated method. [message #213299 is a reply to message #213286] Wed, 05 April 2006 05:24 Go to previous messageGo to next message
Andreas Schosser is currently offline Andreas SchosserFriend
Messages: 30
Registered: July 2009
Member
Well, the IKeyBindingService interface itself is deprecated.
- I'm not sure, if an IHandlerService or an ActionHandler could solve the
problem?

--
A. Schosser
Mind8 GmbH
Re: Deprecated method. [message #213720 is a reply to message #213294] Mon, 10 April 2006 06:39 Go to previous message
Andreas Schosser is currently offline Andreas SchosserFriend
Messages: 30
Registered: July 2009
Member
Searching bugzilla, I finally found the answer to the 'deprecated
IKeyBindingService question':
https://bugs.eclipse.org/bugs/show_bug.cgi?id=53812
If you only want to get rid of the 'deprecated'-warnings, just implement
the following lines (as mentioned by D. Pollock):

// IAction action = ...; your zoom-in / zoom-out action
IHandlerService service = (IHandlerService)
getSite().getService(IHandlerService.class);
service.activateHandler(action.getActionDefinitionId(), new
ActionHandler(action));

Note: org.eclipse.core.expressions plugin is required

Regards,

Andreas

--
A. Schosser
Mind8 GmbH

A. Schosser wrote:

> The IKeyBindingService allows to assign keys to certain commands /
> actions (see interface IKeyBindingService).
> If you register the two zoom actions with the site's key-binding
> service, you will be able to
> - zoom in by pressing 'Strg' + '='
> - zoom out by pressing 'Str' + '-'
> Unfortunately, I don't know how to replace the deprecated method calls
> either.
>
> Anyone who can help us?
> Thanks.
>
> Andreas
Previous Topic:How to make my Toolbar menu as an editor associated.
Next Topic:Layout Editpolicy on connections
Goto Forum:
  


Current Time: Thu Apr 25 16:13:19 GMT 2024

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

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

Back to the top