summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Gayed <grant_gayed@ca.ibm.com>2012-10-11 14:24:58 -0400
committerGrant Gayed <grant_gayed@ca.ibm.com>2012-10-11 14:27:01 -0400
commitd2a1d09a2450fdd75ca84606740151070c252a5a (patch)
treef67b3b34b90e2049db0469f4f4bc90975596bffb
parent8796d59928d217bc37660078155636c76aa5bd39 (diff)
downloadeclipse.platform.swt-d2a1d09a2450fdd75ca84606740151070c252a5a.tar.gz
eclipse.platform.swt-d2a1d09a2450fdd75ca84606740151070c252a5a.tar.xz
eclipse.platform.swt-d2a1d09a2450fdd75ca84606740151070c252a5a.zip
Bug 391675 - CLabel documentation says class is not intended to be
subclassed, then recommends subclassing
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CLabel.java13
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Canvas.java1
2 files changed, 3 insertions, 11 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CLabel.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CLabel.java
index b45797e02b..65e63b75df 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CLabel.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CLabel.java
@@ -36,12 +36,13 @@ import org.eclipse.swt.accessibility.*;
* </dl>
*
* </p><p>
- * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * This class may be subclassed for the purpose of overriding the default string
+ * shortening algorithm that is implemented in method <code>shortenText()</code>.
* </p>
*
* @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: CustomControlExample</a>
* @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
- * @noextend This class is not intended to be subclassed by clients.
+ * @see CLabel#shortenText(GC, String, int)
*/
public class CLabel extends Canvas {
@@ -148,14 +149,6 @@ private static int checkStyle (int style) {
return style |= SWT.NO_FOCUS | SWT.DOUBLE_BUFFERED;
}
-//protected void checkSubclass () {
-// String name = getClass().getName ();
-// String validName = CLabel.class.getName();
-// if (!validName.equals(name)) {
-// SWT.error (SWT.ERROR_INVALID_SUBCLASS);
-// }
-//}
-
public Point computeSize(int wHint, int hHint, boolean changed) {
checkWidget();
Point e = getTotalSize(image, text);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Canvas.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Canvas.java
index 5391eaccbd..11a746c92a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Canvas.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Canvas.java
@@ -72,7 +72,6 @@ Canvas () {
* </ul>
*
* @see SWT
- * @see Widget#checkSubclass
* @see Widget#getStyle
*/
public Canvas (Composite parent, int style) {