Skip to content

Commit

Permalink
Replace usage of internal SWT TypedListener in CheckTableCombo
Browse files Browse the repository at this point in the history
Leverage new methods introduced in
eclipse-platform/eclipse.platform.swt#1112
  • Loading branch information
HannesWell committed Nov 24, 2024
1 parent 31f40e4 commit 2cfc2f9
Showing 1 changed file with 3 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,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 +311,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 +383,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 2cfc2f9

Please sign in to comment.