diff --git a/releng/org.eclipse.nebula.nebula-parent/pom.xml b/releng/org.eclipse.nebula.nebula-parent/pom.xml
index 09f50993f..61fb36263 100644
--- a/releng/org.eclipse.nebula.nebula-parent/pom.xml
+++ b/releng/org.eclipse.nebula.nebula-parent/pom.xml
@@ -272,6 +272,11 @@ Contributors:
Text
, a
@@ -201,11 +200,7 @@ static int checkStyle(int style) {
* @see #removeModifyListener
*/
public void addModifyListener(ModifyListener listener) {
- checkWidget();
- if (listener == null)
- SWT.error(SWT.ERROR_NULL_ARGUMENT);
- TypedListener typedListener = new TypedListener(listener);
- addListener(SWT.Modify, typedListener);
+ addTypedListener(listener, SWT.Modify);
}
/**
@@ -233,12 +228,7 @@ public void addModifyListener(ModifyListener listener) {
* @see SelectionEvent
*/
public void addSelectionListener(SelectionListener listener) {
- checkWidget();
- if (listener == null)
- SWT.error(SWT.ERROR_NULL_ARGUMENT);
- TypedListener typedListener = new TypedListener(listener);
- addListener(SWT.Selection, typedListener);
- addListener(SWT.DefaultSelection, typedListener);
+ addTypedListener(listener, SWT.Selection, SWT.DefaultSelection);
}
/**
@@ -261,11 +251,7 @@ public void addSelectionListener(SelectionListener listener) {
* @see #removeVerifyListener
*/
public void addVerifyListener(VerifyListener listener) {
- checkWidget();
- if (listener == null)
- SWT.error(SWT.ERROR_NULL_ARGUMENT);
- TypedListener typedListener = new TypedListener(listener);
- addListener(SWT.Verify, typedListener);
+ addTypedListener(listener, SWT.Verify);
}
/**
@@ -832,10 +818,7 @@ public void redraw(int x, int y, int width, int height, boolean all) {
* @see #addModifyListener
*/
public void removeModifyListener(ModifyListener listener) {
- checkWidget();
- if (listener == null)
- SWT.error(SWT.ERROR_NULL_ARGUMENT);
- removeListener(SWT.Modify, listener);
+ removeTypedListener(SWT.Modify, listener);
}
/**
@@ -856,11 +839,8 @@ public void removeModifyListener(ModifyListener listener) {
* @see #addSelectionListener
*/
public void removeSelectionListener(SelectionListener listener) {
- checkWidget();
- if (listener == null)
- SWT.error(SWT.ERROR_NULL_ARGUMENT);
- removeListener(SWT.Selection, listener);
- removeListener(SWT.DefaultSelection, listener);
+ removeTypedListener(SWT.Selection, listener);
+ removeTypedListener(SWT.DefaultSelection, listener);
}
/**
@@ -881,10 +861,7 @@ public void removeSelectionListener(SelectionListener listener) {
* @see #addVerifyListener
*/
public void removeVerifyListener(VerifyListener listener) {
- checkWidget();
- if (listener == null)
- SWT.error(SWT.ERROR_NULL_ARGUMENT);
- removeListener(SWT.Verify, listener);
+ removeTypedListener(SWT.Verify, listener);
}
/**
diff --git a/widgets/datechooser/org.eclipse.nebula.widgets.datechooser/src/org/eclipse/nebula/widgets/datechooser/DateChooser.java b/widgets/datechooser/org.eclipse.nebula.widgets.datechooser/src/org/eclipse/nebula/widgets/datechooser/DateChooser.java
index 0ba897950..3e4d564f9 100644
--- a/widgets/datechooser/org.eclipse.nebula.widgets.datechooser/src/org/eclipse/nebula/widgets/datechooser/DateChooser.java
+++ b/widgets/datechooser/org.eclipse.nebula.widgets.datechooser/src/org/eclipse/nebula/widgets/datechooser/DateChooser.java
@@ -47,7 +47,6 @@
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.swt.widgets.TypedListener;
/**
* Calendar widget. Presents the monthly view of a calendar for date picking.
@@ -356,12 +355,7 @@ public DateChooser(Composite parent, int style) {
* @see #removeSelectionListener
*/
public void addSelectionListener(SelectionListener lsnr) {
- checkWidget();
- if (lsnr == null) {
- SWT.error(SWT.ERROR_NULL_ARGUMENT);
- }
- final TypedListener typedListener = new TypedListener(lsnr);
- addListener(SWT.Selection, typedListener);
+ addTypedListener(lsnr, SWT.Selection);
}
/**
@@ -1106,11 +1100,7 @@ private void removeSelectedDate(Date d, boolean refresh) {
* @see #addSelectionListener
*/
public void removeSelectionListener(SelectionListener lsnr) {
- checkWidget();
- if (lsnr == null) {
- SWT.error(SWT.ERROR_NULL_ARGUMENT);
- }
- removeListener(SWT.Selection, lsnr);
+ removeTypedListener(SWT.Selection, lsnr);
}
/**
diff --git a/widgets/gallery/org.eclipse.nebula.widgets.gallery/META-INF/MANIFEST.MF b/widgets/gallery/org.eclipse.nebula.widgets.gallery/META-INF/MANIFEST.MF
index 6aa9e7e13..ed2cb5ec4 100644
--- a/widgets/gallery/org.eclipse.nebula.widgets.gallery/META-INF/MANIFEST.MF
+++ b/widgets/gallery/org.eclipse.nebula.widgets.gallery/META-INF/MANIFEST.MF
@@ -4,7 +4,7 @@ Bundle-Name: Nebula Gallery Widget
Bundle-SymbolicName: org.eclipse.nebula.widgets.gallery
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-11
-Require-Bundle: org.eclipse.swt,
+Require-Bundle: org.eclipse.swt;bundle-version="[3.126.0,4.0.0)",
org.eclipse.jface;resolution:=optional
Export-Package: org.eclipse.nebula.animation,
org.eclipse.nebula.animation.effects,
diff --git a/widgets/gallery/org.eclipse.nebula.widgets.gallery/src/org/eclipse/nebula/widgets/gallery/Gallery.java b/widgets/gallery/org.eclipse.nebula.widgets.gallery/src/org/eclipse/nebula/widgets/gallery/Gallery.java
index f0a04cea7..146b9d7b6 100644
--- a/widgets/gallery/org.eclipse.nebula.widgets.gallery/src/org/eclipse/nebula/widgets/gallery/Gallery.java
+++ b/widgets/gallery/org.eclipse.nebula.widgets.gallery/src/org/eclipse/nebula/widgets/gallery/Gallery.java
@@ -33,7 +33,6 @@
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Item;
import org.eclipse.swt.widgets.ScrollBar;
-import org.eclipse.swt.widgets.TypedListener;
/**
*
@@ -309,13 +308,7 @@ public void setItemRenderer(AbstractGalleryItemRenderer itemRenderer) { * @see SelectionEvent */ public void addSelectionListener(SelectionListener listener) { - checkWidget(); - if (listener == null) - SWT.error(SWT.ERROR_NULL_ARGUMENT); - - TypedListener typedListener = new TypedListener(listener); - addListener(SWT.Selection, typedListener); - addListener(SWT.DefaultSelection, typedListener); + addTypedListener(listener, SWT.Selection, SWT.DefaultSelection); } /** @@ -341,9 +334,8 @@ public void addSelectionListener(SelectionListener listener) { * @see #addSelectionListener(SelectionListener) */ public void removeSelectionListener(SelectionListener listener) { - checkWidget(); - removeListener(SWT.Selection, listener); - removeListener(SWT.DefaultSelection, listener); + removeTypedListener(SWT.Selection, listener); + removeTypedListener(SWT.DefaultSelection, listener); } /** @@ -353,8 +345,7 @@ public void removeSelectionListener(SelectionListener listener) { * @param listener */ public void removeTreeListener(SelectionListener listener) { - checkWidget(); - removeListener(SWT.Expand, listener); + removeTypedListener(SWT.Expand, listener); } /** @@ -365,10 +356,7 @@ public void removeTreeListener(SelectionListener listener) { * @param listener */ public void addTreeListener(TreeListener listener) { - checkWidget(); - if (listener == null) - SWT.error(SWT.ERROR_NULL_ARGUMENT); - addListener(SWT.Expand, new TypedListener(listener)); + addTypedListener(listener, SWT.Expand); } /** diff --git a/widgets/grid/org.eclipse.nebula.widgets.grid/META-INF/MANIFEST.MF b/widgets/grid/org.eclipse.nebula.widgets.grid/META-INF/MANIFEST.MF index abbc835d1..d9a68439b 100644 --- a/widgets/grid/org.eclipse.nebula.widgets.grid/META-INF/MANIFEST.MF +++ b/widgets/grid/org.eclipse.nebula.widgets.grid/META-INF/MANIFEST.MF @@ -4,7 +4,7 @@ Bundle-Name: Nebula Grid Bundle-SymbolicName: org.eclipse.nebula.widgets.grid Bundle-Version: 1.1.1.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-11 -Require-Bundle: org.eclipse.swt, +Require-Bundle: org.eclipse.swt;bundle-version="[3.126.0,4.0.0)", org.eclipse.jface;resolution:=optional Export-Package: org.eclipse.nebula.jface.gridviewer, org.eclipse.nebula.jface.gridviewer.internal;x-internal:=true, diff --git a/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/Grid.java b/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/Grid.java index 3eda62d86..b4d302ec2 100644 --- a/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/Grid.java +++ b/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/Grid.java @@ -82,7 +82,6 @@ import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.ScrollBar; -import org.eclipse.swt.widgets.TypedListener; /** * The Grid widget is a spreadsheet/table component that offers features not @@ -956,12 +955,7 @@ public void setCellHeaderSelectionBackground(final Color cellSelectionBackground * */ public void addSelectionListener(final SelectionListener listener) { - checkWidget(); - if (listener == null) { - SWT.error(SWT.ERROR_NULL_ARGUMENT); - } - addListener(SWT.Selection, new TypedListener(listener)); - addListener(SWT.DefaultSelection, new TypedListener(listener)); + addTypedListener(listener, SWT.Selection, SWT.DefaultSelection); } /** @@ -987,13 +981,7 @@ public void addSelectionListener(final SelectionListener listener) { * @see org.eclipse.swt.events.TreeEvent */ public void addTreeListener(final TreeListener listener) { - checkWidget(); - if (listener == null) { - SWT.error(SWT.ERROR_NULL_ARGUMENT); - } - - addListener(SWT.Expand, new TypedListener(listener)); - addListener(SWT.Collapse, new TypedListener(listener)); + addTypedListener(listener, SWT.Expand, SWT.Collapse); } /** @@ -3273,9 +3261,8 @@ public void disposeAllItems() { * */ public void removeSelectionListener(final SelectionListener listener) { - checkWidget(); - removeListener(SWT.Selection, listener); - removeListener(SWT.DefaultSelection, listener); + removeTypedListener(SWT.Selection, listener); + removeTypedListener(SWT.DefaultSelection, listener); } /** @@ -3295,9 +3282,8 @@ public void removeSelectionListener(final SelectionListener listener) { * */ public void removeTreeListener(final TreeListener listener) { - checkWidget(); - removeListener(SWT.Expand, listener); - removeListener(SWT.Collapse, listener); + removeTypedListener(SWT.Expand, listener); + removeTypedListener(SWT.Collapse, listener); } /** diff --git a/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/GridColumn.java b/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/GridColumn.java index 868128312..bd0149e5b 100644 --- a/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/GridColumn.java +++ b/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/GridColumn.java @@ -37,7 +37,6 @@ import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Item; -import org.eclipse.swt.widgets.TypedListener; /** *
@@ -501,11 +500,7 @@ public int getSort() { * */ public void addSelectionListener(SelectionListener listener) { - checkWidget(); - if (listener == null) { - SWT.error(SWT.ERROR_NULL_ARGUMENT); - } - this.addListener(SWT.Selection, new TypedListener(listener)); + addTypedListener(listener, SWT.Selection); } /** @@ -525,8 +520,7 @@ public void addSelectionListener(SelectionListener listener) { * */ public void removeSelectionListener(SelectionListener listener) { - checkWidget(); - this.removeListener(SWT.Selection, listener); + removeTypedListener(SWT.Selection, listener); } /** @@ -813,13 +807,7 @@ public void setFooterRenderer(GridFooterRenderer footerRenderer) { * */ public void addControlListener(ControlListener listener) { - checkWidget(); - if (listener == null) { - SWT.error(SWT.ERROR_NULL_ARGUMENT); - } - TypedListener typedListener = new TypedListener(listener); - addListener(SWT.Resize, typedListener); - addListener(SWT.Move, typedListener); + addTypedListener(listener, SWT.Resize, SWT.Move); } /** @@ -840,12 +828,8 @@ public void addControlListener(ControlListener listener) { * */ public void removeControlListener(ControlListener listener) { - checkWidget(); - if (listener == null) { - SWT.error(SWT.ERROR_NULL_ARGUMENT); - } - removeListener(SWT.Resize, listener); - removeListener(SWT.Move, listener); + removeTypedListener(SWT.Resize, listener); + removeTypedListener(SWT.Move, listener); } /** diff --git a/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/GridColumnGroup.java b/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/GridColumnGroup.java index 3866f1c83..0cc1a31c4 100644 --- a/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/GridColumnGroup.java +++ b/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/GridColumnGroup.java @@ -25,7 +25,6 @@ import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.widgets.Item; -import org.eclipse.swt.widgets.TypedListener; /** *
@@ -122,11 +121,7 @@ private void init(int style) { * @see #removeTreeListener */ public void addTreeListener(TreeListener listener) { - checkWidget (); - if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); - TypedListener typedListener = new TypedListener (listener); - addListener (SWT.Expand, typedListener); - addListener (SWT.Collapse, typedListener); + addTypedListener(listener, SWT.Expand, SWT.Collapse); } /** @@ -147,10 +142,8 @@ public void addTreeListener(TreeListener listener) { * @see #addTreeListener */ public void removeTreeListener(TreeListener listener) { - checkWidget (); - if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); - removeListener (SWT.Expand, listener); - removeListener (SWT.Collapse, listener); + removeTypedListener(SWT.Expand, listener); + removeTypedListener(SWT.Collapse, listener); } /** diff --git a/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/GridItem.java b/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/GridItem.java index af2cea3f6..2ca68db22 100644 --- a/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/GridItem.java +++ b/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/GridItem.java @@ -30,7 +30,6 @@ import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Item; -import org.eclipse.swt.widgets.TypedListener; /** *
@@ -348,11 +347,7 @@ public void dispose() { * */ public void addControlListener(ControlListener listener) { - checkWidget(); - if (listener == null) - SWT.error(SWT.ERROR_NULL_ARGUMENT); - TypedListener typedListener = new TypedListener(listener); - addListener(SWT.Resize, typedListener); + addTypedListener(listener, SWT.Resize); } /** @@ -375,10 +370,7 @@ public void addControlListener(ControlListener listener) { * */ public void removeControlListener(ControlListener listener) { - checkWidget(); - if (listener == null) - SWT.error(SWT.ERROR_NULL_ARGUMENT); - removeListener(SWT.Resize, listener); + removeTypedListener(SWT.Resize, listener); } /** diff --git a/widgets/nebulaslider/org.eclipse.nebula.widgets.nebulaslider/META-INF/MANIFEST.MF b/widgets/nebulaslider/org.eclipse.nebula.widgets.nebulaslider/META-INF/MANIFEST.MF index e7d8a1689..6583e7d0a 100644 --- a/widgets/nebulaslider/org.eclipse.nebula.widgets.nebulaslider/META-INF/MANIFEST.MF +++ b/widgets/nebulaslider/org.eclipse.nebula.widgets.nebulaslider/META-INF/MANIFEST.MF @@ -6,6 +6,6 @@ Bundle-Version: 1.1.0.qualifier Bundle-Vendor: Eclipse Nebula Bundle-RequiredExecutionEnvironment: JavaSE-11 Require-Bundle: org.eclipse.nebula.widgets.opal.commons;bundle-version="1.0.0";visibility:=reexport, - org.eclipse.swt + org.eclipse.swt;bundle-version="[3.126.0,4.0.0)" Export-Package: org.eclipse.nebula.widgets.opal.nebulaslider Automatic-Module-Name: org.eclipse.nebula.widgets.nebulaslider diff --git a/widgets/nebulaslider/org.eclipse.nebula.widgets.nebulaslider/src/org/eclipse/nebula/widgets/opal/nebulaslider/NebulaSlider.java b/widgets/nebulaslider/org.eclipse.nebula.widgets.nebulaslider/src/org/eclipse/nebula/widgets/opal/nebulaslider/NebulaSlider.java index 075cc3c37..60c7c807d 100644 --- a/widgets/nebulaslider/org.eclipse.nebula.widgets.nebulaslider/src/org/eclipse/nebula/widgets/opal/nebulaslider/NebulaSlider.java +++ b/widgets/nebulaslider/org.eclipse.nebula.widgets.nebulaslider/src/org/eclipse/nebula/widgets/opal/nebulaslider/NebulaSlider.java @@ -333,8 +333,7 @@ private void addMouseListeners() { * @see SelectionEvent */ public void addSelectionListener(final SelectionListener listener) { - checkWidget(); - SelectionListenerUtil.addSelectionListener(this, listener); + addTypedListener(listener, SWT.Selection); } /** @@ -367,8 +366,7 @@ public Point computeSize(final int wHint, final int hHint, final boolean changed * @see #addSelectionListener */ public void removeSelectionListener(final SelectionListener listener) { - checkWidget(); - SelectionListenerUtil.removeSelectionListener(this, listener); + removeTypedListener(SWT.Selection, listener); } // ----------------------- Getters & Setters diff --git a/widgets/opal/checkboxgroup/org.eclipse.nebula.widgets.opal.checkboxgroup/META-INF/MANIFEST.MF b/widgets/opal/checkboxgroup/org.eclipse.nebula.widgets.opal.checkboxgroup/META-INF/MANIFEST.MF index d8b820ccc..0907f702f 100644 --- a/widgets/opal/checkboxgroup/org.eclipse.nebula.widgets.opal.checkboxgroup/META-INF/MANIFEST.MF +++ b/widgets/opal/checkboxgroup/org.eclipse.nebula.widgets.opal.checkboxgroup/META-INF/MANIFEST.MF @@ -6,6 +6,6 @@ Bundle-Version: 1.0.0.qualifier Bundle-Vendor: Eclipse Nebula Bundle-RequiredExecutionEnvironment: JavaSE-11 Require-Bundle: org.eclipse.nebula.widgets.opal.commons;bundle-version="1.0.0";visibility:=reexport, - org.eclipse.swt + org.eclipse.swt;bundle-version="[3.126.0,4.0.0)" Export-Package: org.eclipse.nebula.widgets.opal.checkboxgroup Automatic-Module-Name: org.eclipse.nebula.widgets.opal.checkboxgroup diff --git a/widgets/opal/checkboxgroup/org.eclipse.nebula.widgets.opal.checkboxgroup/src/org/eclipse/nebula/widgets/opal/checkboxgroup/CheckBoxGroup.java b/widgets/opal/checkboxgroup/org.eclipse.nebula.widgets.opal.checkboxgroup/src/org/eclipse/nebula/widgets/opal/checkboxgroup/CheckBoxGroup.java index 656b05bcb..db2c7c897 100644 --- a/widgets/opal/checkboxgroup/org.eclipse.nebula.widgets.opal.checkboxgroup/src/org/eclipse/nebula/widgets/opal/checkboxgroup/CheckBoxGroup.java +++ b/widgets/opal/checkboxgroup/org.eclipse.nebula.widgets.opal.checkboxgroup/src/org/eclipse/nebula/widgets/opal/checkboxgroup/CheckBoxGroup.java @@ -157,8 +157,7 @@ public void activate() { * @see SelectionEvent */ public void addSelectionListener(final SelectionListener listener) { - checkWidget(); - SelectionListenerUtil.addSelectionListener(this, listener); + addTypedListener(listener, SWT.Selection); } /** @@ -207,8 +206,7 @@ public Layout getLayout() { * @see #addSelectionListener */ public void removeSelectionListener(final SelectionListener listener) { - checkWidget(); - SelectionListenerUtil.removeSelectionListener(this, listener); + removeTypedListener(SWT.Selection, listener); } diff --git a/widgets/opal/columnbrowser/org.eclipse.nebula.widgets.opal.columnbrowser/META-INF/MANIFEST.MF b/widgets/opal/columnbrowser/org.eclipse.nebula.widgets.opal.columnbrowser/META-INF/MANIFEST.MF index 0c0dd6762..47644b833 100644 --- a/widgets/opal/columnbrowser/org.eclipse.nebula.widgets.opal.columnbrowser/META-INF/MANIFEST.MF +++ b/widgets/opal/columnbrowser/org.eclipse.nebula.widgets.opal.columnbrowser/META-INF/MANIFEST.MF @@ -6,6 +6,6 @@ Bundle-Version: 1.0.0.qualifier Bundle-Vendor: Eclipse Nebula Bundle-RequiredExecutionEnvironment: JavaSE-11 Require-Bundle: org.eclipse.nebula.widgets.opal.commons;bundle-version="1.0.0";visibility:=reexport, - org.eclipse.swt + org.eclipse.swt;bundle-version="[3.126.0,4.0.0)" Export-Package: org.eclipse.nebula.widgets.opal.columnbrowser Automatic-Module-Name: org.eclipse.nebula.widgets.opal.columnbrowser diff --git a/widgets/opal/columnbrowser/org.eclipse.nebula.widgets.opal.columnbrowser/src/org/eclipse/nebula/widgets/opal/columnbrowser/ColumnBrowserWidget.java b/widgets/opal/columnbrowser/org.eclipse.nebula.widgets.opal.columnbrowser/src/org/eclipse/nebula/widgets/opal/columnbrowser/ColumnBrowserWidget.java index 1520ac907..bab19dc6b 100644 --- a/widgets/opal/columnbrowser/org.eclipse.nebula.widgets.opal.columnbrowser/src/org/eclipse/nebula/widgets/opal/columnbrowser/ColumnBrowserWidget.java +++ b/widgets/opal/columnbrowser/org.eclipse.nebula.widgets.opal.columnbrowser/src/org/eclipse/nebula/widgets/opal/columnbrowser/ColumnBrowserWidget.java @@ -325,8 +325,7 @@ void updateContent() { * @see SelectionEvent */ public void addSelectionListener(final SelectionListener listener) { - checkWidget(); - SelectionListenerUtil.addSelectionListener(this, listener); + addTypedListener(listener, SWT.Selection); } /** @@ -405,8 +404,7 @@ public ColumnItem getSelection() { * @see #addSelectionListener */ public void removeSelectionListener(final SelectionListener listener) { - checkWidget(); - SelectionListenerUtil.removeSelectionListener(this, listener); + removeTypedListener(SWT.Selection, listener); } /** diff --git a/widgets/opal/commons/org.eclipse.nebula.widgets.opal.commons/META-INF/MANIFEST.MF b/widgets/opal/commons/org.eclipse.nebula.widgets.opal.commons/META-INF/MANIFEST.MF index 2aa95f613..a1f246a68 100644 --- a/widgets/opal/commons/org.eclipse.nebula.widgets.opal.commons/META-INF/MANIFEST.MF +++ b/widgets/opal/commons/org.eclipse.nebula.widgets.opal.commons/META-INF/MANIFEST.MF @@ -6,7 +6,7 @@ Bundle-Version: 1.0.0.qualifier Bundle-Vendor: Eclipse Nebula Bundle-RequiredExecutionEnvironment: JavaSE-11 Require-Bundle: org.eclipse.equinox.common, - org.eclipse.swt + org.eclipse.swt;bundle-version="[3.126.0,4.0.0)" Export-Package: org.eclipse.nebula.widgets.opal.commons, org.eclipse.nebula.widgets.opal.commons.resources Automatic-Module-Name: org.eclipse.nebula.widgets.opal.commons diff --git a/widgets/opal/commons/org.eclipse.nebula.widgets.opal.commons/src/org/eclipse/nebula/widgets/opal/commons/SelectionListenerUtil.java b/widgets/opal/commons/org.eclipse.nebula.widgets.opal.commons/src/org/eclipse/nebula/widgets/opal/commons/SelectionListenerUtil.java index 7c265f40d..de135c6f1 100644 --- a/widgets/opal/commons/org.eclipse.nebula.widgets.opal.commons/src/org/eclipse/nebula/widgets/opal/commons/SelectionListenerUtil.java +++ b/widgets/opal/commons/org.eclipse.nebula.widgets.opal.commons/src/org/eclipse/nebula/widgets/opal/commons/SelectionListenerUtil.java @@ -18,7 +18,6 @@ import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.TypedListener; public class SelectionListenerUtil { /** @@ -27,11 +26,12 @@ public class SelectionListenerUtil { * @param control control on which the selection listener is added * @param listener listener to add */ + @Deprecated(forRemoval = true) public static void addSelectionListener(final Control control, final SelectionListener listener) { if (listener == null) { SWT.error(SWT.ERROR_NULL_ARGUMENT); } - TypedListener typedListener = new TypedListener(listener); + var typedListener = new org.eclipse.swt.widgets.TypedListener(listener); control.addListener(SWT.Selection, typedListener); } @@ -41,20 +41,13 @@ public static void addSelectionListener(final Control control, final SelectionLi * @param control control on which the selection listener is removed * @param listener listener to remove */ + @Deprecated(forRemoval = true) public static void removeSelectionListener(final Control control, final SelectionListener listener) { if (listener == null) { SWT.error(SWT.ERROR_NULL_ARGUMENT); } - final Listener[] listeners = control.getListeners(SWT.Selection); - for (Listener l : listeners) { - if (l instanceof TypedListener) { - TypedListener typedListener = (TypedListener) l; - if (typedListener.getEventListener() == listener) { - ReflectionUtils.callMethod(control, "removeListener", SWT.Selection, ((TypedListener) l).getEventListener()); - return; - } - } - } + control.getTypedListeners(SWT.Selection, SelectionListener.class) + .forEach(l -> ReflectionUtils.callMethod(control, "removeListener", SWT.Selection, l)); } /** diff --git a/widgets/opal/duallist/org.eclipse.nebula.widgets.opal.duallist/META-INF/MANIFEST.MF b/widgets/opal/duallist/org.eclipse.nebula.widgets.opal.duallist/META-INF/MANIFEST.MF index 289301e55..69e38a131 100644 --- a/widgets/opal/duallist/org.eclipse.nebula.widgets.opal.duallist/META-INF/MANIFEST.MF +++ b/widgets/opal/duallist/org.eclipse.nebula.widgets.opal.duallist/META-INF/MANIFEST.MF @@ -6,6 +6,6 @@ Bundle-Version: 1.0.0.qualifier Bundle-Vendor: Eclipse Nebula Bundle-RequiredExecutionEnvironment: JavaSE-11 Require-Bundle: org.eclipse.nebula.widgets.opal.commons;bundle-version="1.0.0";visibility:=reexport, - org.eclipse.swt + org.eclipse.swt;bundle-version="[3.126.0,4.0.0)" Export-Package: org.eclipse.nebula.widgets.opal.duallist Automatic-Module-Name: org.eclipse.nebula.widgets.opal.duallist diff --git a/widgets/opal/duallist/org.eclipse.nebula.widgets.opal.duallist/src/org/eclipse/nebula/widgets/opal/duallist/DualList.java b/widgets/opal/duallist/org.eclipse.nebula.widgets.opal.duallist/src/org/eclipse/nebula/widgets/opal/duallist/DualList.java index e5ad6e93b..acec95235 100644 --- a/widgets/opal/duallist/org.eclipse.nebula.widgets.opal.duallist/src/org/eclipse/nebula/widgets/opal/duallist/DualList.java +++ b/widgets/opal/duallist/org.eclipse.nebula.widgets.opal.duallist/src/org/eclipse/nebula/widgets/opal/duallist/DualList.java @@ -306,11 +306,7 @@ public void add(final DLItem item, final int index) { * @see SelectionEvent */ public void addSelectionListener(final SelectionListener listener) { - checkWidget(); - if (listener == null) { - SWT.error(SWT.ERROR_NULL_ARGUMENT); - } - SelectionListenerUtil.addSelectionListener(this, listener); + addTypedListener(listener, SWT.Selection); } /** @@ -335,8 +331,7 @@ public void addSelectionListener(final SelectionListener listener) { * @see #addSelectionListener */ public void removeSelectionListener(final SelectionListener listener) { - checkWidget(); - SelectionListenerUtil.removeSelectionListener(this, listener); + removeTypedListener(SWT.Selection, listener); } /** diff --git a/widgets/opal/duallist/org.eclipse.nebula.widgets.opal.duallist/src/org/eclipse/nebula/widgets/opal/duallist/SelectionChangeListener.java b/widgets/opal/duallist/org.eclipse.nebula.widgets.opal.duallist/src/org/eclipse/nebula/widgets/opal/duallist/SelectionChangeListener.java index 2a9da0c3f..c1470c123 100644 --- a/widgets/opal/duallist/org.eclipse.nebula.widgets.opal.duallist/src/org/eclipse/nebula/widgets/opal/duallist/SelectionChangeListener.java +++ b/widgets/opal/duallist/org.eclipse.nebula.widgets.opal.duallist/src/org/eclipse/nebula/widgets/opal/duallist/SelectionChangeListener.java @@ -12,7 +12,7 @@ *******************************************************************************/ package org.eclipse.nebula.widgets.opal.duallist; -import org.eclipse.swt.internal.SWTEventListener; +import java.util.EventListener; /** * Classes which implement this interface provide methods that deal with the @@ -27,9 +27,8 @@ * * @see SelectionChangeEvent */ -@SuppressWarnings("restriction") @FunctionalInterface -public interface SelectionChangeListener extends SWTEventListener { +public interface SelectionChangeListener extends EventListener { /** * Sent when selection occurs in the control. diff --git a/widgets/opal/horizontalspinner/org.eclipse.nebula.widgets.opal.horizontalspinner/META-INF/MANIFEST.MF b/widgets/opal/horizontalspinner/org.eclipse.nebula.widgets.opal.horizontalspinner/META-INF/MANIFEST.MF index da922a1cb..80555298d 100644 --- a/widgets/opal/horizontalspinner/org.eclipse.nebula.widgets.opal.horizontalspinner/META-INF/MANIFEST.MF +++ b/widgets/opal/horizontalspinner/org.eclipse.nebula.widgets.opal.horizontalspinner/META-INF/MANIFEST.MF @@ -6,6 +6,6 @@ Bundle-Version: 1.0.0.qualifier Bundle-Vendor: Eclipse Nebula Bundle-RequiredExecutionEnvironment: JavaSE-11 Require-Bundle: org.eclipse.nebula.widgets.opal.commons;bundle-version="1.0.0";visibility:=reexport, - org.eclipse.swt + org.eclipse.swt;bundle-version="[3.126.0,4.0.0)" Export-Package: org.eclipse.nebula.widgets.opal.horizontalspinner Automatic-Module-Name: org.eclipse.nebula.widgets.opal.horizontalspinner diff --git a/widgets/opal/horizontalspinner/org.eclipse.nebula.widgets.opal.horizontalspinner/src/org/eclipse/nebula/widgets/opal/horizontalspinner/HorizontalSpinner.java b/widgets/opal/horizontalspinner/org.eclipse.nebula.widgets.opal.horizontalspinner/src/org/eclipse/nebula/widgets/opal/horizontalspinner/HorizontalSpinner.java index e69f01d4f..ed8f8bd31 100644 --- a/widgets/opal/horizontalspinner/org.eclipse.nebula.widgets.opal.horizontalspinner/src/org/eclipse/nebula/widgets/opal/horizontalspinner/HorizontalSpinner.java +++ b/widgets/opal/horizontalspinner/org.eclipse.nebula.widgets.opal.horizontalspinner/src/org/eclipse/nebula/widgets/opal/horizontalspinner/HorizontalSpinner.java @@ -363,8 +363,7 @@ public void addModifyListener(final ModifyListener listener) { * @see SelectionEvent */ public void addSelectionListener(final SelectionListener listener) { - checkWidget(); - SelectionListenerUtil.addSelectionListener(this, listener); + addTypedListener(listener, SWT.Selection); } /** @@ -627,8 +626,7 @@ public void removeModifyListener(final ModifyListener listener) { * @see #addSelectionListener */ public void removeSelectionListener(final SelectionListener listener) { - checkWidget(); - SelectionListenerUtil.removeSelectionListener(this, listener); + removeTypedListener(SWT.Selection, listener); } /** diff --git a/widgets/opal/launcher/org.eclipse.nebula.widgets.opal.launcher/META-INF/MANIFEST.MF b/widgets/opal/launcher/org.eclipse.nebula.widgets.opal.launcher/META-INF/MANIFEST.MF index c5ebe0fd1..c5f03eca7 100644 --- a/widgets/opal/launcher/org.eclipse.nebula.widgets.opal.launcher/META-INF/MANIFEST.MF +++ b/widgets/opal/launcher/org.eclipse.nebula.widgets.opal.launcher/META-INF/MANIFEST.MF @@ -6,6 +6,6 @@ Bundle-Version: 1.0.0.qualifier Bundle-Vendor: Eclipse Nebula Bundle-RequiredExecutionEnvironment: JavaSE-11 Require-Bundle: org.eclipse.nebula.widgets.opal.commons;bundle-version="1.0.0";visibility:=reexport, - org.eclipse.swt + org.eclipse.swt;bundle-version="[3.126.0,4.0.0)" Export-Package: org.eclipse.nebula.widgets.opal.launcher Automatic-Module-Name: org.eclipse.nebula.widgets.opal.launcher diff --git a/widgets/opal/launcher/org.eclipse.nebula.widgets.opal.launcher/src/org/eclipse/nebula/widgets/opal/launcher/Launcher.java b/widgets/opal/launcher/org.eclipse.nebula.widgets.opal.launcher/src/org/eclipse/nebula/widgets/opal/launcher/Launcher.java index de9a488c6..bbd57363e 100644 --- a/widgets/opal/launcher/org.eclipse.nebula.widgets.opal.launcher/src/org/eclipse/nebula/widgets/opal/launcher/Launcher.java +++ b/widgets/opal/launcher/org.eclipse.nebula.widgets.opal.launcher/src/org/eclipse/nebula/widgets/opal/launcher/Launcher.java @@ -152,8 +152,7 @@ private void addListenerToLabel(final LauncherLabel label) { * @see SelectionEvent */ public void addSelectionListener(final SelectionListener listener) { - checkWidget(); - SelectionListenerUtil.addSelectionListener(this, listener); + addTypedListener(listener, SWT.Selection); } /** @@ -395,11 +394,7 @@ private void handleKeyPressedEvent(final Event event) { * @see #addSelectionListener */ public void removeSelectionListener(final SelectionListener listener) { - checkWidget(); - if (listener == null) { - SWT.error(SWT.ERROR_NULL_ARGUMENT); - } - SelectionListenerUtil.removeSelectionListener(this, listener); + removeTypedListener(SWT.Selection, listener); } /** diff --git a/widgets/opal/rangeslider/org.eclipse.nebula.widgets.opal.rangeslider/META-INF/MANIFEST.MF b/widgets/opal/rangeslider/org.eclipse.nebula.widgets.opal.rangeslider/META-INF/MANIFEST.MF index 256de7f9d..1f235853f 100644 --- a/widgets/opal/rangeslider/org.eclipse.nebula.widgets.opal.rangeslider/META-INF/MANIFEST.MF +++ b/widgets/opal/rangeslider/org.eclipse.nebula.widgets.opal.rangeslider/META-INF/MANIFEST.MF @@ -6,6 +6,6 @@ Bundle-Version: 1.0.0.qualifier Bundle-Vendor: Eclipse Nebula Bundle-RequiredExecutionEnvironment: JavaSE-11 Require-Bundle: org.eclipse.nebula.widgets.opal.commons;bundle-version="1.0.0";visibility:=reexport, - org.eclipse.swt + org.eclipse.swt;bundle-version="[3.126.0,4.0.0)" Export-Package: org.eclipse.nebula.widgets.opal.rangeslider Automatic-Module-Name: org.eclipse.nebula.widgets.opal.rangeslider diff --git a/widgets/opal/rangeslider/org.eclipse.nebula.widgets.opal.rangeslider/src/org/eclipse/nebula/widgets/opal/rangeslider/RangeSlider.java b/widgets/opal/rangeslider/org.eclipse.nebula.widgets.opal.rangeslider/src/org/eclipse/nebula/widgets/opal/rangeslider/RangeSlider.java index ca857a628..12cce000f 100644 --- a/widgets/opal/rangeslider/org.eclipse.nebula.widgets.opal.rangeslider/src/org/eclipse/nebula/widgets/opal/rangeslider/RangeSlider.java +++ b/widgets/opal/rangeslider/org.eclipse.nebula.widgets.opal.rangeslider/src/org/eclipse/nebula/widgets/opal/rangeslider/RangeSlider.java @@ -1126,8 +1126,7 @@ private void translateValues(int amount) { * @see #removeSelectionListener */ public void addSelectionListener(final SelectionListener listener) { - checkWidget(); - SelectionListenerUtil.addSelectionListener(this, listener); + addTypedListener(listener, SWT.Selection); } /** @@ -1320,8 +1319,7 @@ public int getUpperValue() { * @see #addSelectionListener */ public void removeSelectionListener(final SelectionListener listener) { - checkWidget(); - SelectionListenerUtil.removeSelectionListener(this, listener); + removeTypedListener(SWT.Selection, listener); } /** diff --git a/widgets/opal/starrating/org.eclipse.nebula.widgets.opal.starrating/META-INF/MANIFEST.MF b/widgets/opal/starrating/org.eclipse.nebula.widgets.opal.starrating/META-INF/MANIFEST.MF index 18faca184..a5207cbdb 100644 --- a/widgets/opal/starrating/org.eclipse.nebula.widgets.opal.starrating/META-INF/MANIFEST.MF +++ b/widgets/opal/starrating/org.eclipse.nebula.widgets.opal.starrating/META-INF/MANIFEST.MF @@ -6,6 +6,6 @@ Bundle-Version: 1.0.0.qualifier Bundle-Vendor: Eclipse Nebula Bundle-RequiredExecutionEnvironment: JavaSE-11 Require-Bundle: org.eclipse.nebula.widgets.opal.commons;bundle-version="1.0.0";visibility:=reexport, - org.eclipse.swt + org.eclipse.swt;bundle-version="[3.126.0,4.0.0)" Export-Package: org.eclipse.nebula.widgets.opal.starrating Automatic-Module-Name: org.eclipse.nebula.widgets.opal.starrating diff --git a/widgets/opal/starrating/org.eclipse.nebula.widgets.opal.starrating/src/org/eclipse/nebula/widgets/opal/starrating/StarRating.java b/widgets/opal/starrating/org.eclipse.nebula.widgets.opal.starrating/src/org/eclipse/nebula/widgets/opal/starrating/StarRating.java index 4f7665f77..f896dae76 100644 --- a/widgets/opal/starrating/org.eclipse.nebula.widgets.opal.starrating/src/org/eclipse/nebula/widgets/opal/starrating/StarRating.java +++ b/widgets/opal/starrating/org.eclipse.nebula.widgets.opal.starrating/src/org/eclipse/nebula/widgets/opal/starrating/StarRating.java @@ -222,8 +222,7 @@ private void onDispose(final Event event) { * @see SelectionEvent */ public void addSelectionListener(final SelectionListener listener) { - checkWidget(); - SelectionListenerUtil.addSelectionListener(this, listener); + addTypedListener(listener, SWT.Selection); } /** @@ -323,8 +322,7 @@ public SIZE getSizeOfStars() { * @see #addSelectionListener */ public void removeSelectionListener(final SelectionListener listener) { - checkWidget(); - SelectionListenerUtil.removeSelectionListener(this, listener); + removeTypedListener(SWT.Selection, listener); } /** diff --git a/widgets/opal/switchbutton/org.eclipse.nebula.widgets.opal.switchbutton/META-INF/MANIFEST.MF b/widgets/opal/switchbutton/org.eclipse.nebula.widgets.opal.switchbutton/META-INF/MANIFEST.MF index 2e0870d12..a821daec8 100644 --- a/widgets/opal/switchbutton/org.eclipse.nebula.widgets.opal.switchbutton/META-INF/MANIFEST.MF +++ b/widgets/opal/switchbutton/org.eclipse.nebula.widgets.opal.switchbutton/META-INF/MANIFEST.MF @@ -6,6 +6,6 @@ Bundle-Version: 1.0.0.qualifier Bundle-Vendor: Eclipse Nebula Bundle-RequiredExecutionEnvironment: JavaSE-11 Require-Bundle: org.eclipse.nebula.widgets.opal.commons;bundle-version="1.0.0";visibility:=reexport, - org.eclipse.swt + org.eclipse.swt;bundle-version="[3.126.0,4.0.0)" Export-Package: org.eclipse.nebula.widgets.opal.switchbutton Automatic-Module-Name: org.eclipse.nebula.widgets.opal.switchbutton diff --git a/widgets/opal/switchbutton/org.eclipse.nebula.widgets.opal.switchbutton/src/org/eclipse/nebula/widgets/opal/switchbutton/SwitchButton.java b/widgets/opal/switchbutton/org.eclipse.nebula.widgets.opal.switchbutton/src/org/eclipse/nebula/widgets/opal/switchbutton/SwitchButton.java index bb3aab7d0..be25265e1 100644 --- a/widgets/opal/switchbutton/org.eclipse.nebula.widgets.opal.switchbutton/src/org/eclipse/nebula/widgets/opal/switchbutton/SwitchButton.java +++ b/widgets/opal/switchbutton/org.eclipse.nebula.widgets.opal.switchbutton/src/org/eclipse/nebula/widgets/opal/switchbutton/SwitchButton.java @@ -403,8 +403,7 @@ private void drawBorder() { * @see SelectionEvent */ public void addSelectionListener(final SelectionListener listener) { - checkWidget(); - SelectionListenerUtil.addSelectionListener(this, listener); + addTypedListener(listener, SWT.Selection); } /** @@ -429,8 +428,7 @@ public void addSelectionListener(final SelectionListener listener) { * @see #addSelectionListener */ public void removeSelectionListener(final SelectionListener listener) { - checkWidget(); - SelectionListenerUtil.removeSelectionListener(this, listener); + removeTypedListener(SWT.Selection, listener); } /** diff --git a/widgets/pgroup/org.eclipse.nebula.widgets.pgroup/META-INF/MANIFEST.MF b/widgets/pgroup/org.eclipse.nebula.widgets.pgroup/META-INF/MANIFEST.MF index 71344fb5a..11456f1cf 100644 --- a/widgets/pgroup/org.eclipse.nebula.widgets.pgroup/META-INF/MANIFEST.MF +++ b/widgets/pgroup/org.eclipse.nebula.widgets.pgroup/META-INF/MANIFEST.MF @@ -4,7 +4,7 @@ Bundle-Name: Nebula PGroup Bundle-SymbolicName: org.eclipse.nebula.widgets.pgroup Bundle-Version: 1.0.0.qualifier Bundle-Vendor: Eclipse Nebula -Require-Bundle: org.eclipse.swt +Require-Bundle: org.eclipse.swt;bundle-version="[3.126.0,4.0.0)" Export-Package: org.eclipse.nebula.widgets.pgroup, org.eclipse.nebula.widgets.pgroup.internal;x-internal:=true Bundle-RequiredExecutionEnvironment: JavaSE-11 diff --git a/widgets/pgroup/org.eclipse.nebula.widgets.pgroup/src/org/eclipse/nebula/widgets/pgroup/PGroup.java b/widgets/pgroup/org.eclipse.nebula.widgets.pgroup/src/org/eclipse/nebula/widgets/pgroup/PGroup.java index b4fcda2e4..4690b0d1c 100644 --- a/widgets/pgroup/org.eclipse.nebula.widgets.pgroup/src/org/eclipse/nebula/widgets/pgroup/PGroup.java +++ b/widgets/pgroup/org.eclipse.nebula.widgets.pgroup/src/org/eclipse/nebula/widgets/pgroup/PGroup.java @@ -37,7 +37,6 @@ import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.TypedListener; import org.eclipse.swt.widgets.Widget; /** @@ -692,13 +691,7 @@ private void onDispose() */ public void addExpandListener(ExpandListener listener) { - checkWidget(); - if (listener == null) - SWT.error(SWT.ERROR_NULL_ARGUMENT); - - TypedListener typedListener = new TypedListener(listener); - addListener(SWT.Expand, typedListener); - addListener(SWT.Collapse, typedListener); + addTypedListener(listener, SWT.Expand, SWT.Collapse); } /** @@ -720,12 +713,8 @@ public void addExpandListener(ExpandListener listener) */ public void removeExpandListener(ExpandListener listener) { - checkWidget(); - if (listener == null) - SWT.error(SWT.ERROR_NULL_ARGUMENT); - - removeListener(SWT.Expand, listener); - removeListener(SWT.Collapse, listener); + removeTypedListener(SWT.Expand, listener); + removeTypedListener(SWT.Collapse, listener); } /** diff --git a/widgets/pgroup/org.eclipse.nebula.widgets.pgroup/src/org/eclipse/nebula/widgets/pgroup/PGroupToolItem.java b/widgets/pgroup/org.eclipse.nebula.widgets.pgroup/src/org/eclipse/nebula/widgets/pgroup/PGroupToolItem.java index 3becfde58..46e2bff91 100644 --- a/widgets/pgroup/org.eclipse.nebula.widgets.pgroup/src/org/eclipse/nebula/widgets/pgroup/PGroupToolItem.java +++ b/widgets/pgroup/org.eclipse.nebula.widgets.pgroup/src/org/eclipse/nebula/widgets/pgroup/PGroupToolItem.java @@ -18,7 +18,6 @@ import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Item; -import org.eclipse.swt.widgets.TypedListener; /** * Instances of this class represent a selectable user interface object that @@ -76,14 +75,12 @@ public boolean getSelection() { } public void addSelectionListener(SelectionListener listener) { - TypedListener typedListener = new TypedListener(listener); - addListener(SWT.Selection, typedListener); - addListener(SWT.DefaultSelection, typedListener); + addTypedListener(listener, SWT.Selection, SWT.DefaultSelection); } public void removeSelectionListener(SelectionListener listener) { - removeListener(SWT.Selection, listener); - removeListener(SWT.DefaultSelection, listener); + removeTypedListener(SWT.Selection, listener); + removeTypedListener(SWT.DefaultSelection, listener); } void setDropDownArea(Rectangle dropdownArea) { diff --git a/widgets/pshelf/org.eclipse.nebula.widgets.pshelf/META-INF/MANIFEST.MF b/widgets/pshelf/org.eclipse.nebula.widgets.pshelf/META-INF/MANIFEST.MF index e308ef1db..7665a1bca 100644 --- a/widgets/pshelf/org.eclipse.nebula.widgets.pshelf/META-INF/MANIFEST.MF +++ b/widgets/pshelf/org.eclipse.nebula.widgets.pshelf/META-INF/MANIFEST.MF @@ -4,7 +4,7 @@ Bundle-Name: Nebula PShelf Bundle-SymbolicName: org.eclipse.nebula.widgets.pshelf Bundle-Version: 1.1.0.qualifier Bundle-Vendor: Eclipse Nebula -Require-Bundle: org.eclipse.swt, +Require-Bundle: org.eclipse.swt;bundle-version="[3.126.0,4.0.0)", org.eclipse.jface, org.eclipse.core.runtime, org.eclipse.nebula.widgets.opal.commons diff --git a/widgets/pshelf/org.eclipse.nebula.widgets.pshelf/src/org/eclipse/nebula/widgets/pshelf/PShelf.java b/widgets/pshelf/org.eclipse.nebula.widgets.pshelf/src/org/eclipse/nebula/widgets/pshelf/PShelf.java index d9ce8278e..8d3bd00d9 100644 --- a/widgets/pshelf/org.eclipse.nebula.widgets.pshelf/src/org/eclipse/nebula/widgets/pshelf/PShelf.java +++ b/widgets/pshelf/org.eclipse.nebula.widgets.pshelf/src/org/eclipse/nebula/widgets/pshelf/PShelf.java @@ -25,7 +25,6 @@ import org.eclipse.swt.widgets.Canvas; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.TypedListener; /** *
@@ -594,11 +593,7 @@ public PShelfItem[] getItems() * @see SelectionEvent */ public void addSelectionListener(SelectionListener listener) { - checkWidget (); - if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); - TypedListener typedListener = new TypedListener(listener); - addListener(SWT.Selection,typedListener); - addListener(SWT.DefaultSelection,typedListener); + addTypedListener(listener, SWT.Selection, SWT.DefaultSelection); } /** @@ -619,11 +614,8 @@ public void addSelectionListener(SelectionListener listener) { * @see #addSelectionListener */ public void removeSelectionListener (SelectionListener listener) { - checkWidget (); - if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); - - removeListener(SWT.Selection, listener); - removeListener(SWT.DefaultSelection,listener); + removeTypedListener(SWT.Selection, listener); + removeTypedListener(SWT.DefaultSelection,listener); } /** diff --git a/widgets/radiogroup/org.eclipse.nebula.widgets.radiogroup/META-INF/MANIFEST.MF b/widgets/radiogroup/org.eclipse.nebula.widgets.radiogroup/META-INF/MANIFEST.MF index 6ac9c0d0b..1f6bc9590 100644 --- a/widgets/radiogroup/org.eclipse.nebula.widgets.radiogroup/META-INF/MANIFEST.MF +++ b/widgets/radiogroup/org.eclipse.nebula.widgets.radiogroup/META-INF/MANIFEST.MF @@ -6,7 +6,7 @@ Bundle-Version: 0.1.0.qualifier Bundle-Vendor: Eclipse Nebula Bundle-RequiredExecutionEnvironment: JavaSE-11 Require-Bundle: org.eclipse.equinox.common, - org.eclipse.swt, + org.eclipse.swt;bundle-version="[3.126.0,4.0.0)", org.eclipse.jface, org.eclipse.core.databinding;bundle-version="1.2.0", org.eclipse.core.databinding.property;bundle-version="1.2.0", diff --git a/widgets/radiogroup/org.eclipse.nebula.widgets.radiogroup/src/org/eclipse/nebula/widgets/radiogroup/RadioGroup.java b/widgets/radiogroup/org.eclipse.nebula.widgets.radiogroup/src/org/eclipse/nebula/widgets/radiogroup/RadioGroup.java index d884d46a9..3ccd4232e 100644 --- a/widgets/radiogroup/org.eclipse.nebula.widgets.radiogroup/src/org/eclipse/nebula/widgets/radiogroup/RadioGroup.java +++ b/widgets/radiogroup/org.eclipse.nebula.widgets.radiogroup/src/org/eclipse/nebula/widgets/radiogroup/RadioGroup.java @@ -26,7 +26,6 @@ import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Item; import org.eclipse.swt.widgets.Layout; -import org.eclipse.swt.widgets.TypedListener; import org.eclipse.swt.widgets.Widget; /** @@ -199,13 +198,7 @@ void addItem(RadioItem item, int position) { * @see SelectionEvent */ public void addSelectionListener(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); } private int checkAddPosition(int position) { @@ -573,9 +566,8 @@ void removeItem(RadioItem item) { * @see #addSelectionListener */ public void removeSelectionListener(SelectionListener listener) { - checkWidget(); - removeListener(SWT.Selection, listener); - removeListener(SWT.DefaultSelection, listener); + removeTypedListener(SWT.Selection, listener); + removeTypedListener(SWT.DefaultSelection, listener); } /** diff --git a/widgets/roundedcheckbox/org.eclipse.nebula.widgets.roundedcheckbox/META-INF/MANIFEST.MF b/widgets/roundedcheckbox/org.eclipse.nebula.widgets.roundedcheckbox/META-INF/MANIFEST.MF index f0df0e648..6bf18325a 100644 --- a/widgets/roundedcheckbox/org.eclipse.nebula.widgets.roundedcheckbox/META-INF/MANIFEST.MF +++ b/widgets/roundedcheckbox/org.eclipse.nebula.widgets.roundedcheckbox/META-INF/MANIFEST.MF @@ -6,6 +6,6 @@ Bundle-Version: 1.0.0.qualifier Bundle-Vendor: Eclipse Nebula Bundle-RequiredExecutionEnvironment: JavaSE-11 Require-Bundle: org.eclipse.nebula.widgets.opal.commons;bundle-version="1.0.0";visibility:=reexport, - org.eclipse.swt + org.eclipse.swt;bundle-version="[3.126.0,4.0.0)" Export-Package: org.eclipse.nebula.widgets.roundedcheckbox Automatic-Module-Name: org.eclipse.nebula.widgets.roundedcheckbox diff --git a/widgets/roundedcheckbox/org.eclipse.nebula.widgets.roundedcheckbox/src/org/eclipse/nebula/widgets/roundedcheckbox/RoundedCheckbox.java b/widgets/roundedcheckbox/org.eclipse.nebula.widgets.roundedcheckbox/src/org/eclipse/nebula/widgets/roundedcheckbox/RoundedCheckbox.java index a90769fe0..65d2da3a7 100644 --- a/widgets/roundedcheckbox/org.eclipse.nebula.widgets.roundedcheckbox/src/org/eclipse/nebula/widgets/roundedcheckbox/RoundedCheckbox.java +++ b/widgets/roundedcheckbox/org.eclipse.nebula.widgets.roundedcheckbox/src/org/eclipse/nebula/widgets/roundedcheckbox/RoundedCheckbox.java @@ -240,8 +240,7 @@ private Color getAndDisposeColor(int r, int g, int b) { * @see SelectionEvent */ public void addSelectionListener(final SelectionListener listener) { - checkWidget(); - SelectionListenerUtil.addSelectionListener(this, listener); + addTypedListener(listener, SWT.Selection); } /** @@ -391,8 +390,7 @@ public Color getUnselectedColor() { * @see #addSelectionListener */ public void removeSelectionListener(final SelectionListener listener) { - checkWidget(); - SelectionListenerUtil.removeSelectionListener(this, listener); + removeTypedListener(SWT.Selection, listener); } /** diff --git a/widgets/roundedswitch/org.eclipse.nebula.widgets.roundedswitch/META-INF/MANIFEST.MF b/widgets/roundedswitch/org.eclipse.nebula.widgets.roundedswitch/META-INF/MANIFEST.MF index 99a0bc60e..7c52b854b 100644 --- a/widgets/roundedswitch/org.eclipse.nebula.widgets.roundedswitch/META-INF/MANIFEST.MF +++ b/widgets/roundedswitch/org.eclipse.nebula.widgets.roundedswitch/META-INF/MANIFEST.MF @@ -7,5 +7,5 @@ Bundle-Vendor: Eclipse Nebula Bundle-RequiredExecutionEnvironment: JavaSE-11 Export-Package: org.eclipse.nebula.widgets.roundedswitch Require-Bundle: org.eclipse.nebula.widgets.opal.commons;visibility:=reexport, - org.eclipse.swt + org.eclipse.swt;bundle-version="[3.126.0,4.0.0)" Automatic-Module-Name: org.eclipse.nebula.widgets.roundedswitch diff --git a/widgets/roundedswitch/org.eclipse.nebula.widgets.roundedswitch/src/org/eclipse/nebula/widgets/roundedswitch/RoundedSwitch.java b/widgets/roundedswitch/org.eclipse.nebula.widgets.roundedswitch/src/org/eclipse/nebula/widgets/roundedswitch/RoundedSwitch.java index 2b98aedfd..240248b80 100644 --- a/widgets/roundedswitch/org.eclipse.nebula.widgets.roundedswitch/src/org/eclipse/nebula/widgets/roundedswitch/RoundedSwitch.java +++ b/widgets/roundedswitch/org.eclipse.nebula.widgets.roundedswitch/src/org/eclipse/nebula/widgets/roundedswitch/RoundedSwitch.java @@ -253,8 +253,7 @@ private void onKeyPress(Event e) { * @see SelectionEvent */ public void addSelectionListener(final SelectionListener listener) { - checkWidget(); - SelectionListenerUtil.addSelectionListener(this, listener); + addTypedListener(listener, SWT.Selection); } /** @@ -321,8 +320,7 @@ public boolean getSelection() { * @see #addSelectionListener */ public void removeSelectionListener(final SelectionListener listener) { - checkWidget(); - SelectionListenerUtil.removeSelectionListener(this, listener); + removeTypedListener(SWT.Selection, listener); } /** diff --git a/widgets/tablecombo/org.eclipse.nebula.widgets.tablecombo/META-INF/MANIFEST.MF b/widgets/tablecombo/org.eclipse.nebula.widgets.tablecombo/META-INF/MANIFEST.MF index c3d704155..b56c75211 100644 --- a/widgets/tablecombo/org.eclipse.nebula.widgets.tablecombo/META-INF/MANIFEST.MF +++ b/widgets/tablecombo/org.eclipse.nebula.widgets.tablecombo/META-INF/MANIFEST.MF @@ -7,6 +7,6 @@ Export-Package: org.eclipse.nebula.jface.tablecomboviewer, org.eclipse.nebula.widgets.tablecombo Automatic-Module-Name: org.eclipse.nebula.widgets.tablecombo Bundle-RequiredExecutionEnvironment: JavaSE-11 -Require-Bundle: org.eclipse.swt, +Require-Bundle: org.eclipse.swt;bundle-version="[3.126.0,4.0.0)", org.eclipse.jface;resolution:=optional Bundle-Vendor: Eclipse Nebula diff --git a/widgets/tablecombo/org.eclipse.nebula.widgets.tablecombo/src/org/eclipse/nebula/widgets/tablecombo/TableCombo.java b/widgets/tablecombo/org.eclipse.nebula.widgets.tablecombo/src/org/eclipse/nebula/widgets/tablecombo/TableCombo.java index a3be4c993..6c64d05a9 100644 --- a/widgets/tablecombo/org.eclipse.nebula.widgets.tablecombo/src/org/eclipse/nebula/widgets/tablecombo/TableCombo.java +++ b/widgets/tablecombo/org.eclipse.nebula.widgets.tablecombo/src/org/eclipse/nebula/widgets/tablecombo/TableCombo.java @@ -57,7 +57,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; /** @@ -342,12 +341,7 @@ private static int checkStyle(final 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); } /** @@ -381,14 +375,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); } /** @@ -473,12 +460,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); } /** @@ -1818,11 +1800,7 @@ public void redraw(final int x, final int y, final int width, final int height, * @see #addModifyListener */ public void removeModifyListener(final ModifyListener listener) { - checkWidget(); - if (listener == null) { - SWT.error(SWT.ERROR_NULL_ARGUMENT); - } - removeListener(SWT.Modify, listener); + removeTypedListener(SWT.Modify, listener); } /** @@ -1848,12 +1826,8 @@ public void removeModifyListener(final ModifyListener listener) { * @see #addSelectionListener */ public void removeSelectionListener(final SelectionListener listener) { - checkWidget(); - if (listener == null) { - SWT.error(SWT.ERROR_NULL_ARGUMENT); - } - removeListener(SWT.Selection, listener); - removeListener(SWT.DefaultSelection, listener); + removeTypedListener(SWT.Selection, listener); + removeTypedListener(SWT.DefaultSelection, listener); } /** @@ -1881,11 +1855,7 @@ public void removeSelectionListener(final SelectionListener listener) { * @since 3.3 */ public void removeVerifyListener(final VerifyListener listener) { - checkWidget(); - if (listener == null) { - SWT.error(SWT.ERROR_NULL_ARGUMENT); - } - removeListener(SWT.Verify, listener); + removeTypedListener(SWT.Verify, listener); } /** diff --git a/widgets/tiles/org.eclipse.nebula.widgets.tiles/META-INF/MANIFEST.MF b/widgets/tiles/org.eclipse.nebula.widgets.tiles/META-INF/MANIFEST.MF index 83b21d5f1..a278fa7e6 100644 --- a/widgets/tiles/org.eclipse.nebula.widgets.tiles/META-INF/MANIFEST.MF +++ b/widgets/tiles/org.eclipse.nebula.widgets.tiles/META-INF/MANIFEST.MF @@ -6,5 +6,5 @@ Bundle-Version: 1.0.0.qualifier Bundle-Vendor: Eclipse Nebula Bundle-RequiredExecutionEnvironment: JavaSE-11 Export-Package: org.eclipse.nebula.widgets.tiles -Require-Bundle: org.eclipse.swt +Require-Bundle: org.eclipse.swt;bundle-version="[3.126.0,4.0.0)" Automatic-Module-Name: org.eclipse.nebula.widgets.tiles diff --git a/widgets/tiles/org.eclipse.nebula.widgets.tiles/src/org/eclipse/nebula/widgets/tiles/Tiles.java b/widgets/tiles/org.eclipse.nebula.widgets.tiles/src/org/eclipse/nebula/widgets/tiles/Tiles.java index 0c4faf57d..1e2ce4dd3 100644 --- a/widgets/tiles/org.eclipse.nebula.widgets.tiles/src/org/eclipse/nebula/widgets/tiles/Tiles.java +++ b/widgets/tiles/org.eclipse.nebula.widgets.tiles/src/org/eclipse/nebula/widgets/tiles/Tiles.java @@ -35,7 +35,6 @@ import org.eclipse.swt.widgets.Canvas; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.TypedListener; /** * @@ -109,8 +108,7 @@ public Tiles(final Composite parent, final int style) { * @param listener */ public void addSelectionListener(final SelectionListener listener) { - super.checkWidget(); - addListener(SWT.Selection, new TypedListener(listener)); + addTypedListener(listener, SWT.Selection); } /** @@ -253,8 +251,7 @@ public T getSelectedItem() { * @param listener */ public void removeSelectionListener(final SelectionListener listener) { - super.checkWidget(); - removeListener(SWT.Selection, listener); + removeTypedListener(SWT.Selection, listener); } /**