diff options
author | Markus Keller | 2012-11-18 23:32:21 +0000 |
---|---|---|
committer | Markus Keller | 2012-11-18 23:32:21 +0000 |
commit | 4ce0574544d66873714640c59e2c69b9afdbbd70 (patch) | |
tree | f4046b84d14bc32fdb0c035f163627c2ac16f880 /bundles/org.eclipse.jface | |
parent | ce3295b60639f9ecb0ca82b5f86071af938c9c28 (diff) | |
download | eclipse.platform.ui-4ce0574544d66873714640c59e2c69b9afdbbd70.tar.gz eclipse.platform.ui-4ce0574544d66873714640c59e2c69b9afdbbd70.tar.xz eclipse.platform.ui-4ce0574544d66873714640c59e2c69b9afdbbd70.zip |
Bug 394206: Undo labels are truncated at '@'v20121118-233221I20121120-0800
Diffstat (limited to 'bundles/org.eclipse.jface')
3 files changed, 19 insertions, 26 deletions
diff --git a/bundles/org.eclipse.jface/src/org/eclipse/jface/action/Action.java b/bundles/org.eclipse.jface/src/org/eclipse/jface/action/Action.java index 5be541b1cd6..9a378d614e0 100644 --- a/bundles/org.eclipse.jface/src/org/eclipse/jface/action/Action.java +++ b/bundles/org.eclipse.jface/src/org/eclipse/jface/action/Action.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2012 IBM Corporation and others. * 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 @@ -164,7 +164,8 @@ public abstract class Action extends AbstractAction implements IAction { /** * Convenience method for removing any optional accelerator text from the * given string. The accelerator text appears at the end of the text, and is - * separated from the main part by a single tab character <code>'\t'</code>. + * separated from the main part by the last tab character <code>'\t'</code> + * (or the last <code>'@'</code> if there is no tab). * * @param text * the text @@ -636,22 +637,8 @@ public abstract class Action extends AbstractAction implements IAction { } } - /** - * Sets the text for this action. - * <p> - * Fires a property change event for the <code>TEXT</code> property if the - * text actually changes as a consequence. - * </p> - * <p> - * The accelerator is identified by the last index of a tab character. If - * there are no tab characters, then it is identified by the last index of a - * '@' character. If neither, then there is no accelerator text. Note that - * if you want to insert a '@' character into the text (but no accelerator, - * you can simply insert a '@' or a tab at the end of the text. - * </p> - * - * @param text - * the text, or <code>null</code> if none + /* (non-Javadoc) + * @see org.eclipse.jface.action.IAction#setText(java.lang.String) */ public void setText(String text) { String oldText = this.text; diff --git a/bundles/org.eclipse.jface/src/org/eclipse/jface/action/IAction.java b/bundles/org.eclipse.jface/src/org/eclipse/jface/action/IAction.java index 91cbb21bcae..d48a75c0054 100644 --- a/bundles/org.eclipse.jface/src/org/eclipse/jface/action/IAction.java +++ b/bundles/org.eclipse.jface/src/org/eclipse/jface/action/IAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2012 IBM Corporation and others. * 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 @@ -472,8 +472,13 @@ public interface IAction { /** * Sets the text for this action. * <p> - * An accelerator specification may follow the actual text, separated from it by - * an '@' or a '\t' character. An accelerator specification consists of zero or more + * An accelerator is identified by the last index of a '\t' character. If + * there are no '\t' characters, then it is identified by the last index of an + * '@' character. If neither, then there is no accelerator text. Note that + * if you want to insert an '@' character into the text (but no accelerator), + * then you can simply insert an '@' or a '\t' at the end of the text. + * <br> + * An accelerator specification consists of zero or more * modifier tokens followed by a key code token. The tokens are separated by a '+' character. * </p> * <p> diff --git a/bundles/org.eclipse.jface/src/org/eclipse/jface/action/LegacyActionTools.java b/bundles/org.eclipse.jface/src/org/eclipse/jface/action/LegacyActionTools.java index 0650a599c62..ff78c443781 100644 --- a/bundles/org.eclipse.jface/src/org/eclipse/jface/action/LegacyActionTools.java +++ b/bundles/org.eclipse.jface/src/org/eclipse/jface/action/LegacyActionTools.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2012 IBM Corporation and others. * 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 @@ -15,10 +15,9 @@ import java.util.HashMap; import java.util.Map; import java.util.StringTokenizer; -import org.eclipse.swt.SWT; - import org.eclipse.jface.resource.JFaceResources; import org.eclipse.jface.util.Util; +import org.eclipse.swt.SWT; /** * <p> @@ -183,7 +182,8 @@ public final class LegacyActionTools { /** * Extracts the accelerator text from the given text. Returns * <code>null</code> if there is no accelerator text, and the empty string - * if there is no text after the accelerator delimeter (tab or '@'). + * if there is no text after the accelerator delimiter (last tab or + * last '@' if there's no tab). * * @param text * the text for the action; may be <code>null</code>. @@ -705,7 +705,8 @@ public final class LegacyActionTools { /** * Convenience method for removing any optional accelerator text from the * given string. The accelerator text appears at the end of the text, and is - * separated from the main part by a single tab character <code>'\t'</code>. + * separated from the main part by the last tab character <code>'\t'</code> + * (or the last <code>'@'</code> if there is no tab). * * @param text * the text |