File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 1
1
/*******************************************************************************
2
- * Copyright (c) 2000, 2016 IBM Corporation and others.
2
+ * Copyright (c) 2000, 2025 IBM Corporation and others.
3
3
*
4
4
* This program and the accompanying materials
5
5
* are made available under the terms of the Eclipse Public License 2.0
@@ -40,12 +40,12 @@ public static void main (String [] args) {
40
40
final Shell shell = new Shell (display );
41
41
shell .setText ("Snippet 62" );
42
42
Listener listener = e -> {
43
- String string = "Unknown" ;
44
- switch ( e . type ) {
45
- case SWT .MouseDown : string = "DOWN" ; break ;
46
- case SWT .MouseMove : string = "MOVE" ; break ;
47
- case SWT . MouseUp : string = "UP" ; break ;
48
- }
43
+ String string = switch ( e . type ) {
44
+ case SWT . MouseDown -> "DOWN" ;
45
+ case SWT .MouseMove -> "MOVE" ;
46
+ case SWT .MouseUp -> "UP" ;
47
+ default -> "Unknown" ;
48
+ };
49
49
string +=": button: " + e .button + ", " ;
50
50
string += "stateMask=0x" + Integer .toHexString (e .stateMask ) + stateMask (e .stateMask ) + ", x=" + e .x + ", y=" + e .y ;
51
51
if ((e .stateMask & SWT .BUTTON1 ) != 0 ) string += " BUTTON1" ;
You can’t perform that action at this time.
0 commit comments