Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Core Expression: activeEditor adapts to ITextEditor
Core Expression: activeEditor adapts to ITextEditor [message #511075] Fri, 29 January 2010 17:26 Go to next message
Eclipse User
Originally posted by: thorsten.vitt.uni-wuerzburg.de

Hi,

I am trying to enable a handler if the active editor adapts to
ITextEditor. I'm using this expression:

<activeWhen>
<with
variable="activeEditor">
<adapt
type="org.eclipse.ui.texteditor.ITextEditor">
</adapt>
</with>
</activeWhen>

This works fine for editors that actually implement ITextEditor.

However, the handler remains inactive for MultiPageEditorParts that have
an ITextEditor as a child, although programmatically calling
getAdapter(ITextEditor.class) on them works fine (there's code in
MultiPageEditorPart.getAdapter() that cares for that).

What am I doing wrong?


Thanks for any help,

Thorsten
Re: Core Expression: activeEditor adapts to ITextEditor [message #511089 is a reply to message #511075] Fri, 29 January 2010 18:23 Go to previous message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

CoreExpressions only has access to the IAdapterManager (because it can't
see contributed bundles). Something has to register the MPEP so it can
be adapted by the IAdapterManager to the ITextEditor.

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/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Previous Topic:What is the "Preject References" for?
Next Topic:Cannot trace plugin actication using Core Tools on 3.5
Goto Forum:
  


Current Time: Wed Sep 03 00:02:26 GMT 2014

Powered by FUDForum. Page generated in 0.01544 seconds