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 11/*******************************************************************************
2- * Copyright (c) 2000, 2016 IBM Corporation and others.
2+ * Copyright (c) 2000, 2025 IBM Corporation and others.
33 *
44 * This program and the accompanying materials
55 * are made available under the terms of the Eclipse Public License 2.0
@@ -40,12 +40,12 @@ public static void main (String [] args) {
4040 final Shell shell = new Shell (display );
4141 shell .setText ("Snippet 62" );
4242 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+ };
4949 string +=": button: " + e .button + ", " ;
5050 string += "stateMask=0x" + Integer .toHexString (e .stateMask ) + stateMask (e .stateMask ) + ", x=" + e .x + ", y=" + e .y ;
5151 if ((e .stateMask & SWT .BUTTON1 ) != 0 ) string += " BUTTON1" ;
You can’t perform that action at this time.
0 commit comments