Test for file extension in the active editor via expression definition in plugin.xml [message #552943] |
Sat, 14 August 2010 19:37  |
Eclipse User |
|
|
|
I am trying to make the display of a toolbar button conditional upon the
type (extension) of the input file in the currently active editor. For
this I set the following expression:
<definition
id="com.kelman.basemap.ui.selectedGeometrySingleFile">
<and>
<reference
definitionId="com.kelman.database.kismet.ui.view.activeEditor ">
</reference>
<with
variable="activeEditor">
<adapt
type="org.eclipse.core.resources.IResource">
<test
property="org.eclipse.core.resources.name"
value="*.gdb">
</test>
</adapt>
</with>
</and>
</definition>
hoping to get the active editor adapt to the IResource and then test the
file name for the desired extension ("gdb").
But the getAdapter() method of the editor is never called. I guess, I am
using the wrong setup. What variable should I use to make the framework
use the editor as the target for adapter?
Thanks for any guidance.
Alex Molochnikov
Kelman Technologies Inc.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03226 seconds