diff options
author | Lars Vogel | 2017-02-14 09:32:51 +0000 |
---|---|---|
committer | Leo Ufimtsev | 2017-07-28 21:10:50 +0000 |
commit | 2727c0c300cefda65f4e3ebfe86674dcc1e639d6 (patch) | |
tree | e3ccc6ebec9ed5d5b73b936ac82d066fb617d847 /bundles/org.eclipse.swt | |
parent | 814a6c07cc4fc11b999a980062bc71bd2d35b5e4 (diff) | |
download | eclipse.platform.swt-2727c0c300cefda65f4e3ebfe86674dcc1e639d6.tar.gz eclipse.platform.swt-2727c0c300cefda65f4e3ebfe86674dcc1e639d6.tar.xz eclipse.platform.swt-2727c0c300cefda65f4e3ebfe86674dcc1e639d6.zip |
Bug 512159 - [CTabFolder] Several getter methods in CTabFolder do not
use checkWidget()
Not sure why these methods do not use checkWidget. The last commit
message for Silenio is: "restore HEAD after accidental deletion by error
in automated build script" which is not very informative.
Leo:
While reviewing, I found a bunch of other places that had checkWidget()
commented out.
The original commit that added them has an empty log message
and is not linked to bugzilla:
6a87ceb8219d8d816e8c34a66f6f56af4e43ead7
Author: Veronika Irvine <veronika>
Date: Fri Feb 15 13:55:04 2002 +0000
*** empty log message ***
I can only presume that it might have been done so that fields
can be accessed on the same thread without having to get the UI
thread for convienience. But for sake of consistency, we should
have these checks in all public methods.
Change-Id: I719fb7edf56fd6bface0eaf1b501856af0996b74
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
Signed-off-by: Leo Ufimtsev <lufimtse@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.swt')
6 files changed, 23 insertions, 23 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 daabafb454..b5839cb6b8 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 @@ -191,7 +191,7 @@ char _findMnemonic (String string) { * @return SWT.LEFT, SWT.RIGHT or SWT.CENTER */ public int getAlignment() { - //checkWidget(); + checkWidget(); return align; } /** @@ -202,7 +202,7 @@ public int getAlignment() { * @since 3.6 */ public int getBottomMargin() { - //checkWidget(); + checkWidget(); return bottomMargin; } /** @@ -211,7 +211,7 @@ public int getBottomMargin() { * @return the image of the label or null */ public Image getImage() { - //checkWidget(); + checkWidget(); return image; } /** @@ -222,7 +222,7 @@ public Image getImage() { * @since 3.6 */ public int getLeftMargin() { - //checkWidget(); + checkWidget(); return leftMargin; } /** @@ -233,7 +233,7 @@ public int getLeftMargin() { * @since 3.6 */ public int getRightMargin() { - //checkWidget(); + checkWidget(); return rightMargin; } /** @@ -278,7 +278,7 @@ public int getStyle () { * @return the text of the label or null */ public String getText() { - //checkWidget(); + checkWidget(); return text; } @Override @@ -294,7 +294,7 @@ public String getToolTipText () { * @since 3.6 */ public int getTopMargin() { - //checkWidget(); + checkWidget(); return topMargin; } private void initAccessible() { 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 ecffcf52b8..bd847d312e 100644 --- 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 @@ -910,7 +910,7 @@ public Rectangle getClientArea() { * </ul> */ public CTabItem getItem (int index) { - //checkWidget(); + checkWidget(); if (index < 0 || index >= items.length) SWT.error(SWT.ERROR_INVALID_RANGE); return items [index]; @@ -927,7 +927,7 @@ public CTabItem getItem (int index) { * </ul> */ public CTabItem getItem (Point pt) { - //checkWidget(); + checkWidget(); if (items.length == 0) return null; runUpdate(); Point size = getSize(); @@ -951,7 +951,7 @@ public CTabItem getItem (Point pt) { * </ul> */ public int getItemCount(){ - //checkWidget(); + checkWidget(); return items.length; } /** @@ -965,7 +965,7 @@ public int getItemCount(){ * </ul> */ public CTabItem [] getItems() { - //checkWidget(); + checkWidget(); CTabItem[] tabItems = new CTabItem [items.length]; System.arraycopy(items, 0, tabItems, 0, items.length); return tabItems; @@ -1171,7 +1171,7 @@ int getRightItemEdge (GC gc){ * </ul> */ public CTabItem getSelection() { - //checkWidget(); + checkWidget(); if (selectedIndex == -1) return null; return items[selectedIndex]; } @@ -1219,7 +1219,7 @@ public Color getSelectionForeground() { * </ul> */ public int getSelectionIndex() { - //checkWidget(); + checkWidget(); return selectedIndex; } /** diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem.java index 0c2b5b6e20..4485878ee7 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem.java @@ -145,7 +145,7 @@ public void dispose() { * </ul> */ public Rectangle getBounds () { - //checkWidget(); + checkWidget(); parent.runUpdate(); return new Rectangle(x, y, width, height); } @@ -208,7 +208,7 @@ public Font getFont() { * </ul> */ public CTabFolder getParent () { - //checkWidget(); + checkWidget(); return parent; } /** diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/SashForm.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/SashForm.java index 8c2741263a..8ced0a81a0 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/SashForm.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/SashForm.java @@ -112,7 +112,7 @@ Sash createSash() { */ @Override public int getOrientation() { - //checkWidget(); + checkWidget(); return (sashStyle & SWT.VERTICAL) != 0 ? SWT.HORIZONTAL : SWT.VERTICAL; } /** @@ -146,7 +146,7 @@ public int getStyle() { * @return the control that currently is maximized or null */ public Control getMaximizedControl(){ - //checkWidget(); + checkWidget(); return this.maxControl; } /** diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ScrolledComposite.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ScrolledComposite.java index e984826810..64f9216af8 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ScrolledComposite.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ScrolledComposite.java @@ -209,7 +209,7 @@ boolean contains(Control control) { * @return the Always Show Scrollbars flag value */ public boolean getAlwaysShowScrollBars() { - //checkWidget(); + checkWidget(); return alwaysShowScroll; } @@ -289,7 +289,7 @@ public int getMinHeight() { * @return the control displayed in the content area */ public Control getContent() { - //checkWidget(); + checkWidget(); return content; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ViewForm.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ViewForm.java index 3cd10b832f..7e5f559f70 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ViewForm.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ViewForm.java @@ -211,7 +211,7 @@ public Rectangle getClientArea() { * @return the control in the content area of the pane or null */ public Control getContent() { - //checkWidget(); + checkWidget(); return content; } /** @@ -221,7 +221,7 @@ public Control getContent() { * @return the control in the top center of the pane or null */ public Control getTopCenter() { - //checkWidget(); + checkWidget(); return topCenter; } /** @@ -231,7 +231,7 @@ public Control getTopCenter() { * @return the control in the top left corner of the pane or null */ public Control getTopLeft() { - //checkWidget(); + checkWidget(); return topLeft; } /** @@ -241,7 +241,7 @@ public Control getTopLeft() { * @return the control in the top right corner of the pane or null */ public Control getTopRight() { - //checkWidget(); + checkWidget(); return topRight; } void onDispose(Event event) { |