Skip to content

Commit

Permalink
Replace usage of actually internal SWT TypedListener
Browse files Browse the repository at this point in the history
Use the new API introduced in SWT via
eclipse-platform/eclipse.platform.swt#1112
  • Loading branch information
HannesWell authored and akurtakov committed Mar 20, 2024
1 parent 1122c63 commit 0de600a
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 23 deletions.
2 changes: 1 addition & 1 deletion bundles/org.eclipse.jface.text/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Export-Package:
Require-Bundle:
org.eclipse.core.runtime;bundle-version="[3.29.0,4.0.0)",
org.eclipse.text;bundle-version="[3.8.0,4.0.0)";visibility:=reexport,
org.eclipse.swt;bundle-version="[3.117.0,4.0.0)",
org.eclipse.swt;bundle-version="[3.126.0,4.0.0)",
org.eclipse.jface;bundle-version="[3.19.0,4.0.0)"
Import-Package: com.ibm.icu.text
Bundle-RequiredExecutionEnvironment: JavaSE-17
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.TypedListener;

import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
Expand Down Expand Up @@ -599,10 +598,7 @@ public void addMouseListener(MouseListener listener) {
if (listener == fMouseHandler)
super.addMouseListener(listener);
else {
TypedListener typedListener= null;
if (listener != null)
typedListener= new TypedListener(listener);
addListener(SWT.MouseDoubleClick, typedListener);
addTypedListener(listener, SWT.MouseDoubleClick);
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.eclipse.jface/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Export-Package: org.eclipse.jface,
org.eclipse.jface.window,
org.eclipse.jface.wizard,
org.eclipse.jface.wizard.images
Require-Bundle: org.eclipse.swt;bundle-version="[3.111.0,4.0.0)";visibility:=reexport,
Require-Bundle: org.eclipse.swt;bundle-version="[3.126.0,4.0.0)";visibility:=reexport,
org.eclipse.core.commands;bundle-version="[3.4.0,4.0.0)";visibility:=reexport,
org.eclipse.equinox.common;bundle-version="[3.18.0,4.0.0)",
org.eclipse.equinox.bidi;bundle-version="[0.10.0,2.0.0)";resolution:=optional
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.eclipse.ui.forms/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %name
Bundle-SymbolicName: org.eclipse.ui.forms;singleton:=true
Bundle-Version: 3.13.200.qualifier
Bundle-Version: 3.13.300.qualifier
Bundle-Vendor: %provider-name
Bundle-Localization: plugin
Export-Package: org.eclipse.ui.forms,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,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;
import org.eclipse.ui.forms.HyperlinkSettings;
import org.eclipse.ui.forms.events.HyperlinkEvent;
import org.eclipse.ui.forms.events.IHyperlinkListener;
Expand Down Expand Up @@ -994,12 +993,7 @@ public void removeHyperlinkListener(IHyperlinkListener listener) {
* @since 3.1
*/
public void addSelectionListener(SelectionListener listener) {
checkWidget();
if (listener == null) {
SWT.error(SWT.ERROR_NULL_ARGUMENT);
}
TypedListener typedListener = new TypedListener(listener);
addListener(SWT.Selection, typedListener);
addTypedListener(listener, SWT.Selection);
}

/**
Expand All @@ -1021,11 +1015,7 @@ public void addSelectionListener(SelectionListener listener) {
* @since 3.1
*/
public void removeSelectionListener(SelectionListener listener) {
checkWidget();
if (listener == null) {
SWT.error(SWT.ERROR_NULL_ARGUMENT);
}
removeListener(SWT.Selection, listener);
removeTypedListener(SWT.Selection, listener);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions bundles/org.eclipse.ui/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Plugin.name
Bundle-SymbolicName: org.eclipse.ui; singleton:=true
Bundle-Version: 3.205.100.qualifier
Bundle-Version: 3.206.0.qualifier
Bundle-Activator: org.eclipse.ui.internal.UIPlugin
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %Plugin.providerName
Bundle-Localization: plugin
Export-Package: org.eclipse.ui.internal;x-internal:=true
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.29.0,4.0.0)",
org.eclipse.swt;bundle-version="[3.124.0,4.0.0)";visibility:=reexport,
org.eclipse.jface;bundle-version="[3.31.0,4.0.0)";visibility:=reexport,
org.eclipse.swt;bundle-version="[3.126.0,4.0.0)";visibility:=reexport,
org.eclipse.jface;bundle-version="[3.34.0,4.0.0)";visibility:=reexport,
org.eclipse.ui.workbench;bundle-version="[3.130.0,4.0.0)";visibility:=reexport,
org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)"
Bundle-RequiredExecutionEnvironment: JavaSE-17
Expand Down

0 comments on commit 0de600a

Please sign in to comment.