Bug 165855
Launch Shortcuts shows deprecated example.
diff --git a/org.eclipse.debug.ui/schema/launchShortcuts.exsd b/org.eclipse.debug.ui/schema/launchShortcuts.exsd
index 1fbe771..42193a2 100644
--- a/org.eclipse.debug.ui/schema/launchShortcuts.exsd
+++ b/org.eclipse.debug.ui/schema/launchShortcuts.exsd
@@ -196,26 +196,44 @@
<meta.section type="examples"/>
</appInfo>
<documentation>
- The following is an example of a launch shortcut extension point:
+ The following is an example of the Java Application launch shortcut contribution with an enablement expression:
<p>
<pre>
<extension point="org.eclipse.debug.ui.launchShortcuts">
<shortcut
- id="com.example.ExampleLaunchShortcutId"
- modes="run,debug"
- class="com.example.ExampleLaunchShortcutImpl"
- label="Example Launch Shortcut"
- icon="icons/examples.gif">
- <perspective id="org.eclipse.jdt.ui.JavaPerspective"/>
- <perspective id="org.eclipse.debug.ui.DebugPerspective"/>
- </shortcut>
- </extension>
+ label="Java Application"
+ icon="$nl$/icons/full/etool16/java_app.gif"
+ helpContextId="org.eclipse.jdt.debug.ui.shortcut_local_java_application"
+ modes="run, debug"
+ class="org.eclipse.jdt.internal.debug.ui.launcher.JavaApplicationLaunchShortcut"
+ id="org.eclipse.jdt.debug.ui.localJavaShortcut">
+ <contextualLaunch>
+ <enablement>
+ <with variable="selection">
+ <count value="1"/>
+ <iterate>
+ <or>
+ <test property="org.eclipse.jdt.launching.hasMain"/>
+ <and>
+ <test property="org.eclipse.jdt.launching.isContainer"/>
+ <test property="org.eclipse.jdt.launching.hasProjectNature" args="org.eclipse.jdt.core.javanature"/>
+ </and>
+ </or>
+ </iterate>
+ </with>
+ </enablement>
+ </contextualLaunch>
+</shortcut>
</pre>
</p>
-
+<p>
In the above example, a launch shortcut will be shown in the run and debug cascade menus with the label
-"Example Launch Shortcut", in the JavaPerspective and the DebugPerspective.
+"Java Application". Furthermore, the shortcut will only appear if the selected item has a main method in it, or it is a Java project.
+</p>
+<p>
+For more information on property testers see <code>org.eclipse.core.expressions.PropertyTester</code>
+</p>
</documentation>
</annotation>
@@ -255,7 +273,7 @@
<meta.section type="copyright"/>
</appInfo>
<documentation>
-Copyright (c) 2000, 2005 IBM Corporation and others.<br>
+ Copyright (c) 2000, 2005 IBM Corporation and others.<br>
All rights reserved. This program and the accompanying materials are made
available under the terms of the Eclipse Public License v1.0 which
accompanies this distribution, and is available at