Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » how do I access a handler method from a view?(Making a plugin, need help!)
how do I access a handler method from a view? [message #652793] Sun, 06 February 2011 19:38 Go to next message
Joel is currently offline JoelFriend
Messages: 8
Registered: January 2011
Junior Member
Hi, I am currently developing a plugin.

I have a view that has a dispose method. In this dispose method I want to be able to call a method called isEnabled from a handler class. The handler class is a command, that is set to a menu.

Does anyone know how i can do this?
Thanks!

[Updated on: Sun, 06 February 2011 19:59]

Report message to a moderator

Re: how do I access a handler method from a view? [message #652879 is a reply to message #652793] Mon, 07 February 2011 13:07 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You want the eclipse.platform or eclipse.platform.rcp forum/newsgroup.

In theory you can get the current enabled state for a command (in 3.x)
using:

ICommandService cs
= (ICommandService) getSite().getService(ICommandService.class);
Command cmd = cs.getCommand("your.command.id");
if (cmd.isDefined()) {
cmd.isEnabled() returns the enabled state as last set by
the active handler.
}

PW

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


Previous Topic:organize Resources
Next Topic:Problem with republish not getting triggered
Goto Forum:
  


Current Time: Mon Dec 22 22:51:48 GMT 2014

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

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