Skip to content

Commit 625d2b4

Browse files
committed
Cleanup various deprecation warnings in the GEF component
Contributes to eclipse-gef#778
1 parent 810f4c6 commit 625d2b4

File tree

4 files changed

+7
-16
lines changed

4 files changed

+7
-16
lines changed

org.eclipse.gef/src/org/eclipse/gef/internal/InternalGEFPlugin.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2006, 2024 IBM Corporation and others.
2+
* Copyright (c) 2006, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License 2.0 which is available at
@@ -69,15 +69,6 @@ public static AbstractUIPlugin getDefault() {
6969
return singleton;
7070
}
7171

72-
/**
73-
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
74-
*/
75-
@Override
76-
public void stop(BundleContext context) throws Exception {
77-
savePluginPreferences();
78-
super.stop(context);
79-
}
80-
8172
/**
8273
* Convenience method for getting the current zoom level of the active device.If
8374
* on MacOS or Linux (x11 window system) or if the device zoom couldn't

org.eclipse.gef/src/org/eclipse/gef/ui/palette/customize/PaletteCustomizerDialog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ public void widgetSelected(SelectionEvent event) {
296296
widgets.put(Integer.valueOf(id), button);
297297

298298
if (descriptor != null) {
299-
button.setImage(new Image(parent.getDisplay(), descriptor.getImageData()));
299+
button.setImage(descriptor.createImage(parent.getDisplay()));
300300
button.addDisposeListener(e -> {
301301
Image img = ((Button) e.getSource()).getImage();
302302
if (img != null && !img.isDisposed()) {

org.eclipse.gef/src/org/eclipse/gef/ui/palette/customize/PaletteSettingsDialog.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2024 IBM Corporation and others.
2+
* Copyright (c) 2000, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License 2.0 which is available at
@@ -253,7 +253,7 @@ public void widgetSelected(SelectionEvent event) {
253253
widgets.put(Integer.valueOf(id), button);
254254

255255
if (descriptor != null) {
256-
button.setImage(new Image(parent.getDisplay(), descriptor.getImageData()));
256+
button.setImage(descriptor.createImage(parent.getDisplay()));
257257
button.addDisposeListener(e -> {
258258
Image img = ((Button) e.getSource()).getImage();
259259
if (img != null && !img.isDisposed()) {

org.eclipse.gef/src/org/eclipse/gef/ui/parts/DomainEventDispatcher.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2010 IBM Corporation and others.
2+
* Copyright (c) 2000, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License 2.0 which is available at
@@ -15,6 +15,7 @@
1515
import java.util.HashMap;
1616
import java.util.Map;
1717

18+
import org.eclipse.swt.SWT;
1819
import org.eclipse.swt.accessibility.ACC;
1920
import org.eclipse.swt.accessibility.AccessibleControlEvent;
2021
import org.eclipse.swt.accessibility.AccessibleControlListener;
@@ -28,7 +29,6 @@
2829

2930
import org.eclipse.draw2d.EventDispatcher;
3031
import org.eclipse.draw2d.IFigure;
31-
import org.eclipse.draw2d.InputEvent;
3232
import org.eclipse.draw2d.SWTEventDispatcher;
3333
import org.eclipse.draw2d.geometry.Point;
3434

@@ -409,7 +409,7 @@ public void dispatchMouseMoved(org.eclipse.swt.events.MouseEvent me) {
409409
}
410410
}
411411
if (okToDispatch()) {
412-
if ((me.stateMask & InputEvent.ANY_BUTTON) != 0) {
412+
if ((me.stateMask & SWT.BUTTON_MASK) != 0) {
413413
domain.mouseDrag(me, viewer);
414414
} else {
415415
domain.mouseMove(me, viewer);

0 commit comments

Comments
 (0)