| Summary: | Run->Run asks for "Run on server" for simple java projects | ||
|---|---|---|---|
| Product: | [WebTools] WTP ServerTools | Reporter: | arne anka <eclipse-bugs> |
| Component: | wst.server | Assignee: | wst.server <wst.server-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | Angel Vera <arvera> |
| Severity: | normal | ||
| Priority: | P3 | CC: | eclipse.dserodio, markus.kell.r, Michael_Rennie, tor.norbye |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
|
Description
arne anka
WST team, please have a look at your contribution to the org.eclipse.debug.ui.launchShortcuts extension point.
org.eclipse.jdt.junit is in a similar situation, and we solved it using the following enablement expression:
<contextualLaunch>
<enablement>
<with variable="selection">
<count value="1"/>
<iterate>
<adapt type="org.eclipse.jdt.core.IJavaElement">
<test property="org.eclipse.jdt.core.isInJavaProject"/>
<test property="org.eclipse.jdt.core.hasTypeOnClasspath" value="junit.framework.Test"/>
<test property="org.eclipse.jdt.junit.canLaunchAsJUnit" forcePluginActivation="true"/>
</adapt>
</iterate>
</with>
</enablement>
</contextualLaunch>
The custom property "canLaunchAsJUnit" forces plug-in activation, that's why we only test it at the end.
I opened bug 34351 with an alternate approach to preventing the launch shortcut appearing everywhere. You could use the newly available variable from platform debug from bug 338576: <enablement> <with variable="selection"> <count value="1"/> <iterate> <and> <test property="org.eclipse.wst.server.ui.isRunnable" value="true"/> <with variable="org.eclipse.core.runtime.Platform"> <test args="org.eclipse.wst.server.ui" property="org.eclipse.core.runtime.bundleState" value="ACTIVE"> </test> </with> </and> </iterate> </with> </enablement> I meant bug 343751 Bug 343751 talks about pretty much the same problem |