From 213eccd03a1bc58275822f96bd6f284e21422c4f Mon Sep 17 00:00:00 2001 From: Hannes Wellmann Date: Sun, 24 Nov 2024 15:42:19 +0100 Subject: [PATCH] Replace usage of internal SWT TypedListener in CheckTableCombo Leverage new methods introduced in https://github.com/eclipse-platform/eclipse.platform.swt/pull/1112 --- .../checktablecombo/CheckTableCombo.java | 24 +++---------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/widgets/tablecombo/org.eclipse.nebula.widgets.tablecombo/src/org/eclipse/nebula/widgets/checktablecombo/CheckTableCombo.java b/widgets/tablecombo/org.eclipse.nebula.widgets.tablecombo/src/org/eclipse/nebula/widgets/checktablecombo/CheckTableCombo.java index b1fa02619..8cbc6c5bc 100644 --- a/widgets/tablecombo/org.eclipse.nebula.widgets.tablecombo/src/org/eclipse/nebula/widgets/checktablecombo/CheckTableCombo.java +++ b/widgets/tablecombo/org.eclipse.nebula.widgets.tablecombo/src/org/eclipse/nebula/widgets/checktablecombo/CheckTableCombo.java @@ -54,7 +54,6 @@ import org.eclipse.swt.widgets.TableColumn; import org.eclipse.swt.widgets.TableItem; import org.eclipse.swt.widgets.Text; -import org.eclipse.swt.widgets.TypedListener; import org.eclipse.swt.widgets.Widget; /** @@ -283,12 +282,7 @@ private static int checkStyle(int style) { * @see #removeModifyListener */ public void addModifyListener(final ModifyListener listener) { - checkWidget(); - if (listener == null) { - SWT.error(SWT.ERROR_NULL_ARGUMENT); - } - final TypedListener typedListener = new TypedListener(listener); - addListener(SWT.Modify, typedListener); + addTypedListener(listener, SWT.Modify); } /** @@ -316,14 +310,7 @@ public void addModifyListener(final ModifyListener listener) { * @see SelectionEvent */ public void addSelectionListener(final SelectionListener listener) { - checkWidget(); - if (listener == null) { - SWT.error(SWT.ERROR_NULL_ARGUMENT); - } - - final TypedListener typedListener = new TypedListener(listener); - addListener(SWT.Selection, typedListener); - addListener(SWT.DefaultSelection, typedListener); + addTypedListener(listener, SWT.Selection, SWT.DefaultSelection); } /** @@ -395,12 +382,7 @@ public void removeTextControlKeyListener(final KeyListener listener) { * @since 3.3 */ public void addVerifyListener(final VerifyListener listener) { - checkWidget(); - if (listener == null) { - SWT.error(SWT.ERROR_NULL_ARGUMENT); - } - final TypedListener typedListener = new TypedListener(listener); - addListener(SWT.Verify, typedListener); + addTypedListener(listener, SWT.Verify); } /**