Skip to content

Commit

Permalink
Replace usage of internal SWT TypedListener in CheckTableCombo
Browse files Browse the repository at this point in the history
Replace usage of internal SWT TypedListener in CheckTableCombo #613
  • Loading branch information
wimjongman authored Nov 26, 2024
2 parents 31f40e4 + 213eccd commit e7e99ba
Showing 1 changed file with 3 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit e7e99ba

Please sign in to comment.