diff options
author | Duong Nguyen <dnguyen> | 2008-07-09 20:41:10 +0000 |
---|---|---|
committer | Duong Nguyen <dnguyen> | 2008-07-09 20:41:10 +0000 |
commit | 1f4e6bd3a245cad1d789eff2863f9df96242bd16 (patch) | |
tree | 9110ef975ddcbf5e2f532e2cef25dfe9d1756624 | |
parent | f623b20304bf986ad8c8182adb23b1a49fe94d52 (diff) | |
download | eclipse.platform.swt-1f4e6bd3a245cad1d789eff2863f9df96242bd16.tar.gz eclipse.platform.swt-1f4e6bd3a245cad1d789eff2863f9df96242bd16.tar.xz eclipse.platform.swt-1f4e6bd3a245cad1d789eff2863f9df96242bd16.zip |
Bug 235968 - CCombo class should not be final
3 files changed, 27 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CBanner.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CBanner.java index 90ae8039dc..c281190e07 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CBanner.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CBanner.java @@ -151,6 +151,15 @@ static int[] bezier(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int static int checkStyle (int style) { return SWT.NONE; } +// We should have checkSubclass() but adding it now will cause existing +// subclasses to break. +//protected void checkSubclass () { +// String name = getClass ().getName (); +// int index = name.lastIndexOf ('.'); +// if (!name.substring (0, index + 1).equals ("org.eclipse.swt.custom.")) { +// SWT.error (SWT.ERROR_INVALID_SUBCLASS); +// } +//} /** * Returns the Control that appears on the bottom side of the banner. * diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java index 92f6198aa3..6f9cdbce31 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java @@ -47,6 +47,8 @@ import org.eclipse.swt.accessibility.*; */ public class CCombo extends Composite { + static final String PACKAGE_PREFIX = "org.eclipse.swt.custom."; //$NON-NLS-1$ + Text text; List list; int visibleItemCount = 5; @@ -319,6 +321,13 @@ void arrowEvent (Event event) { } } } +protected void checkSubclass () { + String name = getClass ().getName (); + int index = name.lastIndexOf ('.'); + if (!name.substring (0, index + 1).equals (PACKAGE_PREFIX)) { + SWT.error (SWT.ERROR_INVALID_SUBCLASS); + } +} /** * Sets the selection in the receiver's text field to an empty * selection starting just before the first character. If the diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java index f2ba5c79dc..4c0227ebc0 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java @@ -545,6 +545,15 @@ void antialias (int[] shape, RGB lineRGB, RGB innerRGB, RGB outerRGB, GC gc){ color.dispose(); } } +//We should have checkSubclass() but adding it now will cause existing +//subclasses to break. +//protected void checkSubclass () { +// String name = getClass ().getName (); +// int index = name.lastIndexOf ('.'); +// if (!name.substring (0, index + 1).equals ("org.eclipse.swt.custom.")) { +// SWT.error (SWT.ERROR_INVALID_SUBCLASS); +// } +//} public Rectangle computeTrim (int x, int y, int width, int height) { checkWidget(); int trimX = x - marginWidth - highlight_margin - borderLeft; |