From d2a1d09a2450fdd75ca84606740151070c252a5a Mon Sep 17 00:00:00 2001
From: Grant Gayed
Date: Thu, 11 Oct 2012 14:24:58 -0400
Subject: Bug 391675 - CLabel documentation says class is not intended to be
subclassed, then recommends subclassing
---
.../common/org/eclipse/swt/custom/CLabel.java | 13 +++----------
.../Eclipse SWT/win32/org/eclipse/swt/widgets/Canvas.java | 1 -
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.*;
*
*
*
- * IMPORTANT: This class is not intended to be subclassed.
+ * This class may be subclassed for the purpose of overriding the default string
+ * shortening algorithm that is implemented in method shortenText()
.
*
*
* @see SWT Example: CustomControlExample
* @see Sample code and further information
- * @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 () {
*
*
* @see SWT
- * @see Widget#checkSubclass
* @see Widget#getStyle
*/
public Canvas (Composite parent, int style) {
--
cgit