Skip to content

Commit 6347ad3

Browse files
ShahzaibIbrahimHeikoKlare
authored andcommitted
Suppress warnings for deprecated Cursor constructor
Cursor(Device, ImageData, ImageData, int, int) was deprecated recently which is still used in some of the snippets testing that exact constructor. That's why the warnings are being suppressed.
1 parent 2b554d9 commit 6347ad3

File tree

4 files changed

+3
-81
lines changed

4 files changed

+3
-81
lines changed

examples/org.eclipse.swt.snippets/Snippets.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ To contribute a new snippet, [create a snippet contribution as a pull request](h
121121

122122
### **Cursor**
123123
- [set the hand cursor into a control](https://github.com/eclipse-platform/eclipse.platform.swt/tree/master/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet44.java)[(preview)](https://github.com/eclipse-platform/eclipse.platform.swt/blob/master/examples/org.eclipse.swt.snippets/previews/Snippet44.png "Preview for Snippet 44")
124-
- [create a cursor from a source and a mask](https://github.com/eclipse-platform/eclipse.platform.swt/tree/master/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet92.java)[(preview)](https://github.com/eclipse-platform/eclipse.platform.swt/blob/master/examples/org.eclipse.swt.snippets/previews/Snippet92.png "Preview for Snippet 92")
125124
- [create a color cursor from a source and a mask](https://github.com/eclipse-platform/eclipse.platform.swt/tree/master/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet119.java)[(preview)](https://github.com/eclipse-platform/eclipse.platform.swt/blob/master/examples/org.eclipse.swt.snippets/previews/Snippet119.png "Preview for Snippet 119")
126125
- [create a color cursor from an image file](https://github.com/eclipse-platform/eclipse.platform.swt/tree/master/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet118.java)[(preview)](https://github.com/eclipse-platform/eclipse.platform.swt/blob/master/examples/org.eclipse.swt.snippets/previews/Snippet118.png "Preview for Snippet 118")
127126
- [hide the Cursor over a control](https://github.com/eclipse-platform/eclipse.platform.swt/tree/master/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet242.java)[(preview)](https://github.com/eclipse-platform/eclipse.platform.swt/blob/master/examples/org.eclipse.swt.snippets/previews/Snippet242.png "Preview for Snippet 242")
-1.11 KB
Binary file not shown.

examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet386.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,9 @@ private Cursor createCursor(int selection) {
205205
mask.setPixel(x, y, x % 2);
206206
}
207207
}
208-
209-
return new Cursor(display, source, mask, IMAGE_SIZE_IN_POINTS / 2, IMAGE_SIZE_IN_POINTS / 2);
208+
@SuppressWarnings("deprecation")
209+
Cursor cursor = new Cursor(display, source, mask, IMAGE_SIZE_IN_POINTS / 2, IMAGE_SIZE_IN_POINTS / 2);
210+
return cursor;
210211
}
211212
case 2:
212213
RGB red = new RGB(255, 0, 0);

examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet92.java

Lines changed: 0 additions & 78 deletions
This file was deleted.

0 commit comments

Comments
 (0)