Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCurtis Windatt2007-05-16 21:32:17 +0000
committerCurtis Windatt2007-05-16 21:32:17 +0000
commite92848ca31df18c73c68bba3e65a91eda16b5b84 (patch)
tree9c62abbd8d9bc9dc69a662156c96e23057311cca /org.eclipse.debug.ui
parent7a9f02a3ae3e0ea30fe894d69a3790698b6012e6 (diff)
downloadeclipse.platform.debug-e92848ca31df18c73c68bba3e65a91eda16b5b84.tar.gz
eclipse.platform.debug-e92848ca31df18c73c68bba3e65a91eda16b5b84.tar.xz
eclipse.platform.debug-e92848ca31df18c73c68bba3e65a91eda16b5b84.zip
Bug 186921 - TVT33:TCT170: zh_TW:the mnemonic should be either removed or placed in the end
Diffstat (limited to 'org.eclipse.debug.ui')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java30
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/OpenLaunchDialogAction.java3
2 files changed, 32 insertions, 1 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
index bcca91378..20d7138a3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
@@ -1165,6 +1165,36 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener {
}
return title;
}
+
+ /**
+ * Returns the label with any DBCS accelerator moved to the end of the string.
+ * See bug 186921.
+ *
+ * @return label with moved accelerator
+ */
+ public static String adjustDBCSAccelerator(String label) {
+ String title = label;
+ if (title != null) {
+ // strip out any '&' (accelerators)
+ int index = title.indexOf('&');
+ if (index > 0) {
+ //DBCS languages use "(&X)" format
+ if (title.charAt(index - 1) == '(' && title.length() >= index + 3 && title.charAt(index + 2) == ')') {
+ String first = title.substring(0, index - 1);
+ String accel = title.substring(index - 1, index + 3);
+ String last = title.substring(index + 3);
+ title = first + last;
+ if (title.endsWith("...")) { //$NON-NLS-1$
+ title = title.substring(0, title.length() - 3);
+ title = title + accel + "..."; //$NON-NLS-1$
+ } else {
+ title = title + accel;
+ }
+ }
+ }
+ }
+ return title;
+ }
/**
* Returns the image descriptor registry used for this plug-in.
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/OpenLaunchDialogAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/OpenLaunchDialogAction.java
index d2d4e1677..3d5a201db 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/OpenLaunchDialogAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/OpenLaunchDialogAction.java
@@ -61,7 +61,8 @@ public class OpenLaunchDialogAction extends Action implements IActionDelegate2,
if(group != null) {
setImageDescriptor(group.getImageDescriptor());
String lbl = group.getLabel();
- setText(MessageFormat.format(ActionMessages.OpenLaunchDialogAction_1, new String[] {lbl}));
+ String actionLabel = MessageFormat.format(ActionMessages.OpenLaunchDialogAction_1, new String[] {lbl});
+ setText(DebugUIPlugin.adjustDBCSAccelerator(actionLabel));
}
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.OPEN_LAUNCH_CONFIGURATION_ACTION);
}

Back to the top