Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchMode.java15
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.java2
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.properties1
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchMode.java11
-rw-r--r--org.eclipse.debug.core/plugin.properties3
-rw-r--r--org.eclipse.debug.core/plugin.xml3
-rw-r--r--org.eclipse.debug.core/schema/launchModes.exsd10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAsAction.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java7
11 files changed, 51 insertions, 10 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchMode.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchMode.java
index 5ddc8ed58..00360a23f 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchMode.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchMode.java
@@ -47,4 +47,19 @@ public interface ILaunchMode {
* @return a human readable label for this launch mode
*/
public String getLabel();
+
+ /**
+ * Returns a human readable label for this launch mode when used in a
+ * cascade menu. For example, "Run As". Allows the label to be
+ * properly localized.
+ * <p>
+ * A new attribute has been added the the launch mode extension in 3.2
+ * to specify this label. When unspecified a default label is generated
+ * by concatenation, for backwards compatibility.
+ * </p>
+ * @return human readable label for this launch mode when used in a
+ * cascade menu
+ * @since 3.2
+ */
+ public String getLaunchAsLabel();
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.java
index 03c568dec..138aca100 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.java
@@ -110,4 +110,6 @@ public class DebugCoreMessages extends NLS {
}
public static String LaunchConfiguration_10;
+
+ public static String LaunchMode_0;
} \ No newline at end of file
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.properties b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.properties
index 9c16cf864..47480802a 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.properties
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.properties
@@ -77,6 +77,7 @@ LaunchManager_An_exception_occurred_during_launch_configuration_change_notificat
LaunchManager_30=Unable to retrieve shared launch configuration file for {0}
LaunchMode_1=Required attribute {0} missing for launchMode extension.
+LaunchMode_0={0} As
LogicalStructureType_7=Required attribute {0} missing for logicalStructureType extension.
LogicalStructureType_0=<Missing Description>
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchMode.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchMode.java
index 741afd8c2..b5038ce63 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchMode.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchMode.java
@@ -72,4 +72,15 @@ public class LaunchMode implements ILaunchMode {
public String getLabel() {
return fConfigurationElement.getAttribute("label"); //$NON-NLS-1$;
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.ILaunchMode#getLaunchAsLabel()
+ */
+ public String getLaunchAsLabel() {
+ String label = fConfigurationElement.getAttribute("launchAsLabel"); //$NON-NLS-1$
+ if (label == null) {
+ return MessageFormat.format(DebugCoreMessages.LaunchMode_0, new String[]{getLabel()});
+ }
+ return label;
+ }
}
diff --git a/org.eclipse.debug.core/plugin.properties b/org.eclipse.debug.core/plugin.properties
index 617aa08eb..cf51929a1 100644
--- a/org.eclipse.debug.core/plugin.properties
+++ b/org.eclipse.debug.core/plugin.properties
@@ -32,6 +32,9 @@ sourcePathComputersName = Source Path Computers
run=&Run
debug=&Debug
profile=&Profile
+runAs.label=&Run As
+debugAs.label=&Debug As
+profileAs.label=&Profile As
env_var.description=Returns the value of an environment variable. An environment variable name must be specified as an argument.
system_var.description=Returns the value of an Eclipse system variable. A variable name must be specified as an argument - one of ARCH, ECLIPSE_HOME, NL, OS, or WS.
diff --git a/org.eclipse.debug.core/plugin.xml b/org.eclipse.debug.core/plugin.xml
index 90491c80c..b661755e9 100644
--- a/org.eclipse.debug.core/plugin.xml
+++ b/org.eclipse.debug.core/plugin.xml
@@ -66,14 +66,17 @@
point="org.eclipse.debug.core.launchModes">
<launchMode
label="%run"
+ launchAsLabel="%runAs.label"
mode="run">
</launchMode>
<launchMode
label="%debug"
+ launchAsLabel="%debugAs.label"
mode="debug">
</launchMode>
<launchMode
label="%profile"
+ launchAsLabel="%profileAs.label"
mode="profile">
</launchMode>
</extension>
diff --git a/org.eclipse.debug.core/schema/launchModes.exsd b/org.eclipse.debug.core/schema/launchModes.exsd
index aa3628eaa..a14503655 100644
--- a/org.eclipse.debug.core/schema/launchModes.exsd
+++ b/org.eclipse.debug.core/schema/launchModes.exsd
@@ -65,6 +65,16 @@
</appInfo>
</annotation>
</attribute>
+ <attribute name="launchAsLabel" type="string">
+ <annotation>
+ <documentation>
+ A human-readable label to be used in a launch cascade menu. For example &quot;Run As&quot;. This attribute was added in 3.2 to allow the label to be properly externalized. When unspecified, a default label is created via concatenation.
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
</complexType>
</element>
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.java
index f3cede0db..20d2fcd0a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.java
@@ -132,10 +132,8 @@ public class ActionMessages extends NLS {
public static String RetargetAction_2;
public static String RetargetAction_3;
- public static String LaunchAsAction_0;
public static String ModifyWatchpointAction_0;
public static String ModifyWatchpointAction_1;
- public static String LaunchShortcutsAction_0;
public static String LaunchShortcutsAction_1;
public static String FindDialog_1;
public static String FindDialog_3;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties
index 4543fd032..27ae1816e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties
@@ -132,10 +132,8 @@ RunToLineActionDelegate_4=Run to &Line
RetargetAction_2=Error
RetargetAction_3=Operation failed
-LaunchAsAction_0={0} As
ModifyWatchpointAction_0=Error
ModifyWatchpointAction_1=Failed to modify watchpoint
-LaunchShortcutsAction_0={0} As
LaunchShortcutsAction_1=(none applicable)
FindDialog_1=&Specify an element to select (? = any character, * = any String):
FindDialog_3=Find
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAsAction.java
index e50a2db99..f1aeb5768 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAsAction.java
@@ -11,13 +11,12 @@
package org.eclipse.debug.ui.actions;
-import java.text.MessageFormat;
import java.util.Iterator;
import java.util.List;
+
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchMode;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
import org.eclipse.debug.internal.ui.actions.LaunchShortcutAction;
import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
import org.eclipse.debug.internal.ui.launchConfigurations.LaunchGroupExtension;
@@ -77,7 +76,7 @@ public class LaunchAsAction extends Action implements IMenuCreator, IWorkbenchWi
super();
fLaunchGroupIdentifier = launchGroupIdentifier;
ILaunchMode launchMode = DebugPlugin.getDefault().getLaunchManager().getLaunchMode(getMode());
- setText(MessageFormat.format(ActionMessages.LaunchAsAction_0, new String[]{launchMode.getLabel()}));
+ setText(launchMode.getLaunchAsLabel());
setMenuCreator(this);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java
index e74838d4c..a29b7da4e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java
@@ -11,18 +11,19 @@
package org.eclipse.debug.ui.actions;
-import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
+
import org.eclipse.core.expressions.EvaluationContext;
import org.eclipse.core.expressions.Expression;
import org.eclipse.core.expressions.IEvaluationContext;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchMode;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.actions.ActionMessages;
import org.eclipse.debug.internal.ui.actions.LaunchShortcutAction;
@@ -86,8 +87,8 @@ public class LaunchShortcutsAction extends Action implements IMenuCreator, IWork
public LaunchShortcutsAction(String launchGroupIdentifier) {
super();
fGroup = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(launchGroupIdentifier);
- String label = DebugPlugin.getDefault().getLaunchManager().getLaunchMode(fGroup.getMode()).getLabel();
- setText(MessageFormat.format(ActionMessages.LaunchShortcutsAction_0, new String[] { label }));
+ ILaunchMode mode = DebugPlugin.getDefault().getLaunchManager().getLaunchMode(fGroup.getMode());
+ setText(mode.getLaunchAsLabel());
setMenuCreator(this);
setEnabled(existsConfigTypesForMode());
}

Back to the top