Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » API for enablement of Actions based on enablement syntax for declarative actions
API for enablement of Actions based on enablement syntax for declarative actions [message #303876] Thu, 25 May 2006 09:33 Go to next message
Eclipse UserFriend
Originally posted by: noSpam.youdontcare.org

Hi,

I was wondering why there is no API to make use of the enablement syntax
that is available for Actions contributed through the
org.eclipse.ui.actionSets extension point.

I had a look at the code and noticed that org.eclipse.ui.SelectionEnabler
and org.eclipse.ui.internal.ActionExpression are responsible for
implementinf enablement based on the enablement expression from the
extension. SelectionEnabler only works with IConfigurationElement and
ActionExpression is an internal class.

Am I missing some public API or do I need to implement all of this again?

I have a TreeViewer that display a tree of different entities. Often I need
to enable an Action only in case the selection does only contain one type of
entity for example. To do this I need to attach an ISelectionListener, check
for instances of IStructuredSelection, cast to IStructuredSelection and
finally iterate over the complete selection just to find out if only certain
types of entities are selected.

It is no problem to externalize this code into a helper or superclass but I
was wondering why this is not exposed as API when all of this is already
implemented for the declarative Actions.

Any comments would be greatly appreciated.

Thanks.

Thomas
Re: API for enablement of Actions based on enablement syntax for declarative actions [message #303880 is a reply to message #303876] Thu, 25 May 2006 09:46 Go to previous message
Eclipse UserFriend
The common enablement expressions are defined in
org.eclipse.core.expressions.

Check out org.eclipse.core.expressions.ExpressionConverter, which can
take the core expression XML and return an expression to be evaluated.

I'm not sure if this is heading in the correct direction for you (I know
that in the workbench we want to replace our own expression stuff with
the core expression stuff, probably in 3.3).

Later,
PW
Previous Topic:Is it possible to contribute Actions declarative for retargetable actions
Next Topic:Converting a plug-in into an RCP-based application
Goto Forum:
  


Current Time: Tue Jul 22 02:48:37 EDT 2025

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

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

Back to the top