Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » LaunchShortcut Extension(hasNature does not work)
LaunchShortcut Extension [message #492176] Mon, 19 October 2009 10:35
Alexander Mack is currently offline Alexander Mack
Messages: 100
Registered: July 2009
Senior Member
Hello,
I added a ProjectNature to my plugin project to identify projects as "MyProjects".
Adding the NATURE_ID still works fine, I can see the ID in the .project file created by Eclipse.

Now I want to launch those Files, so I added the launchShortcuts extension point to the plugin.
It should be possible to launch by clicking on either a file or a project.
If the project is an instance of "MyProject" I wanted to check via the NATURE_ID.
Now here is the extension point

<extension point="org.eclipse.debug.ui.launchShortcuts">
<shortcut
id="a4l.LaunchShortcut"
class="eu.emundo.a4l.debugger.launcher.A4LLaunchShortcut"
label="A4L Application"
icon="icons/pill.png"
modes="run, debug">
<description
description="Runs an A4L-Application"
mode="run">
</description>
<description
description="Debugs an A4L-Application"
mode="debug">
</description>
<contextualLaunch>
<enablement>
<with variable="selection">
<count value="1"/>
<iterate>
<or>
<and>
<instanceof value="org.eclipse.core.resources.IFile"/>
<test property="org.eclipse.debug.ui.matchesPattern" value="*.a4l"/>
</and>
<and>
<instanceof value="org.eclipse.core.resources.IProject"/>
<test
property="org.eclipse.jdt.launching.hasProjectNature"
args="eu.emundo.a4l.wizard.A4LProjectNature"/>
</and>
</or>
</iterate>
</with>
</enablement>
</contextualLaunch>
<configurationType
id="a4l.launchConfigDelegate">
</configurationType>
</shortcut>
</extension>

The problem is that <test property="org.eclipse.jdt.launching.hasProjectNature" args="eu.emundo.a4l.wizard.A4LProjectNature"/> seems to be ignored. No LaunchShortcut is available if I click on a project with the defined nature although the NATURE_ID is still in the .project file.

If delete the hasNature test the LaunchShortcut is available because I select an instance of IProject.

Does anybody know why the hasNature test doesn't work?

I would appreciate any help...

Best regards
Alex
Previous Topic:Error while switching the workspace
Next Topic:IProject instanceof MyProject
Goto Forum:
  


Current Time: Wed Sep 17 03:37:53 GMT 2014

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

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