Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Pazderski2019-05-18 17:05:03 +0000
committerPaul Pazderski2019-06-14 22:34:53 +0000
commit7051049221c9d3b99ff179f167fa09a6e02138ee (patch)
tree21704e08b4c470f16f4fece637154f86fce96cc8
parenta1b9b9e1accf9dfece07675d7919a6f4e6561891 (diff)
downloadeclipse.platform.swt-7051049221c9d3b99ff179f167fa09a6e02138ee.tar.gz
eclipse.platform.swt-7051049221c9d3b99ff179f167fa09a6e02138ee.tar.xz
eclipse.platform.swt-7051049221c9d3b99ff179f167fa09a6e02138ee.zip
Bug 547304 - [cleanup] Fix wrong space/tab indentation
This change fixes space or mixed tab/space indentations in all Java files. This also includes two or three space indentations and even fix most stray single spaces in indentations. The change includes only whitespace formatting and no code changes. Change-Id: Ib7b260691acee06845cc580dd8cb859de0da8bf1
-rw-r--r--bundles/org.eclipse.swt.tools/Icon Exe/org/eclipse/swt/tools/internal/IconExe.java26
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/CleanupClass.java4
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/CleanupConstants.java2
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/LockGenerator.java4
-rw-r--r--bundles/org.eclipse.swt.tools/Mac Generation/org/eclipse/swt/tools/internal/MacGenerator.java4
-rw-r--r--bundles/org.eclipse.swt.tools/Mac Generation/org/eclipse/swt/tools/internal/MacGeneratorUI.java78
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/Accessible.java16
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/Accessible.java16
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/WebSite.java54
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CBanner.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CLabel.java112
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java48
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderEvent.java14
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderRenderer.java92
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem.java16
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ControlEditor.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StackLayout.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java38
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TableCursor.java38
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ViewForm.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ViewFormLayout.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DropTarget.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common/org/eclipse/swt/dnd/DragSourceEvent.java50
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DropTarget.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/ImageTransfer.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TransferData.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/ByteArrayTransfer.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/DragSource.java16
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/DropTarget.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/TransferData.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OLE.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleClientSite.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/Variant.java114
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT OpenGL/win32/org/eclipse/swt/internal/opengl/win32/LAYERPLANEDESCRIPTOR.java48
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT OpenGL/win32/org/eclipse/swt/internal/opengl/win32/PIXELFORMATDESCRIPTOR.java52
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cairo/org/eclipse/swt/internal/cairo/Cairo.java30
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/common/org/eclipse/swt/internal/Library.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GDK.java34
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java226
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEventKey.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/com/win32/FileDialogVtbl.java54
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/com/win32/ShellItemVtbl.java16
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/GUID.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IOleInPlaceActiveObject.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IStorage.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/CERT_PUBLIC_KEY_INFO.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/DROPFILES.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/GESTURECONFIG.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/GESTUREINFO.java30
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/MEASUREITEMSTRUCT.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/NMTVDISPINFO.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OUTLINETEXTMETRIC.java68
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/TVINSERTSTRUCT.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/TVITEM.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Printing/common/org/eclipse/swt/printing/PrinterData.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Program/cocoa/org/eclipse/swt/program/Program.java26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Program/win32/org/eclipse/swt/program/Program.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/cocoa/org/eclipse/swt/browser/WebKit.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java156
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/internal/webkit/JSClassDefinition.java66
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebDownloadDelegate.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebFrameLoadDelegate.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebKit.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebPolicyDelegate.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebResourceLoadDelegate.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/internal/webkit/JSClassDefinition.java68
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java58
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/TextLayout.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Button.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Canvas.java114
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Combo.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Decorations.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java58
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Menu.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/MenuItem.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ProgressBar.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scale.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ScrollBar.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scrollable.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Slider.java46
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Spinner.java70
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableColumn.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Text.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolBar.java18
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java42
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tracker.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeColumn.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java48
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWTError.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/KeyEvent.java14
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/PaintEvent.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/DPIUtil.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/GIFFileFormat.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/JPEGDecoder.java50
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/JPEGFileFormat.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/LEDataInputStream.java20
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngDeflater.java66
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngHuffmanTable.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngHuffmanTables.java24
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/WinBMPFileFormat.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/FillLayout.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/FormAttachment.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/FormData.java16
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/FormLayout.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/GridData.java30
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/GridLayout.java52
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/RowLayout.java26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java18
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java92
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/internal/GDBus.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java32
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ColorDialog.java30
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java32
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java66
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java32
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Decorations.java16
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Link.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java36
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java14
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java30
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Cursor.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java32
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/ImageList.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Combo.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java14
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Decorations.java26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/DirectoryDialog.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandBar.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FileDialog.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/IME.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/List.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Menu.java24
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MenuItem.java14
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Sash.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scale.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scrollable.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Slider.java36
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Spinner.java36
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TabFolder.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java88
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tracker.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java16
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeItem.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java14
-rw-r--r--examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/LauncherPlugin.java16
-rw-r--r--examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OLEExample.java14
-rw-r--r--examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OleBrowserView.java6
-rw-r--r--examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OlePlugin.java12
-rw-r--r--examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OleWebBrowser.java6
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTable.java6
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableColumn.java2
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableItem.java2
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/ControlsWithAccessibleNamesExample.java24
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ColorTab.java62
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java6
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CoolBarTab.java6
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/Tab.java8
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TableTab.java8
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TreeTab.java18
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/dnd/DNDExample.java12
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/FileViewer.java10
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CardsTab.java68
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CustomAlphaTab.java2
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/FontBounceTab.java74
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GradientDialog.java20
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GraphicAntialiasTab.java2
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/IntroTab.java38
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/PathClippingTab.java4
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/RegionClippingTab.java4
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/StarPolyTab.java22
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/imageanalyzer/ImageAnalyzer.java8
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaLineStyler.java2
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/GridLayoutTab.java2
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/LayoutExample.java4
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/StackLayoutTab.java6
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/Tab.java44
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/ContinuousPaintSession.java2
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/DragPaintSession.java2
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintSession.java4
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/SegmentedPaintSession.java2
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/TextTool.java2
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/TextEditor.java22
-rw-r--r--examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/FogTab.java2
-rw-r--r--examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/LWJGLExample.java38
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet150.java80
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet152.java114
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet153.java50
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet157.java12
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet174.java96
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet186.java40
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet2.java94
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet210.java18
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet228.java4
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet244.java38
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet257.java10
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet274.java106
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet282.java14
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet304.java96
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet333.java6
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet334.java2
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet336.java2
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet359.java18
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet363.java130
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet366.java4
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet5.java52
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet6.java52
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet81.java10
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug119157_ShellWithoutFocus.java68
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug123091_TableEditorRefresh.java74
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug138265_SystemMemoryUsage.java2
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug147320_ShellSetBounds.java24
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug150921_TextCaretPosition.java66
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug152916_ShellSetVisibleBounds.java26
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug160691_SWTAWTShell.java34
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug166720_TableEditorFlicker.java58
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug185817_MouseListener.java132
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug186268_TableItemSetTextBottom.java72
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug191137_ActiveSelectionLost.java30
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug197690_CVSWizard.java34
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug197785_TextSelectionBehavior.java78
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug205199_LabelSetImageNull.java4
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug210915_InvisibleShellLocation.java82
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug217324_ActivateEventDialog.java80
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug221240_AWTJVMCrash.java174
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug221955_BackgroundModeQT.java104
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug221962_CTabFolderCorrupted.java6
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug223864_ToolTipToolbarButton.java54
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug225725_GCDrawing.java50
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug230385_ControlSetGetSizeDiscrepancy.java38
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug249689_MeasureEventWrongBounds.java40
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug251354_TabItemToolTip.java94
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug258196_VirtualTreeResizing.java54
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug261288_TreeBGColor.java40
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug262974_ModalBrowserDialog.java70
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug278882_ToolBarBackgroundImageTest.java10
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug286244_ShellActivateLoop.java66
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug287038_TableKeyEvent.java72
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug290650_FillLayoutComputeSize.java70
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug291073_CrashWhenPrintingToConsole.java12
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug292413_MissingSWTFocused.java58
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug292459_ToolTipFlicker.java64
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug293581_NO_REDRAW_RESIZE_noeffect.java40
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug299045_TableLines.java140
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug299492_LabelCenterWrap.java86
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug302956_ControlFailedMouseEvent.java42
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug302961_TableItemTrackerUpdating.java60
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug303710_ForceActive.java52
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug306490_SwingDisposeError.java2
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug319612_getSizeResizeOnTop.java50
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug323044_ReadAndDispatchTrue.java68
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug326117_EmbeddedBrowser.java70
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug336238_ShellBoundsTest.java30
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug375385_ShellFullScreen.java100
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug386271_setMenuBar.java52
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug393723_checkForegroundBug.java42
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug430538_JS_Set_Background.java10
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug436085_TextEntryTabs.java22
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug443185_ToolbarCroppingIssue.java64
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug443185_ToolbarTestFillLayout.java66
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug443185_ToolbarTestGridLayout.java68
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug443185_ToolbarTestPlain.java58
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug443185_ToolbarTestRowLayout.java68
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug460017_ComboOverwrite.java40
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug461354_ListTopIndexTest.java2
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug465280_InvisibleControlAllocation.java26
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug475784_TransparentComposite.java412
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug477950_SystemColors.java36
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug480926_CellEditorPosition.java78
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug481485_ButtonLabelPaintListener.java30
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug483112_TreeColumnsTest.java64
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug483791_setBackgroundGC.java66
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug486068_ExpandBarTest.java4
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug496639_DialogFullScreenShell.java90
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug500631_RHELIcons.java74
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug500664_ToolTipWrongMonitor.java32
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug500814_GLCanvasCrash.java36
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug510803_TabFolder_editable_table_brokenGtk3.java22
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug517633_SpinnerWrongText.java38
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug519996_focusDisposeIssue.java10
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug531667_CTabFolder_right_to_left_tabs_are_not_painted_nested.java2
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug531667_Group_drawing_with_paint_listener_is_wrong.java4
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug535124_TreeSelection.java36
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug535978_TableEditorHeader.java82
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug538114_ExpandBarEmptyAll.java44
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug542475_DateTimeWrongIncrement.java30
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug71990_SlowTablePack.java216
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug74739_TableTopIndex.java8
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug85131_ToolTipSetNull.java88
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/manualJUnit/MJ_Table.java260
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/manualJUnit/MJ_Tree.java168
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/manualJUnit/MJ_root.java24
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/ConsistencyUtility.java698
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/StyledTextContentSpec.java2
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java42
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CCombo.java38
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CLabel.java4
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CTabFolder.java44
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_ExtendedModifyListener.java2
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java48
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TextChangeListener.java4
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_GC.java2
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Image.java4
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_RGB.java12
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_RGBA.java16
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_TextLayout.java36
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Button.java140
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Canvas.java4
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Combo.java38
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Control.java200
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_CoolBar.java90
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_DateTime.java92
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Decorations.java6
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ExpandBar.java42
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Group.java4
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Label.java24
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_List.java32
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Menu.java6
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ProgressBar.java4
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Sash.java24
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Scale.java14
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Shell.java116
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Slider.java26
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TabFolder.java92
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Table.java44
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableItem.java78
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Text.java16
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ToolBar.java46
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Tree.java66
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeItem.java74
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Widget.java66
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/performance/Test_situational.java6
354 files changed, 6441 insertions, 6441 deletions
diff --git a/bundles/org.eclipse.swt.tools/Icon Exe/org/eclipse/swt/tools/internal/IconExe.java b/bundles/org.eclipse.swt.tools/Icon Exe/org/eclipse/swt/tools/internal/IconExe.java
index 547a8dc03e..27e488390b 100644
--- a/bundles/org.eclipse.swt.tools/Icon Exe/org/eclipse/swt/tools/internal/IconExe.java
+++ b/bundles/org.eclipse.swt.tools/Icon Exe/org/eclipse/swt/tools/internal/IconExe.java
@@ -28,11 +28,11 @@ import org.eclipse.swt.*;
*/
public class IconExe {
- /**
+ /**
* Replace the Desktop icons provided in the Windows executable program
* with matching icons provided by the user.
*
- * Takes 2 arguments
+ * Takes 2 arguments
* argument 0: the Windows executable e.g c:/eclipse/eclipse.exe
* argument 1: The .ico file to write to the given executable e.g. c:/myApp.ico
*
@@ -258,7 +258,7 @@ void dumpResourceDirectory(RandomAccessFile raf, int imageResourceDirectoryOffse
}
}
}
- }
+ }
}
static ImageData parseIcon(RandomAccessFile raf, int offset) throws IOException {
@@ -2616,13 +2616,13 @@ static class LEDataInputStream extends InputStream {
}
/**
- * Reads at most <code>length</code> bytes from this LEDataInputStream and
- * stores them in byte array <code>buffer</code> starting at <code>offset</code>.
- * <p>
- * Answer the number of bytes actually read or -1 if no bytes were read and
- * end of stream was encountered. This implementation reads bytes from
- * the pushback buffer first, then the target stream if more bytes are required
- * to satisfy <code>count</code>.
+ * Reads at most <code>length</code> bytes from this LEDataInputStream and
+ * stores them in byte array <code>buffer</code> starting at <code>offset</code>.
+ * <p>
+ * Answer the number of bytes actually read or -1 if no bytes were read and
+ * end of stream was encountered. This implementation reads bytes from
+ * the pushback buffer first, then the target stream if more bytes are required
+ * to satisfy <code>count</code>.
* </p>
* @param buffer the byte array in which to store the read bytes.
* @param offset the offset in <code>buffer</code> to store the read bytes.
@@ -2635,9 +2635,9 @@ static class LEDataInputStream extends InputStream {
private int readData(byte[] buffer, int offset, int length) throws IOException {
if (buf == null) throw new IOException();
if (offset < 0 || offset > buffer.length ||
- length < 0 || (length > buffer.length - offset)) {
- throw new ArrayIndexOutOfBoundsException();
- }
+ length < 0 || (length > buffer.length - offset)) {
+ throw new ArrayIndexOutOfBoundsException();
+ }
int cacheCopied = 0;
int newOffset = offset;
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/CleanupClass.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/CleanupClass.java
index 43a9e7035e..d582f8f1b0 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/CleanupClass.java
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/CleanupClass.java
@@ -37,8 +37,8 @@ String[] getArgNames(JNIMethod method) {
int parantesesStart = classSource.indexOf("(", index);
if (classSource.substring(index + name.length(), parantesesStart).trim().length() == 0) {
int parantesesEnd = classSource.indexOf(")", parantesesStart);
- params = classSource.substring(parantesesStart + 1, parantesesEnd);
- break;
+ params = classSource.substring(parantesesStart + 1, parantesesEnd);
+ break;
}
}
String[] names = new String[n_args];
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/CleanupConstants.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/CleanupConstants.java
index 19f1147190..d065dbd5e5 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/CleanupConstants.java
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/CleanupConstants.java
@@ -27,7 +27,7 @@ String getFieldValue(JNIField field) {
int equalsIndex = classSource.indexOf("=", index);
if (classSource.substring(index + name.length(), equalsIndex).trim().length() == 0) {
int semiIndex = classSource.indexOf(";", equalsIndex);
- return classSource.substring(equalsIndex + 1, semiIndex).trim();
+ return classSource.substring(equalsIndex + 1, semiIndex).trim();
}
}
}
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/LockGenerator.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/LockGenerator.java
index e70a747a6f..c0157d9d08 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/LockGenerator.java
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/LockGenerator.java
@@ -35,8 +35,8 @@ String getParams(JNIMethod method) {
int parantesesStart = classSource.indexOf("(", index);
if (classSource.substring(index + name.length(), parantesesStart).trim().length() == 0) {
int parantesesEnd = classSource.indexOf(")", parantesesStart);
- params = classSource.substring(parantesesStart + 1, parantesesEnd);
- break;
+ params = classSource.substring(parantesesStart + 1, parantesesEnd);
+ break;
}
}
return params;
diff --git a/bundles/org.eclipse.swt.tools/Mac Generation/org/eclipse/swt/tools/internal/MacGenerator.java b/bundles/org.eclipse.swt.tools/Mac Generation/org/eclipse/swt/tools/internal/MacGenerator.java
index b027247330..9a20291627 100644
--- a/bundles/org.eclipse.swt.tools/Mac Generation/org/eclipse/swt/tools/internal/MacGenerator.java
+++ b/bundles/org.eclipse.swt.tools/Mac Generation/org/eclipse/swt/tools/internal/MacGenerator.java
@@ -200,8 +200,8 @@ String getParamName(Node param, int i) {
if (swtName != null) {
paramName = swtName.getNodeValue();
} else {
- Node node = paramAttributes.getNamedItem("name");
- if (node != null) paramName = node.getNodeValue();
+ Node node = paramAttributes.getNamedItem("name");
+ if (node != null) paramName = node.getNodeValue();
}
if (paramName.length() == 0) {
Node node = paramAttributes.getNamedItem("index");
diff --git a/bundles/org.eclipse.swt.tools/Mac Generation/org/eclipse/swt/tools/internal/MacGeneratorUI.java b/bundles/org.eclipse.swt.tools/Mac Generation/org/eclipse/swt/tools/internal/MacGeneratorUI.java
index 918d05bb35..f371d127fc 100644
--- a/bundles/org.eclipse.swt.tools/Mac Generation/org/eclipse/swt/tools/internal/MacGeneratorUI.java
+++ b/bundles/org.eclipse.swt.tools/Mac Generation/org/eclipse/swt/tools/internal/MacGeneratorUI.java
@@ -68,25 +68,25 @@ public class MacGeneratorUI {
}
void checkPath(TreeItem item, boolean checked, boolean grayed) {
- if (item == null) return;
- if (grayed) {
- checked = true;
- } else {
- int index = 0;
- TreeItem[] items = item.getItems();
- while (index < items.length) {
- TreeItem child = items[index];
- if (child.getGrayed() || checked != child.getChecked()) {
- checked = grayed = true;
- break;
- }
- index++;
- }
- }
- item.setChecked(checked);
- item.setGrayed(grayed);
- updateGenAttribute(item);
- checkPath(item.getParentItem(), checked, grayed);
+ if (item == null) return;
+ if (grayed) {
+ checked = true;
+ } else {
+ int index = 0;
+ TreeItem[] items = item.getItems();
+ while (index < items.length) {
+ TreeItem child = items[index];
+ if (child.getGrayed() || checked != child.getChecked()) {
+ checked = grayed = true;
+ break;
+ }
+ index++;
+ }
+ }
+ item.setChecked(checked);
+ item.setGrayed(grayed);
+ updateGenAttribute(item);
+ checkPath(item.getParentItem(), checked, grayed);
}
void checkItem(Node node, TreeItem item) {
@@ -139,22 +139,22 @@ public class MacGeneratorUI {
}
void checkItems(TreeItem item, boolean checked) {
- item.setGrayed(false);
- item.setChecked(checked);
- updateGenAttribute(item);
- TreeItem[] items = item.getItems();
- if (items.length == 1 && items[0].getData() == null) {
- /* Update model only if view is not created */
+ item.setGrayed(false);
+ item.setChecked(checked);
+ updateGenAttribute(item);
+ TreeItem[] items = item.getItems();
+ if (items.length == 1 && items[0].getData() == null) {
+ /* Update model only if view is not created */
Node node = (Node)item.getData();
NodeList childNodes = node.getChildNodes();
for (int i = 0, length = childNodes.getLength(); i < length; i++) {
checkNodes(childNodes.item(i), checked);
}
- } else {
- for (int i = 0; i < items.length; i++) {
- checkItems(items[i], checked);
- }
- }
+ } else {
+ for (int i = 0; i < items.length; i++) {
+ checkItems(items[i], checked);
+ }
+ }
}
void checkNodes(Node node, boolean checked) {
@@ -209,9 +209,9 @@ public class MacGeneratorUI {
}
boolean checked = item.getChecked();
item.getParent().setRedraw(false);
- checkItems(item, checked);
- checkPath(item.getParentItem(), checked, false);
- item.getParent().setRedraw(true);
+ checkItems(item, checked);
+ checkPath(item.getParentItem(), checked, false);
+ item.getParent().setRedraw(true);
});
nodesTree.addListener(SWT.Expand, event -> checkChildren((TreeItem)event.item));
@@ -403,8 +403,8 @@ public class MacGeneratorUI {
}
Document[] documents = gen.getDocuments();
if (node == null && documents.length > 0) {
- int index = 0;
- while (index < documents.length && (node = documents[index]) == null) index++;
+ int index = 0;
+ while (index < documents.length && (node = documents[index]) == null) index++;
}
if (flatNodes == null) {
flatNodes = new ArrayList<>();
@@ -564,10 +564,10 @@ public class MacGeneratorUI {
gen.setXmls(null);
flatNodes = null;
nodesTree.getDisplay().asyncExec(() -> {
- if (nodesTree == null || nodesTree.isDisposed()) return;
- nodesTree.removeAll();
- attribTable.removeAll();
- updateNodes();
+ if (nodesTree == null || nodesTree.isDisposed()) return;
+ nodesTree.removeAll();
+ attribTable.removeAll();
+ updateNodes();
});
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/Accessible.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/Accessible.java
index 9be3649131..24785ba85d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/Accessible.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/Accessible.java
@@ -298,10 +298,10 @@ public class Accessible {
* @since 3.7
*/
public void addAccessibleEditableTextListener(AccessibleEditableTextListener listener) {
- checkWidget();
- if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ checkWidget();
+ if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
if (accessibleEditableTextListeners == null) accessibleEditableTextListeners = new ArrayList<>();
- accessibleEditableTextListeners.add(listener);
+ accessibleEditableTextListeners.add(listener);
}
/**
@@ -449,7 +449,7 @@ public class Accessible {
long cgColor = OS.CGColorCreate(cgColorSpace, comps);
OS.CGColorSpaceRelease(cgColorSpace);
inAttribString.addAttribute(inAttribute, new id(cgColor), inRange);
- OS.CGColorRelease(cgColor);
+ OS.CGColorRelease(cgColor);
}
/**
@@ -1991,12 +1991,12 @@ public class Accessible {
}
if (ace.childID >= ACC.CHILDID_SELF) {
if (role == ACC.ROLE_TABITEM) {
- returnValue = NSNumber.numberWithBool(ace.childID == childID);
+ returnValue = NSNumber.numberWithBool(ace.childID == childID);
} else {
returnValue = new id(OS.NSAccessibilityUnignoredAncestor(childIDToOs(ace.childID).id));
}
} else {
- returnValue = NSNumber.numberWithBool(false);
+ returnValue = NSNumber.numberWithBool(false);
}
break;
case ACC.ROLE_COMBOBOX: // text of the currently selected item
@@ -2924,8 +2924,8 @@ public class Accessible {
* @since 3.7
*/
public void removeAccessibleEditableTextListener(AccessibleEditableTextListener listener) {
- checkWidget();
- if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ checkWidget();
+ if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
if (accessibleEditableTextListeners != null) {
accessibleEditableTextListeners.remove(listener);
if (accessibleEditableTextListeners.isEmpty()) accessibleEditableTextListeners = null;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/Accessible.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/Accessible.java
index 283dc2bb8b..078404b5d1 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/Accessible.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/Accessible.java
@@ -264,10 +264,10 @@ public class Accessible {
* @since 3.7
*/
public void addAccessibleEditableTextListener(AccessibleEditableTextListener listener) {
- checkWidget();
- if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ checkWidget();
+ if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
if (accessibleEditableTextListeners == null) accessibleEditableTextListeners = new ArrayList<>();
- accessibleEditableTextListeners.add(listener);
+ accessibleEditableTextListeners.add(listener);
}
/**
@@ -710,12 +710,12 @@ public class Accessible {
* @since 3.7
*/
public void removeAccessibleEditableTextListener(AccessibleEditableTextListener listener) {
- checkWidget();
- if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
- if (accessibleEditableTextListeners != null) {
- accessibleEditableTextListeners.remove(listener);
+ checkWidget();
+ if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (accessibleEditableTextListeners != null) {
+ accessibleEditableTextListeners.remove(listener);
if (accessibleEditableTextListeners.isEmpty()) accessibleEditableTextListeners = null;
- }
+ }
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java
index 8e87fab0c9..208f955494 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java
@@ -558,13 +558,13 @@ public class Accessible {
void createIServiceProvider() {
objIServiceProvider = new COMObject(new int[] {2,0,0,3}) {
- @Override
+ @Override
public long /*int*/ method0(long /*int*/[] args) {return QueryInterface(args[0], args[1]);}
- @Override
+ @Override
public long /*int*/ method1(long /*int*/[] args) {return AddRef();}
- @Override
+ @Override
public long /*int*/ method2(long /*int*/[] args) {return Release();}
- @Override
+ @Override
public long /*int*/ method3(long /*int*/[] args) {return QueryService(args[0], args[1], args[2]);}
};
}
@@ -730,10 +730,10 @@ public class Accessible {
* @since 3.7
*/
public void addAccessibleEditableTextListener(AccessibleEditableTextListener listener) {
- checkWidget();
- if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ checkWidget();
+ if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
if (accessibleEditableTextListeners == null) accessibleEditableTextListeners = new ArrayList<>();
- accessibleEditableTextListeners.add(listener);
+ accessibleEditableTextListeners.add(listener);
}
/**
@@ -1127,12 +1127,12 @@ public class Accessible {
* @since 3.7
*/
public void removeAccessibleEditableTextListener(AccessibleEditableTextListener listener) {
- checkWidget();
- if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
- if (accessibleEditableTextListeners != null) {
- accessibleEditableTextListeners.remove(listener);
- if (accessibleEditableTextListeners.isEmpty()) accessibleEditableTextListeners = null;
- }
+ checkWidget();
+ if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (accessibleEditableTextListeners != null) {
+ accessibleEditableTextListeners.remove(listener);
+ if (accessibleEditableTextListeners.isEmpty()) accessibleEditableTextListeners = null;
+ }
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/WebSite.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/WebSite.java
index a519c655f2..70fac66537 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/WebSite.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/WebSite.java
@@ -250,11 +250,11 @@ protected int QueryInterface(long /*int*/ riid, long /*int*/ ppvObject) {
AddRef();
return COM.S_OK;
}
- if (COM.IsEqualGUID(guid, COM.IIDIInternetSecurityManager)) {
- OS.MoveMemory(ppvObject, new long /*int*/[] {iInternetSecurityManager.getAddress()}, C.PTR_SIZEOF);
- AddRef();
- return COM.S_OK;
- }
+ if (COM.IsEqualGUID(guid, COM.IIDIInternetSecurityManager)) {
+ OS.MoveMemory(ppvObject, new long /*int*/[] {iInternetSecurityManager.getAddress()}, C.PTR_SIZEOF);
+ AddRef();
+ return COM.S_OK;
+ }
if (COM.IsEqualGUID(guid, COM.IIDIOleCommandTarget)) {
OS.MoveMemory(ppvObject, new long /*int*/[] {iOleCommandTarget.getAddress()}, C.PTR_SIZEOF);
AddRef();
@@ -579,11 +579,11 @@ int ProcessUrlAction(long /*int*/ pwszUrl, int dwAction, long /*int*/ pPolicy, i
* override default zone elevation settings to allow the action.
*/
if (dwAction == IE.URLACTION_FEATURE_ZONE_ELEVATION) {
- IE ie = (IE)((Browser)getParent().getParent()).webBrowser;
- if (ie.auto != null && ie._getUrl().startsWith(IE.ABOUT_BLANK) && !ie.untrustedText) {
+ IE ie = (IE)((Browser)getParent().getParent()).webBrowser;
+ if (ie.auto != null && ie._getUrl().startsWith(IE.ABOUT_BLANK) && !ie.untrustedText) {
if (cbPolicy >= 4) OS.MoveMemory(pPolicy, new int[] {IE.URLPOLICY_ALLOW}, 4);
return COM.S_OK;
- }
+ }
}
int policy = IE.INET_E_DEFAULT_ACTION;
@@ -741,25 +741,25 @@ int GetTypeInfo (int iTInfo, int lcid, long /*int*/ ppTInfo) {
}
int GetIDsOfNames (int riid, long /*int*/ rgszNames, int cNames, int lcid, long /*int*/ rgDispId) {
- long /*int*/[] ptr = new long /*int*/[1];
- OS.MoveMemory (ptr, rgszNames, C.PTR_SIZEOF);
- int length = OS.wcslen (ptr[0]);
- char[] buffer = new char[length];
- OS.MoveMemory (buffer, ptr[0], length * 2);
- String functionName = String.valueOf (buffer);
- int result = COM.S_OK;
- int[] ids = new int[cNames]; /* DISPIDs */
- if (functionName.equals ("callJava")) { //$NON-NLS-1$
- for (int i = 0; i < cNames; i++) {
- ids[i] = i + 1;
- }
- } else {
- result = COM.DISP_E_UNKNOWNNAME;
- for (int i = 0; i < cNames; i++) {
- ids[i] = COM.DISPID_UNKNOWN;
- }
- }
- OS.MoveMemory (rgDispId, ids, cNames * 4);
+ long /*int*/[] ptr = new long /*int*/[1];
+ OS.MoveMemory (ptr, rgszNames, C.PTR_SIZEOF);
+ int length = OS.wcslen (ptr[0]);
+ char[] buffer = new char[length];
+ OS.MoveMemory (buffer, ptr[0], length * 2);
+ String functionName = String.valueOf (buffer);
+ int result = COM.S_OK;
+ int[] ids = new int[cNames]; /* DISPIDs */
+ if (functionName.equals ("callJava")) { //$NON-NLS-1$
+ for (int i = 0; i < cNames; i++) {
+ ids[i] = i + 1;
+ }
+ } else {
+ result = COM.DISP_E_UNKNOWNNAME;
+ for (int i = 0; i < cNames; i++) {
+ ids[i] = COM.DISPID_UNKNOWN;
+ }
+ }
+ OS.MoveMemory (rgDispId, ids, cNames * 4);
return result;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CBanner.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CBanner.java
index 953f4fe284..a975ccf0e6 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CBanner.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CBanner.java
@@ -550,11 +550,11 @@ void updateCurve(int height) {
int h = height - BORDER_STRIPE;
if (simple) {
curve = new int[] {0,h, 1,h, 2,h-1, 3,h-2,
- 3,2, 4,1, 5,0,};
+ 3,2, 4,1, 5,0,};
} else {
curve = bezier(0, h+1, BEZIER_LEFT, h+1,
- curve_width-BEZIER_RIGHT, 0, curve_width, 0,
- curve_width);
+ curve_width-BEZIER_RIGHT, 0, curve_width, 0,
+ curve_width);
}
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java
index f21d7cb3ce..b87b045a5e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java
@@ -640,7 +640,7 @@ char _findMnemonic (String string) {
if (string.charAt (index) != '&') return Character.toLowerCase (string.charAt (index));
index++;
} while (index < length);
- return '\0';
+ return '\0';
}
/*
* Return the Label immediately preceding the receiver in the z-order,
@@ -1098,7 +1098,7 @@ public boolean isFocusControl () {
checkWidget();
Predicate<Control> checkFocusControl = (control) -> (control != null && !control.isDisposed() && control.isFocusControl ());
if (checkFocusControl.test(text) || checkFocusControl.test(arrow) ||
- checkFocusControl.test(list) || checkFocusControl.test(popup)) {
+ checkFocusControl.test(list) || checkFocusControl.test(popup)) {
return true;
}
return super.isFocusControl ();
@@ -1732,7 +1732,7 @@ String stripMnemonic (String string) {
}
index++;
} while (index < length);
- return string;
+ return string;
}
void textEvent (Event event) {
switch (event.type) {
@@ -1939,15 +1939,15 @@ void textEvent (Event event) {
}
@Override
public boolean traverse(int event){
- /*
- * When the traverse event is sent to the CCombo, it will create a list of
- * controls to tab to next. Since the CCombo is a composite, the next control is
- * the Text field which is a child of the CCombo. It will set focus to the text
- * field which really is itself. So, call the traverse next events directly on the text.
- */
- if (event == SWT.TRAVERSE_ARROW_NEXT || event == SWT.TRAVERSE_TAB_NEXT) {
- return text.traverse(event);
- }
- return super.traverse(event);
+ /*
+ * When the traverse event is sent to the CCombo, it will create a list of
+ * controls to tab to next. Since the CCombo is a composite, the next control is
+ * the Text field which is a child of the CCombo. It will set focus to the text
+ * field which really is itself. So, call the traverse next events directly on the text.
+ */
+ if (event == SWT.TRAVERSE_ARROW_NEXT || event == SWT.TRAVERSE_TAB_NEXT) {
+ return text.traverse(event);
+ }
+ return super.traverse(event);
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CLabel.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CLabel.java
index 6e441eccb9..832db17164 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CLabel.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CLabel.java
@@ -184,7 +184,7 @@ char _findMnemonic (String string) {
if (string.charAt (index) != '&') return Character.toLowerCase (string.charAt (index));
index++;
} while (index < length);
- return '\0';
+ return '\0';
}
/**
* Returns the horizontal alignment.
@@ -443,15 +443,15 @@ void onPaint(PaintEvent event) {
// shorten the text
if (shortenText) {
extent.x = 0;
- for(int i = 0; i < lines.length; i++) {
- Point e = gc.textExtent(lines[i], DRAW_FLAGS);
- if (e.x > availableWidth) {
- lines[i] = shortenText(gc, lines[i], availableWidth);
- extent.x = Math.max(extent.x, getTotalSize(null, lines[i]).x);
- } else {
- extent.x = Math.max(extent.x, e.x);
- }
- }
+ for(int i = 0; i < lines.length; i++) {
+ Point e = gc.textExtent(lines[i], DRAW_FLAGS);
+ if (e.x > availableWidth) {
+ lines[i] = shortenText(gc, lines[i], availableWidth);
+ extent.x = Math.max(extent.x, getTotalSize(null, lines[i]).x);
+ } else {
+ extent.x = Math.max(extent.x, e.x);
+ }
+ }
if (appToolTipText == null) {
super.setToolTipText(text);
}
@@ -550,32 +550,32 @@ void onPaint(PaintEvent event) {
int lineHeight = 0, textHeight = 0, imageHeight = 0;
if (img != null) {
- imageRect = img.getBounds();
- imageHeight = imageRect.height;
+ imageRect = img.getBounds();
+ imageHeight = imageRect.height;
}
if (lines != null) {
- lineHeight = gc.getFontMetrics().getHeight();
- textHeight = lines.length * lineHeight;
+ lineHeight = gc.getFontMetrics().getHeight();
+ textHeight = lines.length * lineHeight;
}
int imageY = 0, midPoint = 0, lineY = 0;
if (imageHeight > textHeight ) {
- if (topMargin == DEFAULT_MARGIN && bottomMargin == DEFAULT_MARGIN) imageY = rect.y + (rect.height - imageHeight) / 2;
- else imageY = topMargin;
- midPoint = imageY + imageHeight/2;
- lineY = midPoint - textHeight / 2;
+ if (topMargin == DEFAULT_MARGIN && bottomMargin == DEFAULT_MARGIN) imageY = rect.y + (rect.height - imageHeight) / 2;
+ else imageY = topMargin;
+ midPoint = imageY + imageHeight/2;
+ lineY = midPoint - textHeight / 2;
}
else {
- if (topMargin == DEFAULT_MARGIN && bottomMargin == DEFAULT_MARGIN) lineY = rect.y + (rect.height - textHeight) / 2;
- else lineY = topMargin;
- midPoint = lineY + textHeight/2;
- imageY = midPoint - imageHeight / 2;
+ if (topMargin == DEFAULT_MARGIN && bottomMargin == DEFAULT_MARGIN) lineY = rect.y + (rect.height - textHeight) / 2;
+ else lineY = topMargin;
+ midPoint = lineY + textHeight/2;
+ imageY = midPoint - imageHeight / 2;
}
// draw the image
if (img != null) {
gc.drawImage(img, 0, 0, imageRect.width, imageHeight,
- x, imageY, imageRect.width, imageHeight);
+ x, imageY, imageRect.width, imageHeight);
x += imageRect.width + GAP;
extent.x -= imageRect.width + GAP;
}
@@ -820,10 +820,10 @@ public void setBackground(Image image) {
* @since 3.6
*/
public void setBottomMargin(int bottomMargin) {
- checkWidget();
- if (this.bottomMargin == bottomMargin || bottomMargin < 0) return;
- this.bottomMargin = bottomMargin;
- redraw();
+ checkWidget();
+ if (this.bottomMargin == bottomMargin || bottomMargin < 0) return;
+ this.bottomMargin = bottomMargin;
+ redraw();
}
@Override
public void setFont(Font font) {
@@ -861,10 +861,10 @@ public void setImage(Image image) {
* @since 3.6
*/
public void setLeftMargin(int leftMargin) {
- checkWidget();
- if (this.leftMargin == leftMargin || leftMargin < 0) return;
- this.leftMargin = leftMargin;
- redraw();
+ checkWidget();
+ if (this.leftMargin == leftMargin || leftMargin < 0) return;
+ this.leftMargin = leftMargin;
+ redraw();
}
/**
* Set the label's margins, in points.
@@ -901,10 +901,10 @@ public void setMargins (int leftMargin, int topMargin, int rightMargin, int bott
* @since 3.6
*/
public void setRightMargin(int rightMargin) {
- checkWidget();
- if (this.rightMargin == rightMargin || rightMargin < 0) return;
- this.rightMargin = rightMargin;
- redraw();
+ checkWidget();
+ if (this.rightMargin == rightMargin || rightMargin < 0) return;
+ this.rightMargin = rightMargin;
+ redraw();
}
/**
* Set the label's text.
@@ -956,10 +956,10 @@ public void setToolTipText (String string) {
* @since 3.6
*/
public void setTopMargin(int topMargin) {
- checkWidget();
- if (this.topMargin == topMargin || topMargin < 0) return;
- this.topMargin = topMargin;
- redraw();
+ checkWidget();
+ if (this.topMargin == topMargin || topMargin < 0) return;
+ this.topMargin = topMargin;
+ redraw();
}
/**
* Shorten the given text <code>t</code> so that its length doesn't exceed
@@ -1001,7 +1001,7 @@ protected String shortenText(GC gc, String t, int width) {
}
String result = mid == 0 ? t : t.substring(0, mid) + ELLIPSIS + t.substring(validateOffset(layout, l-mid), l);
layout.dispose();
- return result;
+ return result;
}
int validateOffset(TextLayout layout, int offset) {
int nextOffset = layout.getNextOffset(offset, SWT.MOVEMENT_CLUSTER);
@@ -1009,21 +1009,21 @@ int validateOffset(TextLayout layout, int offset) {
return offset;
}
private String[] splitString(String text) {
- String[] lines = new String[1];
- int start = 0, pos;
- do {
- pos = text.indexOf('\n', start);
- if (pos == -1) {
- lines[lines.length - 1] = text.substring(start);
- } else {
- boolean crlf = (pos > 0) && (text.charAt(pos - 1) == '\r');
- lines[lines.length - 1] = text.substring(start, pos - (crlf ? 1 : 0));
- start = pos + 1;
- String[] newLines = new String[lines.length+1];
- System.arraycopy(lines, 0, newLines, 0, lines.length);
- lines = newLines;
- }
- } while (pos != -1);
- return lines;
+ String[] lines = new String[1];
+ int start = 0, pos;
+ do {
+ pos = text.indexOf('\n', start);
+ if (pos == -1) {
+ lines[lines.length - 1] = text.substring(start);
+ } else {
+ boolean crlf = (pos > 0) && (text.charAt(pos - 1) == '\r');
+ lines[lines.length - 1] = text.substring(start, pos - (crlf ? 1 : 0));
+ start = pos + 1;
+ String[] newLines = new String[lines.length+1];
+ System.arraycopy(lines, 0, newLines, 0, lines.length);
+ lines = newLines;
+ }
+ } while (pos != -1);
+ return lines;
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java
index ac44a29a6b..b9ef1e6233 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java
@@ -62,16 +62,16 @@ public class CTabFolder extends Composite {
*
* The default value is 0.
*/
- public int marginWidth = 0;
+ public int marginWidth = 0;
/**
* marginHeight specifies the number of points of vertical margin
* that will be placed along the top and bottom edges of the form.
*
* The default value is 0.
*/
- public int marginHeight = 0;
+ public int marginHeight = 0;
- /**
+ /**
* A multiple of the tab height that specifies the minimum width to which a tab
* will be compressed before scrolling arrows are used to navigate the tabs.
*
@@ -611,7 +611,7 @@ Rectangle[] computeControlBounds (Point size, boolean[][] position) {
for (int i = 0; i < controls.length; i++) {
int alignment = controlAlignments[i];
if ((alignment & SWT.TRAIL) != 0 && (alignment & SWT.FILL) != 0 && !overflow[i]) {
- fillCount++;
+ fillCount++;
}
}
if (fillCount != 0) {
@@ -996,7 +996,7 @@ char _findMnemonic (String string) {
if (string.charAt (index) != '&') return Character.toLowerCase (string.charAt (index));
index++;
} while (index < length);
- return '\0';
+ return '\0';
}
String stripMnemonic (String string) {
int index = 0;
@@ -1009,7 +1009,7 @@ String stripMnemonic (String string) {
}
index++;
} while (index < length);
- return string;
+ return string;
}
/**
* Returns <code>true</code> if the receiver is minimized.
@@ -1742,8 +1742,8 @@ boolean onMnemonic (Event event, boolean doit) {
if (mnemonic != '\0') {
if (Character.toLowerCase (key) == mnemonic) {
if (doit) {
- setSelection(i, true);
- forceFocus();
+ setSelection(i, true);
+ forceFocus();
}
return true;
}
@@ -1872,12 +1872,12 @@ void onMouse(Event event) {
}
int index = indexOf(item);
if (item.showing){
- int oldSelectedIndex = selectedIndex;
- setSelection(index, true);
- if (oldSelectedIndex == selectedIndex) {
- /* If the click is on the selected tabitem, then set focus to the tabfolder */
- forceFocus();
- }
+ int oldSelectedIndex = selectedIndex;
+ setSelection(index, true);
+ if (oldSelectedIndex == selectedIndex) {
+ /* If the click is on the selected tabitem, then set focus to the tabfolder */
+ forceFocus();
+ }
}
return;
}
@@ -2436,18 +2436,18 @@ public void setBackground(Color[] colors, int[] percents, boolean vertical) {
(gradientColors.length == colors.length)) {
boolean same = false;
for (int i = 0; i < gradientColors.length; i++) {
- if (gradientColors[i] == null) {
+ if (gradientColors[i] == null) {
same = colors[i] == null;
- } else {
+ } else {
same = gradientColors[i].equals(colors[i]);
- }
- if (!same) break;
+ }
+ if (!same) break;
}
if (same) {
- for (int i = 0; i < gradientPercents.length; i++) {
+ for (int i = 0; i < gradientPercents.length; i++) {
same = gradientPercents[i] == percents[i];
if (!same) break;
- }
+ }
}
if (same && this.gradientVertical == vertical) return;
}
@@ -2475,9 +2475,9 @@ public void setBackground(Color[] colors, int[] percents, boolean vertical) {
}
@Override
public void setBackgroundImage(Image image) {
- super.setBackgroundImage(image);
- renderer.createAntialiasColors(); //TODO: need better caching strategy
- redraw();
+ super.setBackgroundImage(image);
+ renderer.createAntialiasColors(); //TODO: need better caching strategy
+ redraw();
}
/**
* Toggle the visibility of the border
@@ -2567,7 +2567,7 @@ void setButtonBounds(GC gc) {
chevronImage = createButtonImage(display, CTabFolderRenderer.PART_CHEVRON_BUTTON);
chevronItem.setImage(chevronImage);
}
- }
+ }
boolean[][] overflow = new boolean[1][0];
Rectangle[] rects = computeControlBounds(size, overflow);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderEvent.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderEvent.java
index f8a0ef3b7b..8bc5afa16e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderEvent.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderEvent.java
@@ -26,24 +26,24 @@ public class CTabFolderEvent extends TypedEvent {
/**
* The tab item for the operation.
*/
- public Widget item;
+ public Widget item;
- /**
+ /**
* A flag indicating whether the operation should be allowed.
* Setting this field to <code>false</code> will cancel the operation.
* Applies to the close and showList events.
*/
- public boolean doit;
+ public boolean doit;
/**
* The widget-relative, x coordinate of the chevron button
* at the time of the event. Applies to the showList event.
*
- * @since 3.0
+ * @since 3.0
*/
- public int x;
- /**
- * The widget-relative, y coordinate of the chevron button
+ public int x;
+ /**
+ * The widget-relative, y coordinate of the chevron button
* at the time of the event. Applies to the showList event.
*
* @since 3.0
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderRenderer.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderRenderer.java
index 6be28cddda..fdb509b943 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderRenderer.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderRenderer.java
@@ -459,45 +459,45 @@ public class CTabFolderRenderer {
}
void createAntialiasColors() {
- disposeAntialiasColors();
- lastBorderColor = parent.getDisplay().getSystemColor(BORDER1_COLOR);
- RGB lineRGB = lastBorderColor.getRGB();
- /* compute the selected color */
- RGB innerRGB = parent.selectionBackground.getRGB();
- if (parent.selectionBgImage != null ||
- (parent.selectionGradientColors != null && parent.selectionGradientColors.length > 1)) {
- innerRGB = null;
- }
- RGB outerRGB = parent.getBackground().getRGB();
- if (parent.gradientColors != null && parent.gradientColors.length > 1) {
- outerRGB = null;
- }
- if (outerRGB != null) {
+ disposeAntialiasColors();
+ lastBorderColor = parent.getDisplay().getSystemColor(BORDER1_COLOR);
+ RGB lineRGB = lastBorderColor.getRGB();
+ /* compute the selected color */
+ RGB innerRGB = parent.selectionBackground.getRGB();
+ if (parent.selectionBgImage != null ||
+ (parent.selectionGradientColors != null && parent.selectionGradientColors.length > 1)) {
+ innerRGB = null;
+ }
+ RGB outerRGB = parent.getBackground().getRGB();
+ if (parent.gradientColors != null && parent.gradientColors.length > 1) {
+ outerRGB = null;
+ }
+ if (outerRGB != null) {
RGB from = lineRGB;
RGB to = outerRGB;
int red = from.red + 2*(to.red - from.red)/3;
int green = from.green + 2*(to.green - from.green)/3;
int blue = from.blue + 2*(to.blue - from.blue)/3;
selectedOuterColor = new Color(parent.getDisplay(), red, green, blue);
- }
- if (innerRGB != null) {
+ }
+ if (innerRGB != null) {
RGB from = lineRGB;
RGB to = innerRGB;
int red = from.red + 2*(to.red - from.red)/3;
int green = from.green + 2*(to.green - from.green)/3;
int blue = from.blue + 2*(to.blue - from.blue)/3;
selectedInnerColor = new Color(parent.getDisplay(), red, green, blue);
- }
- /* compute the tabArea color */
- outerRGB = parent.getParent().getBackground().getRGB();
- if (outerRGB != null) {
+ }
+ /* compute the tabArea color */
+ outerRGB = parent.getParent().getBackground().getRGB();
+ if (outerRGB != null) {
RGB from = lineRGB;
RGB to = outerRGB;
int red = from.red + 2*(to.red - from.red)/3;
int green = from.green + 2*(to.green - from.green)/3;
int blue = from.blue + 2*(to.blue - from.blue)/3;
tabAreaColor = new Color(parent.getDisplay(), red, green, blue);
- }
+ }
}
/*
@@ -543,8 +543,8 @@ public class CTabFolderRenderer {
disposeAntialiasColors();
disposeSelectionHighlightGradientColors();
if (fillColor != null) {
- fillColor.dispose();
- fillColor = null;
+ fillColor.dispose();
+ fillColor = null;
}
if (chevronFont != null) {
chevronFont.dispose();
@@ -557,10 +557,10 @@ public class CTabFolderRenderer {
}
void disposeAntialiasColors() {
- if (tabAreaColor != null) tabAreaColor.dispose();
- if (selectedInnerColor != null) selectedInnerColor.dispose();
- if (selectedOuterColor != null) selectedOuterColor.dispose();
- tabAreaColor = selectedInnerColor = selectedOuterColor = null;
+ if (tabAreaColor != null) tabAreaColor.dispose();
+ if (selectedInnerColor != null) selectedInnerColor.dispose();
+ if (selectedOuterColor != null) selectedOuterColor.dispose();
+ tabAreaColor = selectedInnerColor = selectedOuterColor = null;
}
void disposeSelectionHighlightGradientColors() {
@@ -812,7 +812,7 @@ public class CTabFolderRenderer {
int x2 = size.x - borderRight;
int y2 = size.y - borderBottom - tabHeight - highlight_header;
shape = new int[] {x1,y1, x2,y1, x2,y2, x2-highlight_margin,y2,
- x2-highlight_margin, y1+highlight_margin, x1+highlight_margin,y1+highlight_margin,
+ x2-highlight_margin, y1+highlight_margin, x1+highlight_margin,y1+highlight_margin,
x1+highlight_margin,y2, x1,y2};
} else {
int x1 = borderLeft;
@@ -820,7 +820,7 @@ public class CTabFolderRenderer {
int x2 = size.x - borderRight;
int y2 = size.y - borderBottom;
shape = new int[] {x1,y1, x1+highlight_margin,y1, x1+highlight_margin,y2-highlight_margin,
- x2-highlight_margin,y2-highlight_margin, x2-highlight_margin,y1,
+ x2-highlight_margin,y2-highlight_margin, x2-highlight_margin,y1,
x2,y1, x2,y2, x1,y2};
}
// If horizontal gradient, show gradient across the whole area
@@ -886,9 +886,9 @@ public class CTabFolderRenderer {
switch (closeImageState & (SWT.HOT | SWT.SELECTED | SWT.BACKGROUND)) {
case SWT.NONE: {
int[] shape = new int[] {x,y, x+2,y, x+4,y+2, x+5,y+2, x+7,y, x+9,y,
- x+9,y+2, x+7,y+4, x+7,y+5, x+9,y+7, x+9,y+9,
- x+7,y+9, x+5,y+7, x+4,y+7, x+2,y+9, x,y+9,
- x,y+7, x+2,y+5, x+2,y+4, x,y+2};
+ x+9,y+2, x+7,y+4, x+7,y+5, x+9,y+7, x+9,y+9,
+ x+7,y+9, x+5,y+7, x+4,y+7, x+2,y+9, x,y+9,
+ x,y+7, x+2,y+5, x+2,y+4, x,y+2};
gc.setBackground(display.getSystemColor(BUTTON_FILL));
gc.fillPolygon(shape);
gc.setForeground(closeBorder);
@@ -897,9 +897,9 @@ public class CTabFolderRenderer {
}
case SWT.HOT: {
int[] shape = new int[] {x,y, x+2,y, x+4,y+2, x+5,y+2, x+7,y, x+9,y,
- x+9,y+2, x+7,y+4, x+7,y+5, x+9,y+7, x+9,y+9,
- x+7,y+9, x+5,y+7, x+4,y+7, x+2,y+9, x,y+9,
- x,y+7, x+2,y+5, x+2,y+4, x,y+2};
+ x+9,y+2, x+7,y+4, x+7,y+5, x+9,y+7, x+9,y+9,
+ x+7,y+9, x+5,y+7, x+4,y+7, x+2,y+9, x,y+9,
+ x,y+7, x+2,y+5, x+2,y+4, x,y+2};
gc.setBackground(getFillColor());
gc.fillPolygon(shape);
gc.setForeground(closeBorder);
@@ -908,9 +908,9 @@ public class CTabFolderRenderer {
}
case SWT.SELECTED: {
int[] shape = new int[] {x+1,y+1, x+3,y+1, x+5,y+3, x+6,y+3, x+8,y+1, x+10,y+1,
- x+10,y+3, x+8,y+5, x+8,y+6, x+10,y+8, x+10,y+10,
- x+8,y+10, x+6,y+8, x+5,y+8, x+3,y+10, x+1,y+10,
- x+1,y+8, x+3,y+6, x+3,y+5, x+1,y+3};
+ x+10,y+3, x+8,y+5, x+8,y+6, x+10,y+8, x+10,y+10,
+ x+8,y+10, x+6,y+8, x+5,y+8, x+3,y+10, x+1,y+10,
+ x+1,y+8, x+3,y+6, x+3,y+5, x+1,y+3};
gc.setBackground(getFillColor());
gc.fillPolygon(shape);
gc.setForeground(closeBorder);
@@ -1617,8 +1617,8 @@ public class CTabFolderRenderer {
// Draw border line
if (borderLeft > 0) {
- if (! borderColor.equals(lastBorderColor)) createAntialiasColors();
- antialias(shape, null, tabAreaColor, gc);
+ if (! borderColor.equals(lastBorderColor)) createAntialiasColors();
+ antialias(shape, null, tabAreaColor, gc);
gc.setForeground(borderColor);
gc.drawPolyline(shape);
}
@@ -1664,8 +1664,8 @@ public class CTabFolderRenderer {
imageY += parent.onBottom ? -1 : 1;
int imageWidth = imageBounds.width * imageHeight / imageBounds.height;
gc.drawImage(image,
- imageBounds.x, imageBounds.y, imageBounds.width, imageBounds.height,
- imageX, imageY, imageWidth, imageHeight);
+ imageBounds.x, imageBounds.y, imageBounds.width, imageBounds.height,
+ imageX, imageY, imageWidth, imageHeight);
xDraw += imageWidth + INTERNAL_SPACING;
}
}
@@ -1809,15 +1809,15 @@ public class CTabFolderRenderer {
if (parent.onBottom) {
int d = tabHeight - 12;
curve = new int[]{0,13+d, 0,12+d, 2,12+d, 3,11+d, 5,11+d, 6,10+d, 7,10+d, 9,8+d, 10,8+d,
- 11,7+d, 11+d,7,
- 12+d,6, 13+d,6, 15+d,4, 16+d,4, 17+d,3, 19+d,3, 20+d,2, 22+d,2, 23+d,1};
+ 11,7+d, 11+d,7,
+ 12+d,6, 13+d,6, 15+d,4, 16+d,4, 17+d,3, 19+d,3, 20+d,2, 22+d,2, 23+d,1};
curveWidth = 26+d;
curveIndent = curveWidth/3;
} else {
int d = tabHeight - 12;
curve = new int[]{0,0, 0,1, 2,1, 3,2, 5,2, 6,3, 7,3, 9,5, 10,5,
- 11,6, 11+d,6+d,
- 12+d,7+d, 13+d,7+d, 15+d,9+d, 16+d,9+d, 17+d,10+d, 19+d,10+d, 20+d,11+d, 22+d,11+d, 23+d,12+d};
+ 11,6, 11+d,6+d,
+ 12+d,7+d, 13+d,7+d, 15+d,9+d, 16+d,9+d, 17+d,10+d, 19+d,10+d, 20+d,11+d, 22+d,11+d, 23+d,12+d};
curveWidth = 26+d;
curveIndent = curveWidth/3;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem.java
index 4437324e43..eee6a7ab26 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem.java
@@ -307,14 +307,14 @@ public void setControl (Control control) {
this.control.setBounds(parent.getClientArea ());
this.control.setVisible(true);
} else {
- int selectedIndex = parent.getSelectionIndex();
- Control selectedControl = null;
- if (selectedIndex != -1) {
- selectedControl = parent.getItem(selectedIndex).control;
- }
- if (this.control != selectedControl) {
- this.control.setVisible(false);
- }
+ int selectedIndex = parent.getSelectionIndex();
+ Control selectedControl = null;
+ if (selectedIndex != -1) {
+ selectedControl = parent.getItem(selectedIndex).control;
+ }
+ if (this.control != selectedControl) {
+ this.control.setVisible(false);
+ }
}
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ControlEditor.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ControlEditor.java
index d9a552224d..7ac70ed8a9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ControlEditor.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ControlEditor.java
@@ -213,8 +213,8 @@ public void layout () {
if (editor.getVisible ()) {
hadFocus = editor.isFocusControl();
} // this doesn't work because
- // resizing the column takes the focus away
- // before we get here
+ // resizing the column takes the focus away
+ // before we get here
editor.setBounds (computeBounds ());
if (hadFocus) {
if (editor == null || editor.isDisposed()) return;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StackLayout.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StackLayout.java
index 9b23d0c343..cf3c5f2c5e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StackLayout.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StackLayout.java
@@ -71,13 +71,13 @@ import org.eclipse.swt.widgets.*;
public class StackLayout extends Layout {
- /**
+ /**
* marginWidth specifies the number of points of horizontal margin
* that will be placed along the left and right edges of the layout.
*
* The default value is 0.
*/
- public int marginWidth = 0;
+ public int marginWidth = 0;
/**
* marginHeight specifies the number of points of vertical margin
* that will be placed along the top and bottom edges of the layout.
@@ -86,11 +86,11 @@ public class StackLayout extends Layout {
*/
public int marginHeight = 0;
- /**
- * topControl the Control that is displayed at the top of the stack.
- * All other controls that are children of the parent composite will not be visible.
- */
- public Control topControl;
+ /**
+ * topControl the Control that is displayed at the top of the stack.
+ * All other controls that are children of the parent composite will not be visible.
+ */
+ public Control topControl;
@Override
protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) {
@@ -143,12 +143,12 @@ String getName () {
*/
@Override
public String toString () {
- String string = getName ()+" {";
- if (marginWidth != 0) string += "marginWidth="+marginWidth+" ";
- if (marginHeight != 0) string += "marginHeight="+marginHeight+" ";
- if (topControl != null) string += "topControl="+topControl+" ";
- string = string.trim();
- string += "}";
- return string;
+ String string = getName ()+" {";
+ if (marginWidth != 0) string += "marginWidth="+marginWidth+" ";
+ if (marginHeight != 0) string += "marginHeight="+marginHeight+" ";
+ if (topControl != null) string += "topControl="+topControl+" ";
+ string = string.trim();
+ string += "}";
+ return string;
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
index 487e18bfaf..676bc7ff1d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
@@ -2890,7 +2890,7 @@ int doMouseWordSelect(int x, int newCaretOffset, int line) {
// base double click. Always do this here (and don't rely on doAutoScroll)
// because auto scroll only does not cover all possible mouse selections
// (e.g., mouse x < 0 && mouse y > caret line y)
- if (newCaretOffset < selectionAnchor && selectionAnchor == selection.x) {
+ if (newCaretOffset < selectionAnchor && selectionAnchor == selection.x) {
selectionAnchor = doubleClickSelection.y;
} else if (newCaretOffset > selectionAnchor && selectionAnchor == selection.y) {
selectionAnchor = doubleClickSelection.x;
@@ -5407,7 +5407,7 @@ int getVisualLineIndex(TextLayout layout, int offsetInLine) {
int caretY = caret.getLocation().y - getLinePixel(getCaretLine());
if (lineY > caretY) lineIndex--;
caretAlignment = OFFSET_LEADING;
- }
+ }
return lineIndex;
}
int getCaretDirection() {
@@ -6062,8 +6062,8 @@ void handleKey(Event event) {
// -ignore anything below SPACE except for line delimiter keys and tab.
// -ignore DEL
if (!ignore && event.character > 31 && event.character != SWT.DEL ||
- event.character == SWT.CR || event.character == SWT.LF ||
- event.character == TAB) {
+ event.character == SWT.CR || event.character == SWT.LF ||
+ event.character == TAB) {
doContent(event.character);
update();
}
@@ -6872,28 +6872,28 @@ void initializeAccessible() {
public void replaceText(AccessibleEditableTextEvent e) {
StyledText st = StyledText.this;
st.replaceTextRange(e.start, e.end - e.start, e.string);
- e.result = ACC.OK;
+ e.result = ACC.OK;
}
@Override
public void pasteText(AccessibleEditableTextEvent e) {
StyledText st = StyledText.this;
st.setSelection(e.start);
- st.paste();
- e.result = ACC.OK;
+ st.paste();
+ e.result = ACC.OK;
}
@Override
public void cutText(AccessibleEditableTextEvent e) {
StyledText st = StyledText.this;
st.setSelection(e.start, e.end);
- st.cut();
- e.result = ACC.OK;
+ st.cut();
+ e.result = ACC.OK;
}
@Override
public void copyText(AccessibleEditableTextEvent e) {
StyledText st = StyledText.this;
st.setSelection(e.start, e.end);
- st.copy();
- e.result = ACC.OK;
+ st.copy();
+ e.result = ACC.OK;
}
};
acc.addAccessibleEditableTextListener(accEditableTextListener);
@@ -7059,7 +7059,7 @@ String stripMnemonic (String string) {
}
index++;
} while (index < length);
- return string;
+ return string;
}
/*
* Return the lowercase of the first non-'&' character following
@@ -7076,7 +7076,7 @@ char _findMnemonic (String string) {
if (string.charAt (index) != '&') return Character.toLowerCase (string.charAt (index));
index++;
} while (index < length);
- return '\0';
+ return '\0';
}
/**
* Executes the action.
@@ -7996,8 +7996,8 @@ public void removeWordMovementListener(MovementListener listener) {
public void replaceStyleRanges(int start, int length, StyleRange[] ranges) {
checkWidget();
if (isListening(ST.LineGetStyle)) return;
- if (ranges == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
- setStyleRanges(start, length, null, ranges, false);
+ if (ranges == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ setStyleRanges(start, length, null, ranges, false);
}
/**
* Replaces the given text range with new text.
@@ -9142,20 +9142,20 @@ public void setKeyBinding(int key, int action) {
if (action == SWT.NULL) {
keyActionMap.remove(newKey);
} else {
- keyActionMap.put(newKey, action);
+ keyActionMap.put(newKey, action);
}
ch = Character.toLowerCase(keyChar);
newKey = ch | modifierValue;
if (action == SWT.NULL) {
keyActionMap.remove(newKey);
} else {
- keyActionMap.put(newKey, action);
+ keyActionMap.put(newKey, action);
}
} else {
if (action == SWT.NULL) {
keyActionMap.remove(key);
} else {
- keyActionMap.put(key, action);
+ keyActionMap.put(key, action);
}
}
}
@@ -10410,7 +10410,7 @@ private int endRangeOffset(int[] ranges, int styleIndex) {
public void setStyleRanges(StyleRange[] ranges) {
checkWidget();
if (isListening(ST.LineGetStyle)) return;
- if (ranges == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (ranges == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
setStyleRanges(0, 0, null, ranges, true);
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TableCursor.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TableCursor.java
index fac86edaab..48dead764b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TableCursor.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TableCursor.java
@@ -240,26 +240,26 @@ void keyDown(Event event) {
case SWT.ARROW_DOWN :
setRowColumn(Math.min(rowIndex + 1, table.getItemCount() - 1), columnIndex, true);
break;
- case SWT.ARROW_LEFT :
- case SWT.ARROW_RIGHT :
- {
- int columnCount = table.getColumnCount();
- if (columnCount == 0) break;
- int[] order = table.getColumnOrder();
- int index = 0;
- while (index < order.length) {
- if (order[index] == columnIndex) break;
- index++;
+ case SWT.ARROW_LEFT :
+ case SWT.ARROW_RIGHT :
+ {
+ int columnCount = table.getColumnCount();
+ if (columnCount == 0) break;
+ int[] order = table.getColumnOrder();
+ int index = 0;
+ while (index < order.length) {
+ if (order[index] == columnIndex) break;
+ index++;
}
if (index == order.length) index = 0;
- int leadKey = (getStyle() & SWT.RIGHT_TO_LEFT) != 0 ? SWT.ARROW_RIGHT : SWT.ARROW_LEFT;
- if (event.keyCode == leadKey) {
- setRowColumn(rowIndex, order[Math.max(0, index - 1)], true);
- } else {
- setRowColumn(rowIndex, order[Math.min(columnCount - 1, index + 1)], true);
- }
- break;
- }
+ int leadKey = (getStyle() & SWT.RIGHT_TO_LEFT) != 0 ? SWT.ARROW_RIGHT : SWT.ARROW_LEFT;
+ if (event.keyCode == leadKey) {
+ setRowColumn(rowIndex, order[Math.max(0, index - 1)], true);
+ } else {
+ setRowColumn(rowIndex, order[Math.min(columnCount - 1, index + 1)], true);
+ }
+ break;
+ }
case SWT.HOME :
setRowColumn(0, columnIndex, true);
break;
@@ -633,7 +633,7 @@ public void setSelection(int row, int column) {
int columnCount = table.getColumnCount();
int maxColumnIndex = columnCount == 0 ? 0 : columnCount - 1;
if (row < 0
- || row >= table.getItemCount()
+ || row >= table.getItemCount()
|| column < 0
|| column > maxColumnIndex)
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ViewForm.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ViewForm.java
index cb5615c579..af2dde8b89 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ViewForm.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ViewForm.java
@@ -49,29 +49,29 @@ public class ViewForm extends Composite {
*
* The default value is 0.
*/
- public int marginWidth = 0;
+ public int marginWidth = 0;
/**
* marginHeight specifies the number of points of vertical margin
* that will be placed along the top and bottom edges of the form.
*
* The default value is 0.
*/
- public int marginHeight = 0;
- /**
+ public int marginHeight = 0;
+ /**
* horizontalSpacing specifies the number of points between the right
* edge of one cell and the left edge of its neighbouring cell to
* the right.
*
* The default value is 1.
*/
- public int horizontalSpacing = 1;
+ public int horizontalSpacing = 1;
/**
* verticalSpacing specifies the number of points between the bottom
* edge of one cell and the top edge of its neighbouring cell underneath.
*
* The default value is 1.
*/
- public int verticalSpacing = 1;
+ public int verticalSpacing = 1;
/**
* Color of innermost line of drop shadow border.
@@ -288,7 +288,7 @@ void onPaint(GC gc) {
int x2 = size.x - 1;
int y2 = size.y - 1;
int[] shape = new int[] {x1,y1, x2,y1, x2,y2, x1,y2, x1,y1+highlight,
- x1+highlight,y1+highlight, x1+highlight,y2-highlight,
+ x1+highlight,y1+highlight, x1+highlight,y2-highlight,
x2-highlight,y2-highlight, x2-highlight,y1+highlight, x1,y1+highlight};
Color highlightColor = getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION);
gc.setBackground(highlightColor);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ViewFormLayout.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ViewFormLayout.java
index b029028d9f..c9245b49b2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ViewFormLayout.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ViewFormLayout.java
@@ -38,16 +38,16 @@ protected Point computeSize(Composite composite, int wHint, int hHint, boolean f
}
Point centerSize = new Point(0, 0);
if (center != null) {
- centerSize = computeChildSize(center, SWT.DEFAULT, SWT.DEFAULT, flushCache);
+ centerSize = computeChildSize(center, SWT.DEFAULT, SWT.DEFAULT, flushCache);
}
Point rightSize = new Point(0, 0);
if (right != null) {
- rightSize = computeChildSize(right, SWT.DEFAULT, SWT.DEFAULT, flushCache);
+ rightSize = computeChildSize(right, SWT.DEFAULT, SWT.DEFAULT, flushCache);
}
Point size = new Point(0, 0);
// calculate width of title bar
if (form.separateTopCenter ||
- (wHint != SWT.DEFAULT && leftSize.x + centerSize.x + rightSize.x > wHint)) {
+ (wHint != SWT.DEFAULT && leftSize.x + centerSize.x + rightSize.x > wHint)) {
size.x = leftSize.x + rightSize.x;
if (leftSize.x > 0 && rightSize.x > 0) size.x += form.horizontalSpacing;
size.x = Math.max(centerSize.x, size.x);
@@ -124,11 +124,11 @@ protected void layout(Composite composite, boolean flushCache) {
}
Point centerSize = new Point(0, 0);
if (center != null && !center.isDisposed()) {
- centerSize = computeChildSize(center, SWT.DEFAULT, SWT.DEFAULT, flushCache);
+ centerSize = computeChildSize(center, SWT.DEFAULT, SWT.DEFAULT, flushCache);
}
Point rightSize = new Point(0, 0);
if (right != null && !right.isDisposed()) {
- rightSize = computeChildSize(right, SWT.DEFAULT, SWT.DEFAULT, flushCache);
+ rightSize = computeChildSize(right, SWT.DEFAULT, SWT.DEFAULT, flushCache);
}
int minTopWidth = leftSize.x + centerSize.x + rightSize.x + 2*form.marginWidth + 2*form.highlight;
@@ -200,7 +200,7 @@ protected void layout(Composite composite, boolean flushCache) {
form.separator = y;
y++;
}
- content.setBounds(rect.x + form.marginWidth + form.highlight, y, rect.width - 2 * form.marginWidth - 2*form.highlight, rect.y + rect.height - y - form.marginHeight - form.highlight);
+ content.setBounds(rect.x + form.marginWidth + form.highlight, y, rect.width - 2 * form.marginWidth - 2*form.highlight, rect.y + rect.height - y - form.marginHeight - form.highlight);
}
if (oldSeperator != form.separator) {
int t, b;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DropTarget.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DropTarget.java
index 11c0fc8239..486f942017 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DropTarget.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DropTarget.java
@@ -833,9 +833,9 @@ boolean setEventData(NSObject draggingState, DNDEvent event) {
int operation = getOperationFromKeyState();
keyOperation = operation;
if (operation == DND.DROP_DEFAULT) {
- if ((style & DND.DROP_DEFAULT) == 0) {
+ if ((style & DND.DROP_DEFAULT) == 0) {
operation = (operations & DND.DROP_MOVE) != 0 ? DND.DROP_MOVE : DND.DROP_NONE;
- }
+ }
} else {
if ((operation & operations) == 0) operation = DND.DROP_NONE;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common/org/eclipse/swt/dnd/DragSourceEvent.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common/org/eclipse/swt/dnd/DragSourceEvent.java
index fc328e1df0..3b287c5b09 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common/org/eclipse/swt/dnd/DragSourceEvent.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common/org/eclipse/swt/dnd/DragSourceEvent.java
@@ -31,25 +31,25 @@ public class DragSourceEvent extends TypedEvent {
* @see DND#DROP_LINK
* @see DND#DROP_TARGET_MOVE
*/
- public int detail;
+ public int detail;
- /**
- * In dragStart, the doit field determines if the drag and drop operation
- * should proceed; in dragFinished, the doit field indicates whether
- * the operation was performed successfully.
- * <p>
- * In dragStart:</p>
- * <p>Flag to determine if the drag and drop operation should proceed.
- * The application can set this value to false to prevent the drag from starting.
- * Set to true by default.</p>
- * <p>In dragSetData:</p>
- * <p>This will be set to true when the call to dragSetData is made. Set it to
- * false to cancel the drag.</p>
- * <p>In dragFinished:</p>
- * <p>Flag to indicate if the operation was performed successfully.
- * True if the operation was performed successfully.</p>
- */
- public boolean doit;
+ /**
+ * In dragStart, the doit field determines if the drag and drop operation
+ * should proceed; in dragFinished, the doit field indicates whether
+ * the operation was performed successfully.
+ * <p>
+ * In dragStart:</p>
+ * <p>Flag to determine if the drag and drop operation should proceed.
+ * The application can set this value to false to prevent the drag from starting.
+ * Set to true by default.</p>
+ * <p>In dragSetData:</p>
+ * <p>This will be set to true when the call to dragSetData is made. Set it to
+ * false to cancel the drag.</p>
+ * <p>In dragFinished:</p>
+ * <p>Flag to indicate if the operation was performed successfully.
+ * True if the operation was performed successfully.</p>
+ */
+ public boolean doit;
/**
* In dragStart, the x coordinate (relative to the control) of the
@@ -57,19 +57,19 @@ public class DragSourceEvent extends TypedEvent {
*
* @since 3.2
*/
- public int x;
- /**
+ public int x;
+ /**
* In dragStart, the y coordinate (relative to the control) of the
* position the mouse went down to start the drag.
*
* @since 3.2
*/
- public int y;
+ public int y;
- /**
+ /**
* The type of data requested.
* Data provided in the data field must be of the same type.
- */
+ */
public TransferData dataType;
/**
@@ -86,13 +86,13 @@ public class DragSourceEvent extends TypedEvent {
*
* @since 3.5
*/
- public int offsetX;
+ public int offsetX;
/**
* In dragStart, the y offset (relative to the image) where the drag source image will be displayed.
*
* @since 3.5
*/
- public int offsetY;
+ public int offsetY;
static final long serialVersionUID = 3257002142513770808L;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DropTarget.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DropTarget.java
index 35e0c4e9f1..7daca526bd 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DropTarget.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DropTarget.java
@@ -109,7 +109,7 @@ public class DropTarget extends Widget {
static Callback Drag_Data_Received;
static Callback Drag_Drop;
- static {
+ static {
Drag_Motion = new Callback(DropTarget.class, "Drag_Motion", 5); //$NON-NLS-1$
if (Drag_Motion.getAddress() == 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS);
Drag_Leave = new Callback(DropTarget.class, "Drag_Leave", 3); //$NON-NLS-1$
@@ -155,7 +155,7 @@ public DropTarget(Control control, int style) {
super(control, checkStyle(style));
this.control = control;
if (Drag_Motion == null || Drag_Leave == null || Drag_Data_Received == null || Drag_Drop == null) {
- DND.error(DND.ERROR_CANNOT_INIT_DROP);
+ DND.error(DND.ERROR_CANNOT_INIT_DROP);
}
if (control.getData(DND.DROP_TARGET_KEY) != null) {
DND.error(DND.ERROR_CANNOT_INIT_DROP);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/ImageTransfer.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/ImageTransfer.java
index 34fa8fee05..f092e5d2fd 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/ImageTransfer.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/ImageTransfer.java
@@ -91,7 +91,7 @@ public void javaToNative(Object object, TransferData transferData) {
ImageData imgData = (ImageData)object;
if (imgData == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
Image image = new Image(Display.getCurrent(), imgData);
- long pixbuf = ImageList.createPixbuf(image);
+ long pixbuf = ImageList.createPixbuf(image);
if (pixbuf != 0) {
String typeStr = "";
if (transferData.type == JPEG_ID) typeStr = "jpeg";
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TransferData.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TransferData.java
index b718c66a99..3ff822475e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TransferData.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TransferData.java
@@ -63,17 +63,17 @@ public class TransferData {
/**
* Specifies the size in bits of a single unit in pValue.
- * (Warning: This field is platform dependent)
+ * (Warning: This field is platform dependent)
* <p>
* <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
* public API. It is marked public only so that it can be shared
* within the packages provided by SWT. It is not available on all
* platforms and should never be accessed from application code.
* </p>
- *
- * This is most commonly 8 bits.
- *
- * @noreference This field is not intended to be referenced by clients.
+ *
+ * This is most commonly 8 bits.
+ *
+ * @noreference This field is not intended to be referenced by clients.
*/
public int format;
@@ -101,7 +101,7 @@ public class TransferData {
* within the packages provided by SWT. It is not available on all
* platforms and should never be accessed from application code.
* </p>
- * <p>The value of result is 1 if the conversion was successful.
+ * <p>The value of result is 1 if the conversion was successful.
* The value of result is 0 if the conversion failed.</p>
*
* @noreference This field is not intended to be referenced by clients.
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/ByteArrayTransfer.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/ByteArrayTransfer.java
index da236b440b..a0c13fb230 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/ByteArrayTransfer.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/ByteArrayTransfer.java
@@ -146,9 +146,9 @@ public boolean isSupportedType(TransferData transferData){
for (int i = 0; i < types.length; i++) {
FORMATETC format = transferData.formatetc;
if (format.cfFormat == types[i] &&
- (format.dwAspect & COM.DVASPECT_CONTENT) == COM.DVASPECT_CONTENT &&
- (format.tymed & COM.TYMED_HGLOBAL) == COM.TYMED_HGLOBAL )
- return true;
+ (format.dwAspect & COM.DVASPECT_CONTENT) == COM.DVASPECT_CONTENT &&
+ (format.tymed & COM.TYMED_HGLOBAL) == COM.TYMED_HGLOBAL )
+ return true;
}
return false;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/DragSource.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/DragSource.java
index b5bbd27b87..544fbac79b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/DragSource.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/DragSource.java
@@ -347,14 +347,14 @@ private void drag(Event dragEvent) {
OS.ShowWindow (hwndDrag, OS.SW_SHOW);
}
OS.ImageList_BeginDrag(imagelist.getHandle(), 0, offsetX, event.offsetY);
- /*
- * Feature in Windows. When ImageList_DragEnter() is called,
- * it takes a snapshot of the screen If a drag is started
- * when another window is in front, then the snapshot will
- * contain part of the other window, causing pixel corruption.
- * The fix is to force all paints to be delivered before
- * calling ImageList_DragEnter().
- */
+ /*
+ * Feature in Windows. When ImageList_DragEnter() is called,
+ * it takes a snapshot of the screen If a drag is started
+ * when another window is in front, then the snapshot will
+ * contain part of the other window, causing pixel corruption.
+ * The fix is to force all paints to be delivered before
+ * calling ImageList_DragEnter().
+ */
int flags = OS.RDW_UPDATENOW | OS.RDW_ALLCHILDREN;
OS.RedrawWindow (topControl.handle, null, 0, flags);
POINT pt = new POINT ();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/DropTarget.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/DropTarget.java
index 58c13a8f35..c97521a27c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/DropTarget.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/DropTarget.java
@@ -626,12 +626,12 @@ int QueryInterface(long /*int*/ riid, long /*int*/ ppvObject) {
GUID guid = new GUID();
COM.MoveMemory(guid, riid, GUID.sizeof);
if (COM.IsEqualGUID(guid, COM.IIDIUnknown) || COM.IsEqualGUID(guid, COM.IIDIDropTarget)) {
- OS.MoveMemory(ppvObject, new long /*int*/[] {iDropTarget.getAddress()}, C.PTR_SIZEOF);
+ OS.MoveMemory(ppvObject, new long /*int*/[] {iDropTarget.getAddress()}, C.PTR_SIZEOF);
AddRef();
return COM.S_OK;
}
- OS.MoveMemory(ppvObject, new long /*int*/[] {0}, C.PTR_SIZEOF);
+ OS.MoveMemory(ppvObject, new long /*int*/[] {0}, C.PTR_SIZEOF);
return COM.E_NOINTERFACE;
}
@@ -726,14 +726,14 @@ boolean setEventData(DNDEvent event, long /*int*/ pDataObject, int grfKeyState,
IDataObject dataObject = new IDataObject(pDataObject);
dataObject.AddRef();
try {
- long /*int*/[] address = new long /*int*/[1];
+ long /*int*/[] address = new long /*int*/[1];
if (dataObject.EnumFormatEtc(COM.DATADIR_GET, address) != COM.S_OK) {
return false;
}
IEnumFORMATETC enumFormatetc = new IEnumFORMATETC(address[0]);
try {
// Loop over enumerator and save any types that match what we are looking for
- long /*int*/ rgelt = OS.GlobalAlloc(OS.GMEM_FIXED | OS.GMEM_ZEROINIT, FORMATETC.sizeof);
+ long /*int*/ rgelt = OS.GlobalAlloc(OS.GMEM_FIXED | OS.GMEM_ZEROINIT, FORMATETC.sizeof);
try {
int[] pceltFetched = new int[1];
enumFormatetc.Reset();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/TransferData.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/TransferData.java
index 82a96b7b1e..672b026229 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/TransferData.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/TransferData.java
@@ -87,7 +87,7 @@ public class TransferData {
* within the packages provided by SWT. It is not available on all
* platforms and should never be accessed from application code.
* </p>
- * <p>The value of result is 1 if the conversion was successful.
+ * <p>The value of result is 1 if the conversion was successful.
* The value of result is 0 if the conversion failed.</p>
*
* @noreference This field is not intended to be referenced by clients.
@@ -114,8 +114,8 @@ public class TransferData {
if (data1 == null || data2 == null) return false;
return (data1.type == data2.type &&
data1.formatetc.cfFormat == data2.formatetc.cfFormat &&
- data1.formatetc.dwAspect == data2.formatetc.dwAspect &&
- data1.formatetc.tymed == data2.formatetc.tymed);
+ data1.formatetc.dwAspect == data2.formatetc.dwAspect &&
+ data1.formatetc.tymed == data2.formatetc.tymed);
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OLE.java b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OLE.java
index cc7b0137ef..4c91f187ca 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OLE.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OLE.java
@@ -246,7 +246,7 @@ public class OLE extends SWT {
public static final short FUNCFLAG_FREQUESTEDIT = 0x8;
public static final short FUNCFLAG_FDISPLAYBIND = 0x10;
public static final short FUNCFLAG_FDEFAULTBIND = 0x20;
- public static final short FUNCFLAG_FHIDDEN = 0x40;
+ public static final short FUNCFLAG_FHIDDEN = 0x40;
public static final short FUNCFLAG_FUSESGETLASTERROR = 0x80;
public static final short FUNCFLAG_FDEFAULTCOLLELEM = 0x100;
public static final short FUNCFLAG_FUIDEFAULT = 0x200;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleClientSite.java b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleClientSite.java
index abcf1bd234..fa933fd48f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleClientSite.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleClientSite.java
@@ -1391,7 +1391,7 @@ void setBorderSpace(RECT newBorderwidth) {
void setBounds() {
Rectangle area = DPIUtil.autoScaleUp(frame.getClientArea()); // To Pixels
setBounds(DPIUtil.autoScaleDown(borderWidths.left),
- DPIUtil.autoScaleDown(borderWidths.top),
+ DPIUtil.autoScaleDown(borderWidths.top),
DPIUtil.autoScaleDown(area.width - borderWidths.left - borderWidths.right),
DPIUtil.autoScaleDown(area.height - borderWidths.top - borderWidths.bottom));
setObjectRects();
@@ -1408,7 +1408,7 @@ private void setExtent(int width, int height){
newExtent.cx = width; newExtent.cy = height;
newExtent = xFormPixelsToHimetric(newExtent);
- // Get the server running first, then do a SetExtent, then show it
+ // Get the server running first, then do a SetExtent, then show it
boolean alreadyRunning = COM.OleIsRunning(objIOleObject.getAddress());
if (!alreadyRunning)
COM.OleRun(objIOleObject.getAddress());
diff --git a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/Variant.java b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/Variant.java
index dd4f0d6a2e..4d3dd97fef 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/Variant.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/Variant.java
@@ -496,7 +496,7 @@ void getData(long /*int*/ pData){
switch (type) {
case COM.VT_EMPTY :
case COM.VT_NULL :
- OS.MoveMemory(pData, new short[] {type}, 2);
+ OS.MoveMemory(pData, new short[] {type}, 2);
break;
case COM.VT_BOOL :
OS.MoveMemory(pData, new short[] {type}, 2);
@@ -566,30 +566,30 @@ void getData(long /*int*/ pData){
* @since 3.2
*/
public double getDouble() {
- if (type == COM.VT_EMPTY) {
- OLE.error(OLE.ERROR_CANNOT_CHANGE_VARIANT_TYPE, -1);
- }
- if (type == COM.VT_R8) {
- return doubleData;
- }
+ if (type == COM.VT_EMPTY) {
+ OLE.error(OLE.ERROR_CANNOT_CHANGE_VARIANT_TYPE, -1);
+ }
+ if (type == COM.VT_R8) {
+ return doubleData;
+ }
- // try to coerce the value to the desired type
- long /*int*/ oldPtr = OS.GlobalAlloc(COM.GMEM_FIXED | COM.GMEM_ZEROINIT, sizeof);
- long /*int*/ newPtr = OS.GlobalAlloc(COM.GMEM_FIXED | COM.GMEM_ZEROINIT, sizeof);
- try {
- getData(oldPtr);
- int result = COM.VariantChangeType(newPtr, oldPtr, (short) 0, COM.VT_R8);
- if (result != COM.S_OK)
- OLE.error(OLE.ERROR_CANNOT_CHANGE_VARIANT_TYPE, result);
- Variant doubleVar = new Variant();
- doubleVar.setData(newPtr);
- return doubleVar.getDouble();
- } finally {
- COM.VariantClear(oldPtr);
- OS.GlobalFree(oldPtr);
- COM.VariantClear(newPtr);
- OS.GlobalFree(newPtr);
- }
+ // try to coerce the value to the desired type
+ long /*int*/ oldPtr = OS.GlobalAlloc(COM.GMEM_FIXED | COM.GMEM_ZEROINIT, sizeof);
+ long /*int*/ newPtr = OS.GlobalAlloc(COM.GMEM_FIXED | COM.GMEM_ZEROINIT, sizeof);
+ try {
+ getData(oldPtr);
+ int result = COM.VariantChangeType(newPtr, oldPtr, (short) 0, COM.VT_R8);
+ if (result != COM.S_OK)
+ OLE.error(OLE.ERROR_CANNOT_CHANGE_VARIANT_TYPE, result);
+ Variant doubleVar = new Variant();
+ doubleVar.setData(newPtr);
+ return doubleVar.getDouble();
+ } finally {
+ COM.VariantClear(oldPtr);
+ OS.GlobalFree(oldPtr);
+ COM.VariantClear(newPtr);
+ OS.GlobalFree(newPtr);
+ }
}
/**
@@ -972,7 +972,7 @@ void setData(long /*int*/ pData){
case COM.VT_R8 :
double[] newDoubleData = new double[1];
OS.MoveMemory(newDoubleData, pData + 8, 8);
- doubleData = newDoubleData[0];
+ doubleData = newDoubleData[0];
break;
case COM.VT_DISPATCH : {
long /*int*/[] ppvObject = new long /*int*/[1];
@@ -1040,37 +1040,37 @@ void setData(long /*int*/ pData){
*/
@Override
public String toString () {
- switch (type) {
- case COM.VT_BOOL :
- return "VT_BOOL{"+booleanData+"}";
- case COM.VT_I1 :
- return "VT_I1{"+byteData+"}";
- case COM.VT_I2 :
- return "VT_I2{"+shortData+"}";
- case COM.VT_UI2 :
- return "VT_UI2{"+charData+"}";
- case COM.VT_I4 :
- return "VT_I4{"+intData+"}";
- case COM.VT_I8 :
- return "VT_I8{"+longData+"}";
- case COM.VT_R4 :
- return "VT_R4{"+floatData+"}";
- case COM.VT_R8 :
- return "VT_R8{"+doubleData+"}";
- case COM.VT_BSTR :
- return "VT_BSTR{"+stringData+"}";
- case COM.VT_DISPATCH :
- return "VT_DISPATCH{"+(dispatchData == null ? 0 : dispatchData.getAddress())+"}";
- case COM.VT_UNKNOWN :
- return "VT_UNKNOWN{"+(unknownData == null ? 0 : unknownData.getAddress())+"}";
- case COM.VT_EMPTY :
- return "VT_EMPTY";
- case COM.VT_NULL :
- return "VT_NULL";
- }
- if ((type & COM.VT_BYREF) != 0) {
- return "VT_BYREF|"+(type & ~COM.VT_BYREF)+"{"+byRefPtr+"}";
- }
- return "Unsupported Type "+type;
+ switch (type) {
+ case COM.VT_BOOL :
+ return "VT_BOOL{"+booleanData+"}";
+ case COM.VT_I1 :
+ return "VT_I1{"+byteData+"}";
+ case COM.VT_I2 :
+ return "VT_I2{"+shortData+"}";
+ case COM.VT_UI2 :
+ return "VT_UI2{"+charData+"}";
+ case COM.VT_I4 :
+ return "VT_I4{"+intData+"}";
+ case COM.VT_I8 :
+ return "VT_I8{"+longData+"}";
+ case COM.VT_R4 :
+ return "VT_R4{"+floatData+"}";
+ case COM.VT_R8 :
+ return "VT_R8{"+doubleData+"}";
+ case COM.VT_BSTR :
+ return "VT_BSTR{"+stringData+"}";
+ case COM.VT_DISPATCH :
+ return "VT_DISPATCH{"+(dispatchData == null ? 0 : dispatchData.getAddress())+"}";
+ case COM.VT_UNKNOWN :
+ return "VT_UNKNOWN{"+(unknownData == null ? 0 : unknownData.getAddress())+"}";
+ case COM.VT_EMPTY :
+ return "VT_EMPTY";
+ case COM.VT_NULL :
+ return "VT_NULL";
+ }
+ if ((type & COM.VT_BYREF) != 0) {
+ return "VT_BYREF|"+(type & ~COM.VT_BYREF)+"{"+byRefPtr+"}";
+ }
+ return "Unsupported Type "+type;
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT OpenGL/win32/org/eclipse/swt/internal/opengl/win32/LAYERPLANEDESCRIPTOR.java b/bundles/org.eclipse.swt/Eclipse SWT OpenGL/win32/org/eclipse/swt/internal/opengl/win32/LAYERPLANEDESCRIPTOR.java
index 499a5440d1..0cf59147c3 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT OpenGL/win32/org/eclipse/swt/internal/opengl/win32/LAYERPLANEDESCRIPTOR.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT OpenGL/win32/org/eclipse/swt/internal/opengl/win32/LAYERPLANEDESCRIPTOR.java
@@ -15,29 +15,29 @@ package org.eclipse.swt.internal.opengl.win32;
public class LAYERPLANEDESCRIPTOR {
- public short nSize;
- public short nVersion;
- public int dwFlags;
- public byte iPixelType;
- public byte cColorBits;
- public byte cRedBits;
- public byte cRedShift;
- public byte cGreenBits;
- public byte cGreenShift;
- public byte cBlueBits;
- public byte cBlueShift;
- public byte cAlphaBits;
- public byte cAlphaShift;
- public byte cAccumBits;
- public byte cAccumRedBits;
- public byte cAccumGreenBits;
- public byte cAccumBlueBits;
- public byte cAccumAlphaBits;
- public byte cDepthBits;
- public byte cStencilBits;
- public byte cAuxBuffers;
- public byte iLayerPlane;
- public byte bReserved;
- public int crTransparent;
+ public short nSize;
+ public short nVersion;
+ public int dwFlags;
+ public byte iPixelType;
+ public byte cColorBits;
+ public byte cRedBits;
+ public byte cRedShift;
+ public byte cGreenBits;
+ public byte cGreenShift;
+ public byte cBlueBits;
+ public byte cBlueShift;
+ public byte cAlphaBits;
+ public byte cAlphaShift;
+ public byte cAccumBits;
+ public byte cAccumRedBits;
+ public byte cAccumGreenBits;
+ public byte cAccumBlueBits;
+ public byte cAccumAlphaBits;
+ public byte cDepthBits;
+ public byte cStencilBits;
+ public byte cAuxBuffers;
+ public byte iLayerPlane;
+ public byte bReserved;
+ public int crTransparent;
public static final int sizeof = 36;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT OpenGL/win32/org/eclipse/swt/internal/opengl/win32/PIXELFORMATDESCRIPTOR.java b/bundles/org.eclipse.swt/Eclipse SWT OpenGL/win32/org/eclipse/swt/internal/opengl/win32/PIXELFORMATDESCRIPTOR.java
index 01a3c169c7..5cf0d11f15 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT OpenGL/win32/org/eclipse/swt/internal/opengl/win32/PIXELFORMATDESCRIPTOR.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT OpenGL/win32/org/eclipse/swt/internal/opengl/win32/PIXELFORMATDESCRIPTOR.java
@@ -15,31 +15,31 @@ package org.eclipse.swt.internal.opengl.win32;
public class PIXELFORMATDESCRIPTOR {
- public short nSize;
- public short nVersion;
- public int dwFlags;
- public byte iPixelType;
- public byte cColorBits;
- public byte cRedBits;
- public byte cRedShift;
- public byte cGreenBits;
- public byte cGreenShift;
- public byte cBlueBits;
- public byte cBlueShift;
- public byte cAlphaBits;
- public byte cAlphaShift;
- public byte cAccumBits;
- public byte cAccumRedBits;
- public byte cAccumGreenBits;
- public byte cAccumBlueBits;
- public byte cAccumAlphaBits;
- public byte cDepthBits;
- public byte cStencilBits;
- public byte cAuxBuffers;
- public byte iLayerType;
- public byte bReserved;
- public int dwLayerMask;
- public int dwVisibleMask;
- public int dwDamageMask;
+ public short nSize;
+ public short nVersion;
+ public int dwFlags;
+ public byte iPixelType;
+ public byte cColorBits;
+ public byte cRedBits;
+ public byte cRedShift;
+ public byte cGreenBits;
+ public byte cGreenShift;
+ public byte cBlueBits;
+ public byte cBlueShift;
+ public byte cAlphaBits;
+ public byte cAlphaShift;
+ public byte cAccumBits;
+ public byte cAccumRedBits;
+ public byte cAccumGreenBits;
+ public byte cAccumBlueBits;
+ public byte cAccumAlphaBits;
+ public byte cDepthBits;
+ public byte cStencilBits;
+ public byte cAuxBuffers;
+ public byte iLayerType;
+ public byte bReserved;
+ public int dwLayerMask;
+ public int dwVisibleMask;
+ public int dwDamageMask;
public static final int sizeof = 40;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cairo/org/eclipse/swt/internal/cairo/Cairo.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cairo/org/eclipse/swt/internal/cairo/Cairo.java
index 86a280dfaa..c656c6d69c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cairo/org/eclipse/swt/internal/cairo/Cairo.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cairo/org/eclipse/swt/internal/cairo/Cairo.java
@@ -66,18 +66,18 @@ public class Cairo extends Platform {
public static final int CAIRO_STATUS_NULL_POINTER =7;
public static final int CAIRO_SURFACE_TYPE_IMAGE = 0;
public static final int CAIRO_SURFACE_TYPE_PDF = 1;
- public static final int CAIRO_SURFACE_TYPE_PS = 2;
- public static final int CAIRO_SURFACE_TYPE_XLIB = 3;
- public static final int CAIRO_SURFACE_TYPE_XCB = 4;
- public static final int CAIRO_SURFACE_TYPE_GLITZ = 5;
- public static final int CAIRO_SURFACE_TYPE_QUARTZ = 6;
- public static final int CAIRO_SURFACE_TYPE_WIN32 = 7;
- public static final int CAIRO_SURFACE_TYPE_BEOS = 8;
- public static final int CAIRO_SURFACE_TYPE_DIRECTFB = 9;
- public static final int CAIRO_SURFACE_TYPE_SVG = 10;
- public static final int CAIRO_REGION_OVERLAP_IN = 0;
- public static final int CAIRO_REGION_OVERLAP_OUT = 1;
- public static final int CAIRO_REGION_OVERLAP_PART = 2;
+ public static final int CAIRO_SURFACE_TYPE_PS = 2;
+ public static final int CAIRO_SURFACE_TYPE_XLIB = 3;
+ public static final int CAIRO_SURFACE_TYPE_XCB = 4;
+ public static final int CAIRO_SURFACE_TYPE_GLITZ = 5;
+ public static final int CAIRO_SURFACE_TYPE_QUARTZ = 6;
+ public static final int CAIRO_SURFACE_TYPE_WIN32 = 7;
+ public static final int CAIRO_SURFACE_TYPE_BEOS = 8;
+ public static final int CAIRO_SURFACE_TYPE_DIRECTFB = 9;
+ public static final int CAIRO_SURFACE_TYPE_SVG = 10;
+ public static final int CAIRO_REGION_OVERLAP_IN = 0;
+ public static final int CAIRO_REGION_OVERLAP_OUT = 1;
+ public static final int CAIRO_REGION_OVERLAP_PART = 2;
public static final int CAIRO_FILTER_FAST = 0;
public static final int CAIRO_FILTER_GOOD = 1;
public static final int CAIRO_FILTER_BEST = 2;
@@ -1285,7 +1285,7 @@ public static final native long _cairo_region_copy(long region);
public static final long cairo_region_copy(long region) {
lock.lock();
try {
- return _cairo_region_copy(region);
+ return _cairo_region_copy(region);
} finally {
lock.unlock();
}
@@ -1356,7 +1356,7 @@ public static final native void _cairo_region_get_rectangle(long region, int nth
public static final void cairo_region_get_rectangle(long region, int nth, long rectangle) {
lock.lock();
try {
- _cairo_region_get_rectangle(region, nth, rectangle);
+ _cairo_region_get_rectangle(region, nth, rectangle);
} finally {
lock.unlock();
}
@@ -1406,7 +1406,7 @@ public static final native void _cairo_region_translate(long region, int dx, int
public static final void cairo_region_translate(long region, int dx, int dy) {
lock.lock();
try {
- _cairo_region_translate(region,dx,dy);
+ _cairo_region_translate(region,dx,dy);
} finally {
lock.unlock();
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
index e053462734..ef08209ae4 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
@@ -256,13 +256,13 @@ public static final native int GetDblTime();
@param outIconRef cast=(IconRef *) */
public static final native int GetIconRefFromTypeInfo(int inCreator, int inType, long inExtension, long inMIMEType, int inUsageFlags, long outIconRef[]);
/** @method flags=dynamic
- @param context cast=(CGContextRef) */
+ @param context cast=(CGContextRef) */
public static final native long CGContextCopyPath(long context);
/** @method flags=dynamic */
public static final native long TISCopyCurrentKeyboardInputSource();
/** @method flags=dynamic
- @param inputSource cast=(TISInputSourceRef)
- @param propertyKey cast=(CFStringRef) */
+ @param inputSource cast=(TISInputSourceRef)
+ @param propertyKey cast=(CFStringRef) */
public static final native long TISGetInputSourceProperty (long inputSource, long propertyKey);
/** @method flags=no_gen */
public static final native long kTISPropertyUnicodeKeyLayoutData();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/common/org/eclipse/swt/internal/Library.java b/bundles/org.eclipse.swt/Eclipse SWT PI/common/org/eclipse/swt/internal/Library.java
index b09de9a528..50e91651eb 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/common/org/eclipse/swt/internal/Library.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/common/org/eclipse/swt/internal/Library.java
@@ -27,12 +27,12 @@ public class Library {
/**
* SWT Major version number (must be >= 0)
*/
- static int MAJOR_VERSION = 4;
+ static int MAJOR_VERSION = 4;
/**
* SWT Minor version number (must be in the range 0..999)
*/
- static int MINOR_VERSION = 928;
+ static int MINOR_VERSION = 928;
/**
* SWT revision number (must be >= 0)
@@ -168,14 +168,14 @@ static boolean extract (String extractToFilePath, String mappedName) {
tempFile = File.createTempFile (file.getName(), ".tmp", file.getParentFile()); //$NON-NLS-1$
} catch (Throwable e) {
return false;
- }
+ }
// Extract resource
String resourceName = "/" + mappedName; //$NON-NLS-1$
if (!extractResource (resourceName, tempFile)) {
tempFile.delete();
return false;
- }
+ }
// Make it executable
chmod ("755", tempFile.getPath()); //$NON-NLS-1$
@@ -459,7 +459,7 @@ public static File findResource(String subDir, String resourceName, boolean mapR
// Create temp directory if it doesn't exist
File tempDir = new File (USER_HOME, SWT_LIB_DIR + maybeSubDirPathWithPrefix);
if ((!tempDir.exists () || tempDir.isDirectory ())) {
- tempDir.mkdirs ();
+ tempDir.mkdirs ();
}
if (extract(file.getPath(), maybeSubDirPath + finalResourceName)) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GDK.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GDK.java
index e8072b71f8..16e7f629f0 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GDK.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GDK.java
@@ -649,13 +649,13 @@ public class GDK extends OS {
*/
public static final native void _gdk_cairo_set_source_pixbuf(long cairo, long pixbuf, double pixbuf_x, double pixbuf_y);
public static final void gdk_cairo_set_source_pixbuf(long cairo, long pixbuf, double pixbuf_x, double pixbuf_y) {
- lock.lock();
- try {
- _gdk_cairo_set_source_pixbuf(cairo,pixbuf,pixbuf_x,pixbuf_y);
- }
- finally {
- lock.unlock();
- }
+ lock.lock();
+ try {
+ _gdk_cairo_set_source_pixbuf(cairo,pixbuf,pixbuf_x,pixbuf_y);
+ }
+ finally {
+ lock.unlock();
+ }
}
/**
* @param cairo cast=(cairo_t *)
@@ -666,13 +666,13 @@ public class GDK extends OS {
public static final native void _gdk_cairo_set_source_window(long cairo, long window, int x, int y);
/** [GTK3 only, if-def'd in os.h] */
public static final void gdk_cairo_set_source_window(long cairo, long window, int x, int y) {
- lock.lock();
- try {
- _gdk_cairo_set_source_window(cairo, window, x, y);
- }
- finally {
- lock.unlock();
- }
+ lock.lock();
+ try {
+ _gdk_cairo_set_source_window(cairo, window, x, y);
+ }
+ finally {
+ lock.unlock();
+ }
}
/** @param display cast=(GdkDisplay *)
* @param cursor_type cast=(GdkCursorType)
@@ -1411,9 +1411,9 @@ public class GDK extends OS {
lock.lock();
try {
return _gdk_keymap_get_entries_for_keyval(keymap, keyval, keys, n_keys);
- } finally {
- lock.unlock();
- }
+ } finally {
+ lock.unlock();
+ }
}
public static final native long _gdk_keyval_to_lower(long keyval);
public static final long gdk_keyval_to_lower(long keyval) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java
index fc15134ac6..179be70ba4 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java
@@ -1350,7 +1350,7 @@ public class GTK extends OS {
public static final void gtk_color_chooser_set_use_alpha (long chooser, boolean use_alpha) {
lock.lock();
try {
- _gtk_color_chooser_set_use_alpha (chooser, use_alpha);
+ _gtk_color_chooser_set_use_alpha (chooser, use_alpha);
} finally {
lock.unlock();
}
@@ -1362,7 +1362,7 @@ public class GTK extends OS {
public static final boolean gtk_color_chooser_get_use_alpha (long chooser) {
lock.lock();
try {
- return _gtk_color_chooser_get_use_alpha (chooser);
+ return _gtk_color_chooser_get_use_alpha (chooser);
} finally {
lock.unlock();
}
@@ -1375,7 +1375,7 @@ public class GTK extends OS {
public static final void gtk_color_chooser_get_rgba(long chooser, GdkRGBA color) {
lock.lock();
try {
- _gtk_color_chooser_get_rgba(chooser, color);
+ _gtk_color_chooser_get_rgba(chooser, color);
} finally {
lock.unlock();
}
@@ -1388,7 +1388,7 @@ public class GTK extends OS {
public static final void gtk_color_chooser_set_rgba(long chooser, GdkRGBA color) {
lock.lock();
try {
- _gtk_color_chooser_set_rgba(chooser, color);
+ _gtk_color_chooser_set_rgba(chooser, color);
} finally {
lock.unlock();
}
@@ -2505,42 +2505,42 @@ public class GTK extends OS {
public static final native long _gtk_gesture_multi_press_new();
/** [GTK4 only, if-def'd in os.h] */
public static final long gtk_gesture_multi_press_new() {
- lock.lock();
- try {
- return _gtk_gesture_multi_press_new();
- } finally {
- lock.unlock();
- }
+ lock.lock();
+ try {
+ return _gtk_gesture_multi_press_new();
+ } finally {
+ lock.unlock();
+ }
}
public static final native long _gtk_event_controller_key_new();
/** [GTK4 only, if-def'd in os.h] */
public static final long gtk_event_controller_key_new() {
- lock.lock();
- try {
- return _gtk_event_controller_key_new();
- } finally {
- lock.unlock();
- }
+ lock.lock();
+ try {
+ return _gtk_event_controller_key_new();
+ } finally {
+ lock.unlock();
+ }
}
public static final native long _gtk_event_controller_motion_new();
/** [GTK4 only, if-def'd in os.h] */
public static final long gtk_event_controller_motion_new() {
- lock.lock();
- try {
- return _gtk_event_controller_motion_new();
- } finally {
- lock.unlock();
- }
+ lock.lock();
+ try {
+ return _gtk_event_controller_motion_new();
+ } finally {
+ lock.unlock();
+ }
}
public static final native long _gtk_event_controller_scroll_new(int flag);
/** [GTK4 only, if-def'd in os.h] */
public static final long gtk_event_controller_scroll_new(int flag) {
- lock.lock();
- try {
- return _gtk_event_controller_scroll_new(flag);
- } finally {
- lock.unlock();
- }
+ lock.lock();
+ try {
+ return _gtk_event_controller_scroll_new(flag);
+ } finally {
+ lock.unlock();
+ }
}
/**
* @param widget cast=(GtkWidget *)
@@ -2549,24 +2549,24 @@ public class GTK extends OS {
public static final native void _gtk_widget_add_controller(long widget, long controller);
/** [GTK4 only, if-def'd in os.h] */
public static final void gtk_widget_add_controller(long widget, long controller) {
- lock.lock();
- try {
- _gtk_widget_add_controller(widget, controller);
- } finally {
- lock.unlock();
- }
+ lock.lock();
+ try {
+ _gtk_widget_add_controller(widget, controller);
+ } finally {
+ lock.unlock();
+ }
}
/**
* @method flags=dynamic
*/
public static final native void _gtk_event_controller_set_propagation_phase(long controller, int phase);
public static final void gtk_event_controller_set_propagation_phase(long controller, int phase) {
- lock.lock();
- try {
- _gtk_event_controller_set_propagation_phase(controller, phase);
- } finally {
- lock.unlock();
- }
+ lock.lock();
+ try {
+ _gtk_event_controller_set_propagation_phase(controller, phase);
+ } finally {
+ lock.unlock();
+ }
}
/**
* @method flags=dynamic
@@ -2589,24 +2589,24 @@ public class GTK extends OS {
*/
public static final native void _gtk_event_controller_handle_event(long gesture, long event);
public static final void gtk_event_controller_handle_event(long gesture, long event) {
- lock.lock();
- try {
- _gtk_event_controller_handle_event(gesture, event);
- } finally {
- lock.unlock();
- }
+ lock.lock();
+ try {
+ _gtk_event_controller_handle_event(gesture, event);
+ } finally {
+ lock.unlock();
+ }
}
/**
* @method flags=dynamic
*/
public static final native long _gtk_event_controller_get_widget(long controller);
public static final long gtk_event_controller_get_widget(long controller) {
- lock.lock();
- try {
- return _gtk_event_controller_get_widget(controller);
- } finally {
- lock.unlock();
- }
+ lock.lock();
+ try {
+ return _gtk_event_controller_get_widget(controller);
+ } finally {
+ lock.unlock();
+ }
}
/**
* @param filter cast=(GtkFileFilter *)
@@ -2683,12 +2683,12 @@ public class GTK extends OS {
*/
public static final native long _gtk_gesture_drag_new(long widget);
public static final long gtk_gesture_drag_new(long widget) {
- lock.lock();
- try {
- return _gtk_gesture_drag_new(widget);
- } finally {
- lock.unlock();
- }
+ lock.lock();
+ try {
+ return _gtk_gesture_drag_new(widget);
+ } finally {
+ lock.unlock();
+ }
}
/**
* @method flags=dynamic
@@ -2743,12 +2743,12 @@ public class GTK extends OS {
*/
public static final native void _gtk_gesture_group (long group_gesture, long gesture);
public static final void gtk_gesture_group (long group_gesture, long gesture) {
- lock.lock();
- try {
- _gtk_gesture_group(group_gesture, gesture);
- } finally {
- lock.unlock();
- }
+ lock.lock();
+ try {
+ _gtk_gesture_group(group_gesture, gesture);
+ } finally {
+ lock.unlock();
+ }
}
/**
* @method flags=dynamic
@@ -2757,7 +2757,7 @@ public class GTK extends OS {
public static final void gtk_gesture_pan_set_orientation(long orientation) {
lock.lock();
try {
- _gtk_gesture_pan_set_orientation(orientation);
+ _gtk_gesture_pan_set_orientation(orientation);
} finally {
lock.unlock();
}
@@ -2791,12 +2791,12 @@ public class GTK extends OS {
*/
public static final native void _gtk_gesture_single_set_button(long gesture, int button);
public static final void gtk_gesture_single_set_button(long gesture, int button) {
- lock.lock();
- try {
- _gtk_gesture_single_set_button(gesture, button);
- } finally {
- lock.unlock();
- }
+ lock.lock();
+ try {
+ _gtk_gesture_single_set_button(gesture, button);
+ } finally {
+ lock.unlock();
+ }
}
/**
* @method flags=dynamic
@@ -2827,12 +2827,12 @@ public class GTK extends OS {
*/
public static final native void _gtk_gesture_drag_get_offset(long gesture, double[] x, double[] y);
public static final void gtk_gesture_drag_get_offset(long gesture, double[] x, double[] y) {
- lock.lock();
- try {
- _gtk_gesture_drag_get_offset(gesture, x, y);
- } finally {
- lock.unlock();
- }
+ lock.lock();
+ try {
+ _gtk_gesture_drag_get_offset(gesture, x, y);
+ } finally {
+ lock.unlock();
+ }
}
/**
* @method flags=dynamic
@@ -2853,36 +2853,36 @@ public class GTK extends OS {
public static final native long _gtk_gesture_rotate_new(long widget);
public static final long gtk_gesture_rotate_new(long widget) {
- lock.lock();
- try {
- return _gtk_gesture_rotate_new(widget);
- } finally {
- lock.unlock();
- }
+ lock.lock();
+ try {
+ return _gtk_gesture_rotate_new(widget);
+ } finally {
+ lock.unlock();
+ }
}
/**
* @method flags=dynamic
*/
public static final native long _gtk_gesture_zoom_new(long widget);
public static final long gtk_gesture_zoom_new(long widget) {
- lock.lock();
- try {
- return _gtk_gesture_zoom_new(widget);
- } finally {
- lock.unlock();
- }
+ lock.lock();
+ try {
+ return _gtk_gesture_zoom_new(widget);
+ } finally {
+ lock.unlock();
+ }
}
/**
* @method flags=dynamic
*/
public static final native double _gtk_gesture_zoom_get_scale_delta (long gesture);
public static final double gtk_gesture_zoom_get_scale_delta (long gesture) {
- lock.lock();
- try {
- return _gtk_gesture_zoom_get_scale_delta(gesture);
- } finally {
- lock.unlock();
- }
+ lock.lock();
+ try {
+ return _gtk_gesture_zoom_get_scale_delta(gesture);
+ } finally {
+ lock.unlock();
+ }
}
/**
* @method flags=dynamic
@@ -3031,7 +3031,7 @@ public class GTK extends OS {
public static final void gtk_widget_set_margin_start (long widget, int margin) {
lock.lock();
try {
- _gtk_widget_set_margin_start(widget, margin);
+ _gtk_widget_set_margin_start(widget, margin);
} finally {
lock.unlock();
}
@@ -3045,7 +3045,7 @@ public class GTK extends OS {
public static final void gtk_widget_set_margin_end (long widget, int margin) {
lock.lock();
try {
- _gtk_widget_set_margin_end(widget, margin);
+ _gtk_widget_set_margin_end(widget, margin);
} finally {
lock.unlock();
}
@@ -3059,7 +3059,7 @@ public class GTK extends OS {
public static final void gtk_widget_set_margin_top (long widget, int margin) {
lock.lock();
try {
- _gtk_widget_set_margin_top(widget, margin);
+ _gtk_widget_set_margin_top(widget, margin);
} finally {
lock.unlock();
}
@@ -3073,7 +3073,7 @@ public class GTK extends OS {
public static final void gtk_widget_set_margin_bottom (long widget, int margin) {
lock.lock();
try {
- _gtk_widget_set_margin_bottom(widget, margin);
+ _gtk_widget_set_margin_bottom(widget, margin);
} finally {
lock.unlock();
}
@@ -5494,12 +5494,12 @@ public class GTK extends OS {
*/
public static final native void _gtk_range_get_slider_range(long range, int[] slider_start, int[] slider_end);
public static final void gtk_range_get_slider_range(long range, int[] slider_start, int[] slider_end) {
- lock.lock();
- try {
- _gtk_range_get_slider_range(range, slider_start, slider_end);
- } finally {
- lock.unlock();
- }
+ lock.lock();
+ try {
+ _gtk_range_get_slider_range(range, slider_start, slider_end);
+ } finally {
+ lock.unlock();
+ }
}
/**
* @param scale cast=(GtkScale *)
@@ -5930,7 +5930,7 @@ public class GTK extends OS {
public static final long gtk_snapshot_append_cairo(long snapshot, long rect) {
lock.lock();
try {
- return _gtk_snapshot_append_cairo(snapshot, rect);
+ return _gtk_snapshot_append_cairo(snapshot, rect);
} finally {
lock.unlock();
}
@@ -7269,7 +7269,7 @@ public class GTK extends OS {
public static final long gtk_tree_path_compare(long a, long b) {
lock.lock();
try {
- return _gtk_tree_path_compare(a, b);
+ return _gtk_tree_path_compare(a, b);
} finally {
lock.unlock();
}
@@ -8790,12 +8790,12 @@ public class GTK extends OS {
/** @param widget cast=(GtkWidget *) */
public static final native boolean _gtk_widget_has_focus(long widget);
public static final boolean gtk_widget_has_focus(long widget) {
- lock.lock();
- try {
- return _gtk_widget_has_focus(widget);
- } finally {
- lock.unlock();
- }
+ lock.lock();
+ try {
+ return _gtk_widget_has_focus(widget);
+ } finally {
+ lock.unlock();
+ }
}
/** @param widget cast=(GtkWidget *) */
public static final native void _gtk_widget_hide(long widget);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEventKey.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEventKey.java
index 0e9767477c..085ac39d9a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEventKey.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEventKey.java
@@ -32,9 +32,9 @@ public class GdkEventKey extends GdkEvent {
public long string;
/** @field cast=(guint16) */
public short hardware_keycode;
- /** @field cast=(guint8) */
+ /** @field cast=(guint8) */
public byte group;
/** @field cast=(guint) */
public int is_modifier;
- public static final int sizeof = GDK.GdkEventKey_sizeof();
+ public static final int sizeof = GDK.GdkEventKey_sizeof();
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
index ba04f401e8..166b509743 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
@@ -1496,7 +1496,7 @@ public static final native void _g_signal_remove_emission_hook(int signal_id, lo
public static final void g_signal_remove_emission_hook(int signal_id, long hook_id) {
lock.lock();
try {
- _g_signal_remove_emission_hook (signal_id, hook_id);
+ _g_signal_remove_emission_hook (signal_id, hook_id);
} finally {
lock.unlock();
}
@@ -4190,12 +4190,12 @@ public static final native long _g_dbus_proxy_new_for_bus_sync (int bus_type, in
long cancellable, long [] error);
public static final long g_dbus_proxy_new_for_bus_sync (int bus_type, int flags, long info, byte [] name, byte [] object_path, byte [] interface_name,
long cancellable, long [] error) {
- lock.lock();
- try {
- return _g_dbus_proxy_new_for_bus_sync (bus_type, flags, info, name, object_path, interface_name, cancellable, error);
- } finally {
- lock.unlock();
- }
+ lock.lock();
+ try {
+ return _g_dbus_proxy_new_for_bus_sync (bus_type, flags, info, name, object_path, interface_name, cancellable, error);
+ } finally {
+ lock.unlock();
+ }
}
/**
@@ -4259,12 +4259,12 @@ public static final long g_dbus_proxy_call_finish (long proxy, long res, long []
public static final native long _g_dbus_node_info_new_for_xml (byte[] xml_data, long [] error);
/** @category gdbus */
public static final long g_dbus_node_info_new_for_xml (byte[] xml_data, long [] error) {
- lock.lock();
- try {
- return _g_dbus_node_info_new_for_xml (xml_data, error);
- } finally {
- lock.unlock();
- }
+ lock.lock();
+ try {
+ return _g_dbus_node_info_new_for_xml (xml_data, error);
+ } finally {
+ lock.unlock();
+ }
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/com/win32/FileDialogVtbl.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/com/win32/FileDialogVtbl.java
index bc69d3574d..9ee7198fc5 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/com/win32/FileDialogVtbl.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/com/win32/FileDialogVtbl.java
@@ -17,31 +17,31 @@ package org.eclipse.swt.internal.com.win32;
* Function number constants for IFileDialog COM interface
*/
public class FileDialogVtbl{
- public static final int QUERY_INTERFACE = 0;
- public static final int ADD_REF = 1;
- public static final int RELEASE = 2;
- public static final int SHOW = 3;
- public static final int SET_FILE_TYPES = 4;
- public static final int SET_FILE_TYPE_INDEX = 5;
- public static final int GET_FILE_TYPE_INDEX = 6;
- public static final int ADVISE = 7;
- public static final int UNADVISE = 8;
- public static final int SET_OPTIONS = 9;
- public static final int GET_OPTIONS = 10;
- public static final int SET_DEFAULT_FOLDER = 11;
- public static final int SET_FOLDER = 12;
- public static final int GET_FOLDER = 13;
- public static final int GET_CURRENT_SELECTION = 14;
- public static final int SET_FILE_NAME = 15;
- public static final int GET_FILE_NAME = 16;
- public static final int SET_TITLE = 17;
- public static final int SET_OK_BUTTON_LABEL = 18;
- public static final int SET_FILE_NAME_LABEL = 19;
- public static final int GET_RESULT = 20;
- public static final int ADD_PLACE = 21;
- public static final int SET_DEFAULT_EXTENSION = 22;
- public static final int CLOSE = 23;
- public static final int SET_CLIENT_GUID = 24;
- public static final int CLEAR_CLIENT_DATA = 25;
- public static final int SET_FILTER = 26;
+ public static final int QUERY_INTERFACE = 0;
+ public static final int ADD_REF = 1;
+ public static final int RELEASE = 2;
+ public static final int SHOW = 3;
+ public static final int SET_FILE_TYPES = 4;
+ public static final int SET_FILE_TYPE_INDEX = 5;
+ public static final int GET_FILE_TYPE_INDEX = 6;
+ public static final int ADVISE = 7;
+ public static final int UNADVISE = 8;
+ public static final int SET_OPTIONS = 9;
+ public static final int GET_OPTIONS = 10;
+ public static final int SET_DEFAULT_FOLDER = 11;
+ public static final int SET_FOLDER = 12;
+ public static final int GET_FOLDER = 13;
+ public static final int GET_CURRENT_SELECTION = 14;
+ public static final int SET_FILE_NAME = 15;
+ public static final int GET_FILE_NAME = 16;
+ public static final int SET_TITLE = 17;
+ public static final int SET_OK_BUTTON_LABEL = 18;
+ public static final int SET_FILE_NAME_LABEL = 19;
+ public static final int GET_RESULT = 20;
+ public static final int ADD_PLACE = 21;
+ public static final int SET_DEFAULT_EXTENSION = 22;
+ public static final int CLOSE = 23;
+ public static final int SET_CLIENT_GUID = 24;
+ public static final int CLEAR_CLIENT_DATA = 25;
+ public static final int SET_FILTER = 26;
} \ No newline at end of file
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/com/win32/ShellItemVtbl.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/com/win32/ShellItemVtbl.java
index 44d16a2605..f9f7fadf1b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/com/win32/ShellItemVtbl.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/com/win32/ShellItemVtbl.java
@@ -17,12 +17,12 @@ package org.eclipse.swt.internal.com.win32;
* Function number constants for IShellItem COM interface
*/
public class ShellItemVtbl{
- public static final int QUERY_INTERFACE = 0;
- public static final int ADD_REF = 1;
- public static final int RELEASE = 2;
- public static final int BIND_TO_HANDLER = 3;
- public static final int GET_PARENT = 4;
- public static final int GET_DISPLAY_NAME = 5;
- public static final int GET_ATTRIBUTES = 6;
- public static final int COMPARE = 7;
+ public static final int QUERY_INTERFACE = 0;
+ public static final int ADD_REF = 1;
+ public static final int RELEASE = 2;
+ public static final int BIND_TO_HANDLER = 3;
+ public static final int GET_PARENT = 4;
+ public static final int GET_DISPLAY_NAME = 5;
+ public static final int GET_ATTRIBUTES = 6;
+ public static final int COMPARE = 7;
} \ No newline at end of file
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/GUID.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/GUID.java
index 293692e149..ee1a6b8715 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/GUID.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/GUID.java
@@ -34,10 +34,10 @@ static String toHex (int v, int length) {
@Override
public String toString () {
return '{' + toHex (Data1, 8) + '-' +
- toHex (Data2, 4) + '-' +
- toHex (Data3, 4) + '-' +
- toHex (Data4[0], 2) + toHex (Data4[1], 2) + '-' +
- toHex (Data4[2], 2) + toHex (Data4[3], 2) + toHex (Data4[4], 2) + toHex (Data4[5], 2) + toHex (Data4[6], 2) + toHex (Data4[7], 2) + '}';
+ toHex (Data2, 4) + '-' +
+ toHex (Data3, 4) + '-' +
+ toHex (Data4[0], 2) + toHex (Data4[1], 2) + '-' +
+ toHex (Data4[2], 2) + toHex (Data4[3], 2) + toHex (Data4[4], 2) + toHex (Data4[5], 2) + toHex (Data4[6], 2) + toHex (Data4[7], 2) + '}';
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IOleInPlaceActiveObject.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IOleInPlaceActiveObject.java
index 9a04980528..eadda7a037 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IOleInPlaceActiveObject.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IOleInPlaceActiveObject.java
@@ -21,8 +21,8 @@ public IOleInPlaceActiveObject(long /*int*/ address) {
super(address);
}
public int TranslateAccelerator(MSG lpmsg) {
- //lpmsg - Pointer to message that may need translating
- return COM.VtblCall(5, address, lpmsg);
+ //lpmsg - Pointer to message that may need translating
+ return COM.VtblCall(5, address, lpmsg);
}
public void OnFrameWindowActivate(boolean fActivate) {
COM.VtblCall(6, getAddress(), fActivate);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IStorage.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IStorage.java
index 075411a3dc..799bad9fb1 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IStorage.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IStorage.java
@@ -25,10 +25,10 @@ public int Commit(int grfCommitFlag) {
}
public int CopyTo(
int ciidExclude, //Number of elements in rgiidExclude
- GUID rgiidExclude, //Array of interface identifiers (IIDs)
- String[] snbExclude, //Points to a block of stream names in the storage object
+ GUID rgiidExclude, //Array of interface identifiers (IIDs)
+ String[] snbExclude, //Points to a block of stream names in the storage object
long /*int*/ pstgDest //Points to destination storage object
- ){
+ ){
// we only support snbExclude = null
if (snbExclude != null) {
return COM.E_INVALIDARG;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/CERT_PUBLIC_KEY_INFO.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/CERT_PUBLIC_KEY_INFO.java
index dc29608fbc..64557cde33 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/CERT_PUBLIC_KEY_INFO.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/CERT_PUBLIC_KEY_INFO.java
@@ -15,8 +15,8 @@ package org.eclipse.swt.internal.win32;
public class CERT_PUBLIC_KEY_INFO {
- public CRYPT_ALGORITHM_IDENTIFIER Algorithm = new CRYPT_ALGORITHM_IDENTIFIER ();
- public CRYPT_BIT_BLOB PublicKey = new CRYPT_BIT_BLOB ();
+ public CRYPT_ALGORITHM_IDENTIFIER Algorithm = new CRYPT_ALGORITHM_IDENTIFIER ();
+ public CRYPT_BIT_BLOB PublicKey = new CRYPT_BIT_BLOB ();
- static final public int sizeof = OS.CERT_PUBLIC_KEY_INFO_sizeof ();
+ static final public int sizeof = OS.CERT_PUBLIC_KEY_INFO_sizeof ();
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/DROPFILES.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/DROPFILES.java
index 1cd93e3105..a618b72b57 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/DROPFILES.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/DROPFILES.java
@@ -21,10 +21,10 @@ public class DROPFILES {
/** @field accessor=pt.y */
public int pt_y;
public int fNC; // Nonclient area flag. If this member is TRUE, pt specifies the screen
- // coordinates of a point in a window's nonclient area. If it is FALSE,
- // pt specifies the client coordinates of a point in the client area.
+ // coordinates of a point in a window's nonclient area. If it is FALSE,
+ // pt specifies the client coordinates of a point in the client area.
public int fWide; // Value that indicates whether the file contains ANSI or Unicode
// characters. If it is zero, it contains ANSI characters. Otherwise, it
- // contains Unicode characters.
+ // contains Unicode characters.
public static final int sizeof = OS.DROPFILES_sizeof ();
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/GESTURECONFIG.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/GESTURECONFIG.java
index 258b1f6e6d..c6ecf6eeeb 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/GESTURECONFIG.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/GESTURECONFIG.java
@@ -15,7 +15,7 @@ package org.eclipse.swt.internal.win32;
public class GESTURECONFIG {
public int dwID; // gesture ID
- public int dwWant; // settings related to gesture ID that are to be turned on
- public int dwBlock; // settings related to gesture ID that are to be turned off
- public static final int sizeof = OS.GESTURECONFIG_sizeof ();
+ public int dwWant; // settings related to gesture ID that are to be turned on
+ public int dwBlock; // settings related to gesture ID that are to be turned off
+ public static final int sizeof = OS.GESTURECONFIG_sizeof ();
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/GESTUREINFO.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/GESTUREINFO.java
index 1bbd3ebfe1..54e1748a8c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/GESTUREINFO.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/GESTUREINFO.java
@@ -14,19 +14,19 @@
package org.eclipse.swt.internal.win32;
public class GESTUREINFO {
- public int cbSize;
- public int dwFlags;
- public int dwID;
- /** @field cast=(HWND) */
- public long /*int*/ hwndTarget;
- // POINTS ptsLocation
- /** @field accessor=ptsLocation.x */
- public short x;
- /** @field accessor=ptsLocation.y */
- public short y;
- public int dwInstanceID;
- public int dwSequenceID;
- public long ullArguments;
- public int cbExtraArgs;
- public static final int sizeof = OS.GESTUREINFO_sizeof ();
+ public int cbSize;
+ public int dwFlags;
+ public int dwID;
+ /** @field cast=(HWND) */
+ public long /*int*/ hwndTarget;
+ // POINTS ptsLocation
+ /** @field accessor=ptsLocation.x */
+ public short x;
+ /** @field accessor=ptsLocation.y */
+ public short y;
+ public int dwInstanceID;
+ public int dwSequenceID;
+ public long ullArguments;
+ public int cbExtraArgs;
+ public static final int sizeof = OS.GESTUREINFO_sizeof ();
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/MEASUREITEMSTRUCT.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/MEASUREITEMSTRUCT.java
index f32dd68020..890d1a6dfc 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/MEASUREITEMSTRUCT.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/MEASUREITEMSTRUCT.java
@@ -16,7 +16,7 @@ package org.eclipse.swt.internal.win32;
public class MEASUREITEMSTRUCT {
public int CtlType;
public int CtlID;
- public int itemID;
+ public int itemID;
public int itemWidth;
public int itemHeight;
public long /*int*/ itemData;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/NMTVDISPINFO.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/NMTVDISPINFO.java
index 9aa4612de1..c90e7e3ab0 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/NMTVDISPINFO.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/NMTVDISPINFO.java
@@ -25,11 +25,11 @@ public class NMTVDISPINFO extends NMHDR {
public int stateMask;
/** @field accessor=item.pszText,cast=(LPTSTR) */
public long /*int*/ pszText;
- /** @field accessor=item.cchTextMax */
+ /** @field accessor=item.cchTextMax */
public int cchTextMax;
- /** @field accessor=item.iImage */
+ /** @field accessor=item.iImage */
public int iImage;
- /** @field accessor=item.iSelectedImage */
+ /** @field accessor=item.iSelectedImage */
public int iSelectedImage;
/** @field accessor=item.cChildren */
public int cChildren;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OUTLINETEXTMETRIC.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OUTLINETEXTMETRIC.java
index 0b80d30201..0d31133269 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OUTLINETEXTMETRIC.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OUTLINETEXTMETRIC.java
@@ -16,58 +16,58 @@ package org.eclipse.swt.internal.win32;
public class OUTLINETEXTMETRIC {
public int otmSize;
public TEXTMETRIC otmTextMetrics = new TEXTMETRIC ();
- public byte otmFiller;
- /** @field accessor=otmPanoseNumber.bFamilyType */
+ public byte otmFiller;
+ /** @field accessor=otmPanoseNumber.bFamilyType */
public byte otmPanoseNumber_bFamilyType;
- /** @field accessor=otmPanoseNumber.bSerifStyle */
+ /** @field accessor=otmPanoseNumber.bSerifStyle */
public byte otmPanoseNumber_bSerifStyle;
- /** @field accessor=otmPanoseNumber.bWeight */
+ /** @field accessor=otmPanoseNumber.bWeight */
public byte otmPanoseNumber_bWeight;
- /** @field accessor=otmPanoseNumber.bProportion */
+ /** @field accessor=otmPanoseNumber.bProportion */
public byte otmPanoseNumber_bProportion;
- /** @field accessor=otmPanoseNumber.bContrast */
+ /** @field accessor=otmPanoseNumber.bContrast */
public byte otmPanoseNumber_bContrast;
- /** @field accessor=otmPanoseNumber.bStrokeVariation */
+ /** @field accessor=otmPanoseNumber.bStrokeVariation */
public byte otmPanoseNumber_bStrokeVariation;
- /** @field accessor=otmPanoseNumber.bArmStyle */
+ /** @field accessor=otmPanoseNumber.bArmStyle */
public byte otmPanoseNumber_bArmStyle;
- /** @field accessor=otmPanoseNumber.bLetterform */
+ /** @field accessor=otmPanoseNumber.bLetterform */
public byte otmPanoseNumber_bLetterform;
- /** @field accessor=otmPanoseNumber.bMidline */
+ /** @field accessor=otmPanoseNumber.bMidline */
public byte otmPanoseNumber_bMidline;
- /** @field accessor=otmPanoseNumber.bXHeight */
+ /** @field accessor=otmPanoseNumber.bXHeight */
public byte otmPanoseNumber_bXHeight;
- public int otmfsSelection;
- public int otmfsType;
- public int otmsCharSlopeRise;
- public int otmsCharSlopeRun;
- public int otmItalicAngle;
- public int otmEMSquare;
- public int otmAscent;
- public int otmDescent;
- public int otmLineGap;
- public int otmsCapEmHeight;
- public int otmsXHeight;
+ public int otmfsSelection;
+ public int otmfsType;
+ public int otmsCharSlopeRise;
+ public int otmsCharSlopeRun;
+ public int otmItalicAngle;
+ public int otmEMSquare;
+ public int otmAscent;
+ public int otmDescent;
+ public int otmLineGap;
+ public int otmsCapEmHeight;
+ public int otmsXHeight;
public RECT otmrcFontBox = new RECT();
- public int otmMacAscent;
- public int otmMacDescent;
- public int otmMacLineGap;
- public int otmusMinimumPPEM;
+ public int otmMacAscent;
+ public int otmMacDescent;
+ public int otmMacLineGap;
+ public int otmusMinimumPPEM;
public POINT otmptSubscriptSize = new POINT();
public POINT otmptSubscriptOffset = new POINT();
public POINT otmptSuperscriptSize = new POINT();
public POINT otmptSuperscriptOffset = new POINT();
- public int otmsStrikeoutSize;
- public int otmsStrikeoutPosition;
- public int otmsUnderscoreSize;
- public int otmsUnderscorePosition;
- /** @field cast=(PSTR) */
+ public int otmsStrikeoutSize;
+ public int otmsStrikeoutPosition;
+ public int otmsUnderscoreSize;
+ public int otmsUnderscorePosition;
+ /** @field cast=(PSTR) */
public long /*int*/ otmpFamilyName;
- /** @field cast=(PSTR) */
+ /** @field cast=(PSTR) */
public long /*int*/ otmpFaceName;
- /** @field cast=(PSTR) */
+ /** @field cast=(PSTR) */
public long /*int*/ otmpStyleName;
- /** @field cast=(PSTR) */
+ /** @field cast=(PSTR) */
public long /*int*/ otmpFullName;
public static final int sizeof = OS.OUTLINETEXTMETRIC_sizeof ();
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/TVINSERTSTRUCT.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/TVINSERTSTRUCT.java
index e79561172f..92e1875b7d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/TVINSERTSTRUCT.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/TVINSERTSTRUCT.java
@@ -29,11 +29,11 @@ public class TVINSERTSTRUCT {
public int stateMask;
/** @field accessor=item.pszText,cast=(LPTSTR) */
public long /*int*/ pszText;
- /** @field accessor=item.cchTextMax */
+ /** @field accessor=item.cchTextMax */
public int cchTextMax;
- /** @field accessor=item.iImage */
+ /** @field accessor=item.iImage */
public int iImage;
- /** @field accessor=item.iSelectedImage */
+ /** @field accessor=item.iSelectedImage */
public int iSelectedImage;
/** @field accessor=item.cChildren */
public int cChildren;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/TVITEM.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/TVITEM.java
index 98a90ed790..4bb47a9ada 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/TVITEM.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/TVITEM.java
@@ -21,9 +21,9 @@ public class TVITEM {
public int stateMask;
/** @field cast=(LPTSTR) */
public long /*int*/ pszText;
- public int cchTextMax;
- public int iImage;
- public int iSelectedImage;
+ public int cchTextMax;
+ public int iImage;
+ public int iSelectedImage;
public int cChildren;
public long /*int*/ lParam;
public static final int sizeof = OS.TVITEM_sizeof ();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Printing/common/org/eclipse/swt/printing/PrinterData.java b/bundles/org.eclipse.swt/Eclipse SWT Printing/common/org/eclipse/swt/printing/PrinterData.java
index 768619dc73..3f8ce5ff10 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Printing/common/org/eclipse/swt/printing/PrinterData.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Printing/common/org/eclipse/swt/printing/PrinterData.java
@@ -175,7 +175,7 @@ public final class PrinterData extends DeviceData {
*/
public static final int LANDSCAPE = 2;
- /**
+ /**
* <code>duplex</code> field value indicating
* single-sided printing.
* <p>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java b/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java
index a5c2a1d122..4062e2d0a6 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java
@@ -112,9 +112,9 @@ static long GtkPrinterFunc_List (long printer, long user_data) {
* Bug in GTK. While performing a gtk_enumerate_printers(), GTK finds all of the
* available printers from each backend and can hang. If a backend requires more
* time to gather printer info, GTK will start an event loop waiting for a done
- * signal before continuing. For the Lpr backend, GTK does not send a done signal
- * which means the event loop never ends. The fix is to check to see if the driver
- * is of type Lpr, and stop the enumeration, which exits the event loop.
+ * signal before continuing. For the Lpr backend, GTK does not send a done signal
+ * which means the event loop never ends. The fix is to check to see if the driver
+ * is of type Lpr, and stop the enumeration, which exits the event loop.
*/
if (printerList[length].driver.equals (GTK_LPR_BACKEND)) return 1;
return 0;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Program/cocoa/org/eclipse/swt/program/Program.java b/bundles/org.eclipse.swt/Eclipse SWT Program/cocoa/org/eclipse/swt/program/Program.java
index 5a7b6bf79c..4fc59fecb8 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Program/cocoa/org/eclipse/swt/program/Program.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Program/cocoa/org/eclipse/swt/program/Program.java
@@ -159,19 +159,19 @@ static Program getProgram(NSBundle bundle) {
NSString fullPath = bundle.bundlePath();
NSString identifier = bundle.bundleIdentifier();
id bundleName = bundle.objectForInfoDictionaryKey(CFBundleDisplayName);
- if (bundleName == null) {
- bundleName = bundle.objectForInfoDictionaryKey(CFBundleName);
- }
- if (bundleName == null) {
- if (fullPath == null) return null;
- bundleName = fullPath.lastPathComponent().stringByDeletingPathExtension();
- }
- NSString name = new NSString(bundleName.id);
- Program program = new Program();
- program.name = name.getString();
- if (fullPath != null) program.fullPath = fullPath.getString();
- program.identifier = identifier != null ? identifier.getString() : "";
- return program;
+ if (bundleName == null) {
+ bundleName = bundle.objectForInfoDictionaryKey(CFBundleName);
+ }
+ if (bundleName == null) {
+ if (fullPath == null) return null;
+ bundleName = fullPath.lastPathComponent().stringByDeletingPathExtension();
+ }
+ NSString name = new NSString(bundleName.id);
+ Program program = new Program();
+ program.name = name.getString();
+ if (fullPath != null) program.fullPath = fullPath.getString();
+ program.identifier = identifier != null ? identifier.getString() : "";
+ return program;
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Program/win32/org/eclipse/swt/program/Program.java b/bundles/org.eclipse.swt/Eclipse SWT Program/win32/org/eclipse/swt/program/Program.java
index f0ccac8d63..37e47bf541 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Program/win32/org/eclipse/swt/program/Program.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Program/win32/org/eclipse/swt/program/Program.java
@@ -252,7 +252,7 @@ public static Program [] getPrograms () {
* </ul>
*/
public static boolean launch (String fileName) {
- return launch(fileName, null);
+ return launch(fileName, null);
}
/**
@@ -286,10 +286,10 @@ public static boolean launch (String fileName, String workingDir) {
long /*int*/ lpDirectory = 0;
if (workingDir != null && OS.PathIsExe(lpFile)) {
- TCHAR buffer1 = new TCHAR (0, workingDir, true);
- byteCount = buffer1.length () * TCHAR.sizeof;
- lpDirectory = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount);
- OS.MoveMemory (lpDirectory, buffer1, byteCount);
+ TCHAR buffer1 = new TCHAR (0, workingDir, true);
+ byteCount = buffer1.length () * TCHAR.sizeof;
+ lpDirectory = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount);
+ OS.MoveMemory (lpDirectory, buffer1, byteCount);
}
SHELLEXECUTEINFO info = new SHELLEXECUTEINFO ();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/cocoa/org/eclipse/swt/browser/WebKit.java b/bundles/org.eclipse.swt/Eclipse SWT WebKit/cocoa/org/eclipse/swt/browser/WebKit.java
index 0c4c7019df..245880ae99 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/cocoa/org/eclipse/swt/browser/WebKit.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/cocoa/org/eclipse/swt/browser/WebKit.java
@@ -189,7 +189,7 @@ public void create (Composite parent, int style) {
OS.class_addMethod(delegateClass, OS.sel_createPanelDidEnd, proc5, "@:@@@"); //$NON-NLS-1$
OS.objc_registerClassPair(delegateClass);
- long metaClass = OS.objc_getMetaClass (className);
+ long metaClass = OS.objc_getMetaClass (className);
OS.class_addMethod(metaClass, OS.sel_isSelectorExcludedFromWebScript_, proc3, "@:@"); //$NON-NLS-1$
OS.class_addMethod(metaClass, OS.sel_webScriptNameForSelector_, proc3, "@:@"); //$NON-NLS-1$
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java
index 84ffab7f63..2c7fc9fd1f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java
@@ -309,7 +309,7 @@ class WebKit extends WebBrowser {
if (WEBKIT2) {
if (WebKitGTK.webkit_get_minor_version() >= 16) {
// TODO: webkit_website_data_manager_clear currently does not
- // support more fine grained removals. (I.e, session vs all cookies)
+ // support more fine grained removals. (I.e, session vs all cookies)
long context = WebKitGTK.webkit_web_context_get_default();
long manager = WebKitGTK.webkit_web_context_get_website_data_manager (context);
WebKitGTK.webkit_website_data_manager_clear(manager, WebKitGTK.WEBKIT_WEBSITE_DATA_COOKIES, 0, 0, 0, 0);
@@ -899,7 +899,7 @@ static long Proc (long handle, long arg0, long user_data) {
return 0;
}
- if (WEBKIT2 && user_data == DECIDE_DESTINATION) {
+ if (WEBKIT2 && user_data == DECIDE_DESTINATION) {
// This callback comes from WebKitDownload, so handle is WebKitDownload not webview.
// gboolean user_function (WebKitDownload *download, gchar *suggested_filename, gpointer user_data)
long webKitDownload = handle;
@@ -911,7 +911,7 @@ static long Proc (long handle, long arg0, long user_data) {
// void user_function (WebKitDownload *download, GError *error, gpointer user_data)
long webKitDownload = handle;
return webkit_download_failed(webKitDownload);
- }
+ }
}
{ // Callbacks connected with a WebView.
@@ -1621,11 +1621,11 @@ private boolean webkit_extension_modify_function (long pageId, String function,
@Override
public boolean execute (String script) {
if (WEBKIT2){
- if (!isJavascriptEnabled()) {
- System.err.println("SWT Webkit Warning: Attempting to execute javascript when javascript is dissabled."
- + "Execution has no effect. Script:\n" + script);
- return false;
- }
+ if (!isJavascriptEnabled()) {
+ System.err.println("SWT Webkit Warning: Attempting to execute javascript when javascript is dissabled."
+ + "Execution has no effect. Script:\n" + script);
+ return false;
+ }
try {
Webkit2AsyncToSync.runjavascript(script, this.browser, webView);
} catch (SWTException e) {
@@ -1925,9 +1925,9 @@ public Object evaluate (String script) throws SWTException {
return null; // A litte optimization. Sometimes evaluate() is called with a generated script, where the generated script is sometimes empty.
}
if (WEBKIT2){
- if (!isJavascriptEnabled()) {
- return null;
- }
+ if (!isJavascriptEnabled()) {
+ return null;
+ }
return Webkit2AsyncToSync.evaluate(script, this.browser, webView);
} else {
return super.evaluate(script);
@@ -3015,8 +3015,8 @@ long webkit_close_web_view (long web_view) {
browser.dispose ();
};
if (WEBKIT2) {
- // There is a subtle difference in Webkit1 vs Webkit2, in that on webkit2 this signal doesn't expect a return value.
- // As such, we can safley execute the SWT listeners later to avoid deadlocks. See bug 512001
+ // There is a subtle difference in Webkit1 vs Webkit2, in that on webkit2 this signal doesn't expect a return value.
+ // As such, we can safley execute the SWT listeners later to avoid deadlocks. See bug 512001
browser.getDisplay().asyncExec(fireCloseWindowListeners);
} else {
fireCloseWindowListeners.run();
@@ -3289,71 +3289,71 @@ long webkit_navigation_policy_decision_requested (long web_view, long frame, lon
long webkit_decide_policy (long web_view, long decision, int decision_type, long user_data) {
assert WEBKIT2 : WebKitGTK.Webkit2AssertMsg;
switch (decision_type) {
- case WebKitGTK.WEBKIT_POLICY_DECISION_TYPE_NAVIGATION_ACTION:
- long request = WebKitGTK. webkit_navigation_policy_decision_get_request(decision);
- if (request == 0){
- return 0;
- }
- long uri = WebKitGTK.webkit_uri_request_get_uri (request);
- String url = getString(uri);
- /*
- * If the URI indicates that the page is being rendered from memory
- * (via setText()) then set it to about:blank to be consistent with IE.
- */
- if (url.equals (URI_FILEROOT)) {
- url = ABOUT_BLANK;
- } else {
- int length = URI_FILEROOT.length ();
- if (url.startsWith (URI_FILEROOT) && url.charAt (length) == '#') {
- url = ABOUT_BLANK + url.substring (length);
- }
- }
-
- LocationEvent newEvent = new LocationEvent (browser);
- newEvent.display = browser.getDisplay ();
- newEvent.widget = browser;
- newEvent.location = url;
- newEvent.doit = true;
-
- try {
- nonBlockingEvaluate++;
- if (locationListeners != null) {
- for (int i = 0; i < locationListeners.length; i++) {
- locationListeners[i].changing (newEvent);
- }
- }
- } catch (Exception e) {
- throw e;
- } finally {
- nonBlockingEvaluate--;
- }
-
- if (newEvent.doit && !browser.isDisposed ()) {
- if (jsEnabled != jsEnabledOnNextPage) {
- jsEnabled = jsEnabledOnNextPage;
- webkit_settings_set(WebKitGTK.enable_javascript, jsEnabled ? 1 : 0);
- }
- }
- if(!newEvent.doit){
- WebKitGTK.webkit_policy_decision_ignore (decision);
- }
- break;
- case WebKitGTK.WEBKIT_POLICY_DECISION_TYPE_NEW_WINDOW_ACTION:
- break;
- case WebKitGTK.WEBKIT_POLICY_DECISION_TYPE_RESPONSE:
- long response = WebKitGTK.webkit_response_policy_decision_get_response(decision);
- long mime_type = WebKitGTK.webkit_uri_response_get_mime_type(response);
- boolean canShow = WebKitGTK.webkit_web_view_can_show_mime_type (webView, mime_type) != 0;
- if (!canShow) {
- WebKitGTK.webkit_policy_decision_download (decision);
- return 1;
- }
- break;
- default:
- /* Making no decision results in webkit_policy_decision_use(). */
- return 0;
- }
- return 0;
+ case WebKitGTK.WEBKIT_POLICY_DECISION_TYPE_NAVIGATION_ACTION:
+ long request = WebKitGTK. webkit_navigation_policy_decision_get_request(decision);
+ if (request == 0){
+ return 0;
+ }
+ long uri = WebKitGTK.webkit_uri_request_get_uri (request);
+ String url = getString(uri);
+ /*
+ * If the URI indicates that the page is being rendered from memory
+ * (via setText()) then set it to about:blank to be consistent with IE.
+ */
+ if (url.equals (URI_FILEROOT)) {
+ url = ABOUT_BLANK;
+ } else {
+ int length = URI_FILEROOT.length ();
+ if (url.startsWith (URI_FILEROOT) && url.charAt (length) == '#') {
+ url = ABOUT_BLANK + url.substring (length);
+ }
+ }
+
+ LocationEvent newEvent = new LocationEvent (browser);
+ newEvent.display = browser.getDisplay ();
+ newEvent.widget = browser;
+ newEvent.location = url;
+ newEvent.doit = true;
+
+ try {
+ nonBlockingEvaluate++;
+ if (locationListeners != null) {
+ for (int i = 0; i < locationListeners.length; i++) {
+ locationListeners[i].changing (newEvent);
+ }
+ }
+ } catch (Exception e) {
+ throw e;
+ } finally {
+ nonBlockingEvaluate--;
+ }
+
+ if (newEvent.doit && !browser.isDisposed ()) {
+ if (jsEnabled != jsEnabledOnNextPage) {
+ jsEnabled = jsEnabledOnNextPage;
+ webkit_settings_set(WebKitGTK.enable_javascript, jsEnabled ? 1 : 0);
+ }
+ }
+ if(!newEvent.doit){
+ WebKitGTK.webkit_policy_decision_ignore (decision);
+ }
+ break;
+ case WebKitGTK.WEBKIT_POLICY_DECISION_TYPE_NEW_WINDOW_ACTION:
+ break;
+ case WebKitGTK.WEBKIT_POLICY_DECISION_TYPE_RESPONSE:
+ long response = WebKitGTK.webkit_response_policy_decision_get_response(decision);
+ long mime_type = WebKitGTK.webkit_uri_response_get_mime_type(response);
+ boolean canShow = WebKitGTK.webkit_web_view_can_show_mime_type (webView, mime_type) != 0;
+ if (!canShow) {
+ WebKitGTK.webkit_policy_decision_download (decision);
+ return 1;
+ }
+ break;
+ default:
+ /* Making no decision results in webkit_policy_decision_use(). */
+ return 0;
+ }
+ return 0;
}
long webkit_notify_load_status (long web_view, long pspec) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/internal/webkit/JSClassDefinition.java b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/internal/webkit/JSClassDefinition.java
index a138b8eb5b..7d56ec5e64 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/internal/webkit/JSClassDefinition.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/internal/webkit/JSClassDefinition.java
@@ -16,38 +16,38 @@ package org.eclipse.swt.internal.webkit;
public class JSClassDefinition {
- public int version;
- public int attributes;
- /** @field cast=(const char*) */
- public long className;
- /** @field cast=(void*) */
- public long parentClass;
- /** @field cast=(const void*) */
- public long staticValues;
- /** @field cast=(const void*) */
- public long staticFunctions;
- /** @field cast=(void*) */
- public long initialize;
- /** @field cast=(void*) */
- public long finalize;
- /** @field cast=(void*) */
- public long hasProperty;
- /** @field cast=(void*) */
- public long getProperty;
- /** @field cast=(void*) */
- public long setProperty;
- /** @field cast=(void*) */
- public long deleteProperty;
- /** @field cast=(void*) */
- public long getPropertyNames;
- /** @field cast=(void*) */
- public long callAsFunction;
- /** @field cast=(void*) */
- public long callAsConstructor;
- /** @field cast=(void*) */
- public long hasInstance;
- /** @field cast=(void*) */
- public long convertToType;
+ public int version;
+ public int attributes;
+ /** @field cast=(const char*) */
+ public long className;
+ /** @field cast=(void*) */
+ public long parentClass;
+ /** @field cast=(const void*) */
+ public long staticValues;
+ /** @field cast=(const void*) */
+ public long staticFunctions;
+ /** @field cast=(void*) */
+ public long initialize;
+ /** @field cast=(void*) */
+ public long finalize;
+ /** @field cast=(void*) */
+ public long hasProperty;
+ /** @field cast=(void*) */
+ public long getProperty;
+ /** @field cast=(void*) */
+ public long setProperty;
+ /** @field cast=(void*) */
+ public long deleteProperty;
+ /** @field cast=(void*) */
+ public long getPropertyNames;
+ /** @field cast=(void*) */
+ public long callAsFunction;
+ /** @field cast=(void*) */
+ public long callAsConstructor;
+ /** @field cast=(void*) */
+ public long hasInstance;
+ /** @field cast=(void*) */
+ public long convertToType;
- public static final int sizeof = WebKitGTK.JSClassDefinition_sizeof();
+ public static final int sizeof = WebKitGTK.JSClassDefinition_sizeof();
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebDownloadDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebDownloadDelegate.java
index e7799807bc..822938173a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebDownloadDelegate.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebDownloadDelegate.java
@@ -130,8 +130,8 @@ int didFinish (long /*int*/ download) {
}
int didReceiveDataOfLength (long /*int*/ download, int length) {
- size += length;
- return COM.S_OK;
+ size += length;
+ return COM.S_OK;
}
int didReceiveResponse (long /*int*/ download, long /*int*/ response) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebFrameLoadDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebFrameLoadDelegate.java
index 26ac077c77..f15cfa6e31 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebFrameLoadDelegate.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebFrameLoadDelegate.java
@@ -229,7 +229,7 @@ int didCommitLoadForFrame (long /*int*/ webview, long /*int*/ frame) {
int hr = iWebFrame.dataSource (result);
if (hr != COM.S_OK || result[0] == 0) {
return COM.S_OK;
- }
+ }
IWebDataSource dataSource = new IWebDataSource (result[0]);
result[0] = 0;
hr = dataSource.request (result);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebKit.java b/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebKit.java
index 4220949516..829f49f037 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebKit.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebKit.java
@@ -348,8 +348,8 @@ static String readInstallDir (String keyString) {
}
}
OS.RegCloseKey (phkResult[0]);
- }
- return null;
+ }
+ return null;
}
static String stringFromCFString (long /*int*/ cfString) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebPolicyDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebPolicyDelegate.java
index f824bd7ac8..d09a8fd892 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebPolicyDelegate.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebPolicyDelegate.java
@@ -201,8 +201,8 @@ int unableToImplementPolicyWithError (long /*int*/ webView, long /*int*/ error,
result[0] = 0;
hr = iweberror.localizedDescription (result);
if (hr != COM.S_OK || result[0] == 0) {
- return COM.S_OK;
- }
+ return COM.S_OK;
+ }
String description = WebKit.extractBSTR (result[0]);
COM.SysFreeString (result[0]);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebResourceLoadDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebResourceLoadDelegate.java
index 47a2e4779a..3fccfff2c2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebResourceLoadDelegate.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/browser/WebResourceLoadDelegate.java
@@ -145,7 +145,7 @@ int didReceiveAuthenticationChallenge (long /*int*/ webView, long /*int*/ identi
hr = authenticationChallenge.protectionSpace (result);
if (hr != COM.S_OK || result[0] == 0) {
return COM.S_OK;
- }
+ }
IWebURLProtectionSpace space = new IWebURLProtectionSpace (result[0]);
String host = null, realm = null;
result[0] = 0;
@@ -162,7 +162,7 @@ int didReceiveAuthenticationChallenge (long /*int*/ webView, long /*int*/ identi
if (hr == COM.S_OK && result[0] != 0) {
realm = WebKit.extractBSTR (result[0]);
COM.SysFreeString (result[0]);
- }
+ }
}
}
space.Release ();
@@ -212,15 +212,15 @@ int identifierForInitialRequest (long /*int*/ webView, long /*int*/ request, lon
long /*int*/[] frame = new long /*int*/[1];
int hr = source.webFrame (frame);
if (hr != COM.S_OK || frame[0] == 0) {
- return COM.S_OK;
- }
+ return COM.S_OK;
+ }
new IWebFrame (frame[0]).Release ();
long /*int*/[] mainFrame = new long /*int*/[1];
IWebView iWebView = new IWebView (webView);
hr = iWebView.mainFrame (mainFrame);
if (hr != COM.S_OK || mainFrame[0] == 0) {
- return COM.S_OK;
- }
+ return COM.S_OK;
+ }
new IWebFrame (mainFrame[0]).Release ();
if (frame[0] == mainFrame[0]) {
long /*int*/ ptr = C.malloc (8);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/internal/webkit/JSClassDefinition.java b/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/internal/webkit/JSClassDefinition.java
index 057e9af2f1..dbfea019ee 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/internal/webkit/JSClassDefinition.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/org/eclipse/swt/internal/webkit/JSClassDefinition.java
@@ -16,39 +16,39 @@ package org.eclipse.swt.internal.webkit;
/** @jniclass flags=cpp */
public class JSClassDefinition {
- public int version;
- /** @field cast=(JSClassAttributes) */
- public int attributes;
- /** @field cast=(const char*) */
- public long /*int*/ className;
- /** @field cast=(JSClassRef) */
- public long /*int*/ parentClass;
- /** @field cast=(const JSStaticValue*) */
- public long /*int*/ staticValues;
- /** @field cast=(const JSStaticFunction*) */
- public long /*int*/ staticFunctions;
- /** @field cast=(JSObjectInitializeCallback) */
- public long /*int*/ initialize;
- /** @field cast=(JSObjectFinalizeCallback) */
- public long /*int*/ finalize;
- /** @field cast=(JSObjectHasPropertyCallback) */
- public long /*int*/ hasProperty;
- /** @field cast=(JSObjectGetPropertyCallback) */
- public long /*int*/ getProperty;
- /** @field cast=(JSObjectSetPropertyCallback) */
- public long /*int*/ setProperty;
- /** @field cast=(JSObjectDeletePropertyCallback) */
- public long /*int*/ deleteProperty;
- /** @field cast=(JSObjectGetPropertyNamesCallback) */
- public long /*int*/ getPropertyNames;
- /** @field cast=(JSObjectCallAsFunctionCallback) */
- public long /*int*/ callAsFunction;
- /** @field cast=(JSObjectCallAsConstructorCallback) */
- public long /*int*/ callAsConstructor;
- /** @field cast=(JSObjectHasInstanceCallback) */
- public long /*int*/ hasInstance;
- /** @field cast=(JSObjectConvertToTypeCallback) */
- public long /*int*/ convertToType;
+ public int version;
+ /** @field cast=(JSClassAttributes) */
+ public int attributes;
+ /** @field cast=(const char*) */
+ public long /*int*/ className;
+ /** @field cast=(JSClassRef) */
+ public long /*int*/ parentClass;
+ /** @field cast=(const JSStaticValue*) */
+ public long /*int*/ staticValues;
+ /** @field cast=(const JSStaticFunction*) */
+ public long /*int*/ staticFunctions;
+ /** @field cast=(JSObjectInitializeCallback) */
+ public long /*int*/ initialize;
+ /** @field cast=(JSObjectFinalizeCallback) */
+ public long /*int*/ finalize;
+ /** @field cast=(JSObjectHasPropertyCallback) */
+ public long /*int*/ hasProperty;
+ /** @field cast=(JSObjectGetPropertyCallback) */
+ public long /*int*/ getProperty;
+ /** @field cast=(JSObjectSetPropertyCallback) */
+ public long /*int*/ setProperty;
+ /** @field cast=(JSObjectDeletePropertyCallback) */
+ public long /*int*/ deleteProperty;
+ /** @field cast=(JSObjectGetPropertyNamesCallback) */
+ public long /*int*/ getPropertyNames;
+ /** @field cast=(JSObjectCallAsFunctionCallback) */
+ public long /*int*/ callAsFunction;
+ /** @field cast=(JSObjectCallAsConstructorCallback) */
+ public long /*int*/ callAsConstructor;
+ /** @field cast=(JSObjectHasInstanceCallback) */
+ public long /*int*/ hasInstance;
+ /** @field cast=(JSObjectConvertToTypeCallback) */
+ public long /*int*/ convertToType;
- public static final int sizeof = WebKit_win32.JSClassDefinition_sizeof();
+ public static final int sizeof = WebKit_win32.JSClassDefinition_sizeof();
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java
index f5587787fc..cd4a279669 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java
@@ -532,7 +532,7 @@ public void copyArea(Image image, int x, int y) {
destRect.width = destWidth;
destRect.height = destHeight;
data.image.handle.drawInRect(destRect, srcRect, OS.NSCompositeCopy, 1);
- NSGraphicsContext.static_restoreGraphicsState();
+ NSGraphicsContext.static_restoreGraphicsState();
return;
}
if (data.view != null) {
@@ -631,10 +631,10 @@ void copyArea (Image image, int x, int y, long srcImage) {
long context = OS.CGBitmapContextCreate(data, width, height, bpc, bpr, colorspace, alphaInfo);
OS.CGColorSpaceRelease(colorspace);
if (context != 0) {
- CGRect rect = new CGRect();
- rect.origin.x = -x;
- rect.origin.y = y;
- rect.size.width = OS.CGImageGetWidth(srcImage);
+ CGRect rect = new CGRect();
+ rect.origin.x = -x;
+ rect.origin.y = y;
+ rect.size.width = OS.CGImageGetWidth(srcImage);
rect.size.height = OS.CGImageGetHeight(srcImage);
OS.CGContextTranslateCTM(context, 0, -(rect.size.height - height));
OS.CGContextDrawImage(context, rect, srcImage);
@@ -689,7 +689,7 @@ public void copyArea(int srcX, int srcY, int width, int height, int destX, int d
if (image != null) {
NSImage imageHandle = image.handle;
NSSize size = imageHandle.size();
- int imgHeight = (int)size.height;
+ int imgHeight = (int)size.height;
handle.saveGraphicsState();
NSAffineTransform transform = NSAffineTransform.transform();
transform.scaleXBy(1, -1);
@@ -707,7 +707,7 @@ public void copyArea(int srcX, int srcY, int width, int height, int destX, int d
destRect.height = height;
imageHandle.drawInRect(destRect, srcRect, OS.NSCompositeCopy, 1);
handle.restoreGraphicsState();
- return;
+ return;
}
if (data.view != null) {
NSView view = data.view;
@@ -813,16 +813,16 @@ static long createCGPathRef(NSBezierPath nsPath) {
OS.CGPathMoveToPoint(cgPath, 0, pt[0], pt[1]);
break;
case OS.NSLineToBezierPathElement:
- C.memmove(pt, points, NSPoint.sizeof);
- OS.CGPathAddLineToPoint(cgPath, 0, pt[0], pt[1]);
+ C.memmove(pt, points, NSPoint.sizeof);
+ OS.CGPathAddLineToPoint(cgPath, 0, pt[0], pt[1]);
+ break;
+ case OS.NSCurveToBezierPathElement:
+ C.memmove(pt, points, NSPoint.sizeof * 3);
+ OS.CGPathAddCurveToPoint(cgPath, 0, pt[0], pt[1], pt[2], pt[3], pt[4], pt[5]);
+ break;
+ case OS.NSClosePathBezierPathElement:
+ OS.CGPathCloseSubpath(cgPath);
break;
- case OS.NSCurveToBezierPathElement:
- C.memmove(pt, points, NSPoint.sizeof * 3);
- OS.CGPathAddCurveToPoint(cgPath, 0, pt[0], pt[1], pt[2], pt[3], pt[4], pt[5]);
- break;
- case OS.NSClosePathBezierPathElement:
- OS.CGPathCloseSubpath(cgPath);
- break;
}
}
C.free(points);
@@ -1186,19 +1186,19 @@ public void drawImage(Image image, int srcX, int srcY, int srcWidth, int srcHeig
void drawImage(Image srcImage, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight, boolean simple) {
NSImage imageHandle = srcImage.handle;
NSSize size = imageHandle.size();
- int imgWidth = (int)size.width;
- int imgHeight = (int)size.height;
- if (simple) {
- srcWidth = destWidth = imgWidth;
- srcHeight = destHeight = imgHeight;
- } else {
- simple = srcX == 0 && srcY == 0 &&
- srcWidth == destWidth && destWidth == imgWidth &&
- srcHeight == destHeight && destHeight == imgHeight;
+ int imgWidth = (int)size.width;
+ int imgHeight = (int)size.height;
+ if (simple) {
+ srcWidth = destWidth = imgWidth;
+ srcHeight = destHeight = imgHeight;
+ } else {
+ simple = srcX == 0 && srcY == 0 &&
+ srcWidth == destWidth && destWidth == imgWidth &&
+ srcHeight == destHeight && destHeight == imgHeight;
if (srcX + srcWidth > imgWidth || srcY + srcHeight > imgHeight) {
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}
- }
+ }
NSAutoreleasePool pool = checkGC(CLIPPING | TRANSFORM);
try {
if (srcImage.memGC != null) {
@@ -1596,7 +1596,7 @@ public void drawRoundRectangle(int x, int y, int width, int height, int arcWidth
if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (arcWidth == 0 || arcHeight == 0) {
drawRectangle(x, y, width, height);
- return;
+ return;
}
NSAutoreleasePool pool = checkGC(DRAW);
try {
@@ -2288,7 +2288,7 @@ public void fillRoundRectangle(int x, int y, int width, int height, int arcWidth
if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (arcWidth == 0 || arcHeight == 0) {
fillRectangle(x, y, width, height);
- return;
+ return;
}
NSAutoreleasePool pool = checkGC(FILL);
try {
@@ -3142,7 +3142,7 @@ public boolean isDisposed() {
boolean isIdentity(float[] transform) {
return transform[0] == 1 && transform[1] == 0 && transform[2] == 0
- && transform[3] == 1 && transform[4] == 0 && transform[5] == 0;
+ && transform[3] == 1 && transform[4] == 0 && transform[5] == 0;
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/TextLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/TextLayout.java
index 63ca42bfda..4f8f4f7140 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/TextLayout.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/TextLayout.java
@@ -335,9 +335,9 @@ void computeRuns() {
long rangePtr = C.malloc(NSRange.sizeof);
NSRange lineRange = new NSRange();
for (numberOfLines = 0, index = 0; index < numberOfGlyphs; numberOfLines++){
- layoutManager.lineFragmentUsedRectForGlyphAtIndex(index, rangePtr, true);
- OS.memmove(lineRange, rangePtr, NSRange.sizeof);
- index = lineRange.location + lineRange.length;
+ layoutManager.lineFragmentUsedRectForGlyphAtIndex(index, rangePtr, true);
+ OS.memmove(lineRange, rangePtr, NSRange.sizeof);
+ index = lineRange.location + lineRange.length;
}
if (numberOfLines == 0) numberOfLines++;
int[] offsets = new int[numberOfLines + 1];
@@ -345,9 +345,9 @@ void computeRuns() {
for (numberOfLines = 0, index = 0; index < numberOfGlyphs; numberOfLines++){
bounds[numberOfLines] = layoutManager.lineFragmentUsedRectForGlyphAtIndex(index, rangePtr, true);
if (numberOfLines < bounds.length - 1) bounds[numberOfLines].height -= spacing;
- OS.memmove(lineRange, rangePtr, NSRange.sizeof);
- offsets[numberOfLines] = (int)lineRange.location;
- index = lineRange.location + lineRange.length;
+ OS.memmove(lineRange, rangePtr, NSRange.sizeof);
+ offsets[numberOfLines] = (int)lineRange.location;
+ index = lineRange.location + lineRange.length;
}
if (numberOfLines == 0) {
Font font = this.font != null ? this.font : device.systemFont;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Button.java
index 92217d86ef..61e1db5cb2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Button.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Button.java
@@ -644,7 +644,7 @@ public boolean getSelection () {
checkWidget ();
if ((style & (SWT.CHECK | SWT.RADIO | SWT.TOGGLE)) == 0) return false;
if ((style & SWT.CHECK) != 0 && grayed) return ((NSButton)view).state() == OS.NSMixedState;
- return ((NSButton)view).state() == OS.NSOnState;
+ return ((NSButton)view).state() == OS.NSOnState;
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Canvas.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Canvas.java
index 851ff6b125..db015eb915 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Canvas.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Canvas.java
@@ -182,7 +182,7 @@ void drawWidget (long id, NSGraphicsContext context, NSRect rect) {
Image image = caret.image;
if (image != null) {
NSImage imageHandle = image.handle;
- NSSize size = imageHandle.size();
+ NSSize size = imageHandle.size();
NSImageRep imageRep = ImageUtil.createImageRep(image, size);
if (!imageRep.isKindOfClass(OS.class_NSBitmapImageRep)) return;
NSBitmapImageRep rep = new NSBitmapImageRep(imageRep);
@@ -191,25 +191,25 @@ void drawWidget (long id, NSGraphicsContext context, NSRect rect) {
destRect.origin.y = caret.y;
destRect.size.width = size.width;
destRect.size.height = size.height;
- long data = rep.bitmapData();
+ long data = rep.bitmapData();
long format = rep.bitmapFormat();
- long bpr = rep.bytesPerRow();
+ long bpr = rep.bytesPerRow();
int alphaInfo;
if (rep.hasAlpha()) {
alphaInfo = (format & OS.NSAlphaFirstBitmapFormat) != 0 ? OS.kCGImageAlphaFirst : OS.kCGImageAlphaLast;
} else {
alphaInfo = (format & OS.NSAlphaFirstBitmapFormat) != 0 ? OS.kCGImageAlphaNoneSkipFirst : OS.kCGImageAlphaNoneSkipLast;
}
- long provider = OS.CGDataProviderCreateWithData(0, data, bpr * (int)size.height, 0);
+ long provider = OS.CGDataProviderCreateWithData(0, data, bpr * (int)size.height, 0);
long colorspace = OS.CGColorSpaceCreateDeviceRGB();
long cgImage = OS.CGImageCreate((int)size.width, (int)size.height, rep.bitsPerSample(), rep.bitsPerPixel(), bpr, colorspace, alphaInfo, provider, 0, true, 0);
OS.CGColorSpaceRelease(colorspace);
OS.CGDataProviderRelease(provider);
- OS.CGContextScaleCTM (ctx, 1, -1);
- OS.CGContextTranslateCTM (ctx, 0, -(size.height + 2 * destRect.origin.y));
+ OS.CGContextScaleCTM (ctx, 1, -1);
+ OS.CGContextTranslateCTM (ctx, 0, -(size.height + 2 * destRect.origin.y));
OS.CGContextSetBlendMode (ctx, OS.kCGBlendModeDifference);
OS.CGContextDrawImage (ctx, destRect, cgImage);
- OS.CGImageRelease(cgImage);
+ OS.CGImageRelease(cgImage);
} else {
CGRect drawRect = new CGRect();
drawRect.origin.x = caret.x;
@@ -252,7 +252,7 @@ NSRect firstRectForCharacterRange (long id, long sel, long range) {
*/
public Caret getCaret () {
checkWidget();
- return caret;
+ return caret;
}
/**
@@ -269,7 +269,7 @@ public Caret getCaret () {
*/
public IME getIME () {
checkWidget();
- return ime;
+ return ime;
}
@Override
@@ -305,38 +305,38 @@ NSRange markedRange (long id, long sel) {
@Override
boolean readSelectionFromPasteboard(long id, long sel, long pasteboard) {
- boolean result = false;
- NSPasteboard pboard = new NSPasteboard(pasteboard);
- NSArray availableTypes = pboard.types();
- NSString type;
-
- for (long i = 0; i < supportedPboardTypes.count(); i++) {
- if (result) break;
- type = new NSString(supportedPboardTypes.objectAtIndex(i));
- if (availableTypes.containsObject(type)) {
- result = readSelectionFromPasteboard(pboard, type);
- }
- }
- return result;
+ boolean result = false;
+ NSPasteboard pboard = new NSPasteboard(pasteboard);
+ NSArray availableTypes = pboard.types();
+ NSString type;
+
+ for (long i = 0; i < supportedPboardTypes.count(); i++) {
+ if (result) break;
+ type = new NSString(supportedPboardTypes.objectAtIndex(i));
+ if (availableTypes.containsObject(type)) {
+ result = readSelectionFromPasteboard(pboard, type);
+ }
+ }
+ return result;
}
boolean readSelectionFromPasteboard(NSPasteboard pboard, NSString type) {
- boolean result = false;
- NSString newSelection = null;
- if (type.isEqualToString(OS.NSPasteboardTypeString)) {
- NSString string = pboard.stringForType(OS.NSPasteboardTypeString);
- if (string != null && string.length() > 0) {
- newSelection = string;
- }
- }
+ boolean result = false;
+ NSString newSelection = null;
+ if (type.isEqualToString(OS.NSPasteboardTypeString)) {
+ NSString string = pboard.stringForType(OS.NSPasteboardTypeString);
+ if (string != null && string.length() > 0) {
+ newSelection = string;
+ }
+ }
- if (newSelection != null) {
- Accessible acc = getAccessible();
- acc.internal_accessibilitySetValue_forAttribute(newSelection, OS.NSAccessibilitySelectedTextAttribute, ACC.CHILDID_SELF);
- result = true;
- }
+ if (newSelection != null) {
+ Accessible acc = getAccessible();
+ acc.internal_accessibilitySetValue_forAttribute(newSelection, OS.NSAccessibilitySelectedTextAttribute, ACC.CHILDID_SELF);
+ result = true;
+ }
- return result;
+ return result;
}
@Override
@@ -496,7 +496,7 @@ public void scroll (int destX, int destY, int x, int y, int width, int height, b
}
}
- if (all) {
+ if (all) {
Control [] children = _getChildren ();
for (int i=0; i<children.length; i++) {
Control child = children [i];
@@ -659,26 +659,26 @@ void viewWillMoveToWindow(long id, long sel, long arg0) {
@Override
boolean writeSelectionToPasteboard(long id, long sel, long pasteboardObj, long typesObj) {
- boolean result = false;
- NSPasteboard pboard = new NSPasteboard(pasteboardObj);
- NSArray types = new NSArray(typesObj);
- NSMutableArray typesToDeclare = NSMutableArray.arrayWithCapacity(2);
- NSString type;
-
- for (long i = 0; i < supportedPboardTypes.count(); i++) {
- type = new NSString(supportedPboardTypes.objectAtIndex(i));
- if (types.containsObject(type)) typesToDeclare.addObject(type);
- }
-
- if (typesToDeclare.count() > 0) {
- pboard.declareTypes(typesToDeclare, view);
- for (long i = 0; i < typesToDeclare.count(); i++) {
- type = new NSString(typesToDeclare.objectAtIndex(i));
- if (writeSelectionToPasteboard(pboard, type)) result = true;
- }
- }
-
- return result;
+ boolean result = false;
+ NSPasteboard pboard = new NSPasteboard(pasteboardObj);
+ NSArray types = new NSArray(typesObj);
+ NSMutableArray typesToDeclare = NSMutableArray.arrayWithCapacity(2);
+ NSString type;
+
+ for (long i = 0; i < supportedPboardTypes.count(); i++) {
+ type = new NSString(supportedPboardTypes.objectAtIndex(i));
+ if (types.containsObject(type)) typesToDeclare.addObject(type);
+ }
+
+ if (typesToDeclare.count() > 0) {
+ pboard.declareTypes(typesToDeclare, view);
+ for (long i = 0; i < typesToDeclare.count(); i++) {
+ type = new NSString(typesToDeclare.objectAtIndex(i));
+ if (writeSelectionToPasteboard(pboard, type)) result = true;
+ }
+ }
+
+ return result;
}
boolean writeSelectionToPasteboard(NSPasteboard pboard, NSString type) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Combo.java
index c04bb46b4c..078226bedf 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Combo.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Combo.java
@@ -598,7 +598,7 @@ public void cut () {
@Override
Color defaultBackground () {
- return display.getWidgetColor (SWT.COLOR_LIST_BACKGROUND);
+ return display.getWidgetColor (SWT.COLOR_LIST_BACKGROUND);
}
@Override
@@ -609,7 +609,7 @@ NSFont defaultNSFont() {
@Override
Color defaultForeground () {
- return display.getWidgetColor (SWT.COLOR_LIST_FOREGROUND);
+ return display.getWidgetColor (SWT.COLOR_LIST_FOREGROUND);
}
@Override
@@ -888,7 +888,7 @@ public boolean getListVisible () {
@Override
String getNameText () {
- return getText ();
+ return getText ();
}
@Override
@@ -1042,7 +1042,7 @@ public int getTextHeight () {
*/
public int getTextLimit () {
checkWidget();
- return textLimit;
+ return textLimit;
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
index cb72b33086..446d378862 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
@@ -1257,7 +1257,7 @@ boolean drawGripper (GC gc, int x, int y, int width, int height, boolean vertica
}
boolean drawsBackground() {
- return true;
+ return true;
}
@Override
@@ -1387,8 +1387,8 @@ void fixFocus (Control focusControl) {
shell.setSavedFocus (focusControl);
NSWindow window = view.window();
if (!window.makeFirstResponder(null)) {
- // Force first responder to resign.
- window.endEditingFor(null);
+ // Force first responder to resign.
+ window.endEditingFor(null);
}
}
@@ -1627,7 +1627,7 @@ public Image getBackgroundImage () {
*/
public int getBorderWidth () {
checkWidget();
- return 0;
+ return 0;
}
/**
@@ -3538,10 +3538,10 @@ Touch touchStateFromNSTouch(NSTouch touch) {
display.touchCounter++;
boolean primary = false;
NSPoint normalizedPos = touch.normalizedPosition();
- double normalizedX = normalizedPos.x;
- double normalizedY = 1 - normalizedPos.y;
- if (display.currentTouches().count() == 1) display.primaryIdentifier = identity;
- if (display.primaryIdentifier == identity) primary = true;
+ double normalizedX = normalizedPos.x;
+ double normalizedY = 1 - normalizedPos.y;
+ if (display.currentTouches().count() == 1) display.primaryIdentifier = identity;
+ if (display.primaryIdentifier == identity) primary = true;
NSSize deviceSize = touch.deviceSize();
int deviceX = (int) (normalizedX * deviceSize.width);
int deviceY = (int) (normalizedY * deviceSize.height);
@@ -4538,13 +4538,13 @@ void sort (int [] items) {
for (int gap=length/2; gap>0; gap/=2) {
for (int i=gap; i<length; i++) {
for (int j=i-gap; j>=0; j-=gap) {
- if (items [j] <= items [j + gap]) {
+ if (items [j] <= items [j + gap]) {
int swap = items [j];
items [j] = items [j + gap];
items [j + gap] = swap;
- }
- }
- }
+ }
+ }
+ }
}
}
@@ -4588,7 +4588,7 @@ String tooltipText () {
*/
public Point toControl (int x, int y) {
checkWidget();
- return display.map (null, this, x, y);
+ return display.map (null, this, x, y);
}
/**
@@ -4614,7 +4614,7 @@ public Point toControl (int x, int y) {
public Point toControl (Point point) {
checkWidget();
if (point == null) error (SWT.ERROR_NULL_ARGUMENT);
- return toControl (point.x, point.y);
+ return toControl (point.x, point.y);
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Decorations.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Decorations.java
index d889e35811..09220725b2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Decorations.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Decorations.java
@@ -688,16 +688,16 @@ void sort (Image [] images) {
for (int gap=length/2; gap>0; gap/=2) {
for (int i=gap; i<length; i++) {
for (int j=i-gap; j>=0; j-=gap) {
- if (compare (datas [j], datas [j + gap]) >= 0) {
+ if (compare (datas [j], datas [j + gap]) >= 0) {
Image swap = images [j];
images [j] = images [j + gap];
images [j + gap] = swap;
ImageData swapData = datas [j];
datas [j] = datas [j + gap];
datas [j + gap] = swapData;
- }
- }
- }
+ }
+ }
+ }
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
index 5dbf3cf255..cc443d2368 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
@@ -3352,35 +3352,35 @@ public boolean post(Event event) {
mouseCursorPosition.y = event.y;
eventRef = OS.CGEventCreateMouseEvent(eventSource, OS.kCGEventMouseMoved, mouseCursorPosition, 0);
} else {
- NSPoint nsCursorPosition = NSEvent.mouseLocation();
- NSRect primaryFrame = getPrimaryFrame();
- mouseCursorPosition.x = nsCursorPosition.x;
- mouseCursorPosition.y = (int) (primaryFrame.height - nsCursorPosition.y);
- int eventType = 0;
- // SWT buttons are 1-based: 1,2,3,4,5; CG buttons are 0 based: 0,2,1,3,4
- int cgButton;
- switch (event.button) {
- case 1:
- eventType = (event.type == SWT.MouseDown ? OS.kCGEventLeftMouseDown : OS.kCGEventLeftMouseUp);
- cgButton = 0;
- break;
- case 2:
- eventType = (event.type == SWT.MouseDown ? OS.kCGEventOtherMouseDown : OS.kCGEventOtherMouseUp);
- cgButton = 2;
- break;
- case 3:
- eventType = (event.type == SWT.MouseDown ? OS.kCGEventRightMouseDown : OS.kCGEventRightMouseUp);
- cgButton = 1;
- break;
- default:
- eventType = (event.type == SWT.MouseDown ? OS.kCGEventOtherMouseDown : OS.kCGEventOtherMouseUp);
- cgButton = event.button - 1;
- break;
- }
-
- if (cgButton >= 0) {
- eventRef = OS.CGEventCreateMouseEvent(eventSource, eventType, mouseCursorPosition, cgButton);
- }
+ NSPoint nsCursorPosition = NSEvent.mouseLocation();
+ NSRect primaryFrame = getPrimaryFrame();
+ mouseCursorPosition.x = nsCursorPosition.x;
+ mouseCursorPosition.y = (int) (primaryFrame.height - nsCursorPosition.y);
+ int eventType = 0;
+ // SWT buttons are 1-based: 1,2,3,4,5; CG buttons are 0 based: 0,2,1,3,4
+ int cgButton;
+ switch (event.button) {
+ case 1:
+ eventType = (event.type == SWT.MouseDown ? OS.kCGEventLeftMouseDown : OS.kCGEventLeftMouseUp);
+ cgButton = 0;
+ break;
+ case 2:
+ eventType = (event.type == SWT.MouseDown ? OS.kCGEventOtherMouseDown : OS.kCGEventOtherMouseUp);
+ cgButton = 2;
+ break;
+ case 3:
+ eventType = (event.type == SWT.MouseDown ? OS.kCGEventRightMouseDown : OS.kCGEventRightMouseUp);
+ cgButton = 1;
+ break;
+ default:
+ eventType = (event.type == SWT.MouseDown ? OS.kCGEventOtherMouseDown : OS.kCGEventOtherMouseUp);
+ cgButton = event.button - 1;
+ break;
+ }
+
+ if (cgButton >= 0) {
+ eventRef = OS.CGEventCreateMouseEvent(eventSource, eventType, mouseCursorPosition, cgButton);
+ }
}
break;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java
index d5c387e2f1..17a127f42a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java
@@ -533,7 +533,7 @@ public int getItemHeight () {
*/
public String [] getItems () {
checkWidget();
- String [] result = new String [itemCount];
+ String [] result = new String [itemCount];
System.arraycopy (items, 0, result, 0, itemCount);
return result;
}
@@ -662,9 +662,9 @@ public int getTopIndex () {
NSPoint point = new NSPoint();
point.x = rect.x;
point.y = rect.y;
- int result = (int)((NSTableView)view).rowAtPoint(point);
- if (result == -1) result = 0;
- return result;
+ int result = (int)((NSTableView)view).rowAtPoint(point);
+ if (result == -1) result = 0;
+ return result;
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Menu.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Menu.java
index fe5781d32d..1b13ad200e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Menu.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Menu.java
@@ -1116,7 +1116,7 @@ public void setLocation (Point location) {
* @since 3.7
*/
public void setOrientation (int orientation) {
- checkWidget ();
+ checkWidget ();
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/MenuItem.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/MenuItem.java
index f1cc69ec6a..2e80ce17df 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/MenuItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/MenuItem.java
@@ -366,7 +366,7 @@ public Menu getParent () {
public boolean getSelection () {
checkWidget ();
if ((style & (SWT.CHECK | SWT.RADIO)) == 0) return false;
- return nsItem.state() == OS.NSOnState;
+ return nsItem.state() == OS.NSOnState;
}
/**
@@ -894,12 +894,12 @@ public void setToolTipText (String toolTip) {
}
if (toolTip == null || toolTip.trim().length() == 0 || toolTip.equals(toolTipText)) return;
- toolTipText = toolTip;
+ toolTipText = toolTip;
- char[] chars = new char [toolTipText.length ()];
- toolTipText.getChars (0, chars.length, chars, 0);
- int length = fixMnemonic (chars);
- nsItem.setToolTip (NSString.stringWithCharacters (chars, length));
+ char[] chars = new char [toolTipText.length ()];
+ toolTipText.getChars (0, chars.length, chars, 0);
+ int length = fixMnemonic (chars);
+ nsItem.setToolTip (NSString.stringWithCharacters (chars, length));
}
void updateText () {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ProgressBar.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ProgressBar.java
index 14cb1b77c0..39b6836c02 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ProgressBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ProgressBar.java
@@ -188,7 +188,7 @@ public int getMinimum () {
*/
public int getSelection () {
checkWidget();
- return (int)((NSProgressIndicator)view).doubleValue();
+ return (int)((NSProgressIndicator)view).doubleValue();
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scale.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scale.java
index 67776cf140..7e5d6cef36 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scale.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scale.java
@@ -216,7 +216,7 @@ public int getMinimum () {
*/
public int getPageIncrement () {
checkWidget();
- return pageIncrement;
+ return pageIncrement;
}
/**
@@ -231,7 +231,7 @@ public int getPageIncrement () {
*/
public int getSelection () {
checkWidget();
- return (int)((NSSlider)view).doubleValue();
+ return (int)((NSSlider)view).doubleValue();
}
@Override
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ScrollBar.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ScrollBar.java
index 05ad18ed1c..ebb4437e14 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ScrollBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ScrollBar.java
@@ -188,7 +188,7 @@ public boolean getEnabled () {
*/
public int getIncrement () {
checkWidget();
- return increment;
+ return increment;
}
/**
@@ -235,7 +235,7 @@ public int getMinimum () {
*/
public int getPageIncrement () {
checkWidget();
- return pageIncrement;
+ return pageIncrement;
}
/**
@@ -267,7 +267,7 @@ public int getSelection () {
checkWidget();
NSScroller widget = (NSScroller)view;
double value = widget.doubleValue();
- return (int)(0.5f + ((maximum - thumb - minimum) * value + minimum));
+ return (int)(0.5f + ((maximum - thumb - minimum) * value + minimum));
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scrollable.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scrollable.java
index e220de04fc..35acca13c6 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scrollable.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scrollable.java
@@ -36,7 +36,7 @@ import org.eclipse.swt.internal.cocoa.*;
* @noextend This class is not intended to be subclassed by clients.
*/
public abstract class Scrollable extends Control {
- NSScrollView scrollView;
+ NSScrollView scrollView;
ScrollBar horizontalBar, verticalBar;
Scrollable () {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java
index 1b0caf89bf..f0aabd4002 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java
@@ -668,9 +668,9 @@ void createHandle () {
} else {
styleMask |= OS.NSUtilityWindowMask | OS.NSNonactivatingPanelMask;
}
- } else {
- window = (NSWindow) new SWTWindow().alloc ();
- }
+ } else {
+ window = (NSWindow) new SWTWindow().alloc ();
+ }
if ((style & SWT.NO_TRIM) == 0) {
if ((style & SWT.TITLE) != 0) styleMask |= OS.NSTitledWindowMask;
if ((style & SWT.CLOSE) != 0) styleMask |= OS.NSClosableWindowMask;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Slider.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Slider.java
index e1014978cb..fda67becd0 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Slider.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Slider.java
@@ -225,7 +225,7 @@ void enableWidget(boolean enabled) {
*/
public int getIncrement () {
checkWidget();
- return increment;
+ return increment;
}
/**
@@ -255,7 +255,7 @@ public int getMaximum () {
*/
public int getMinimum () {
checkWidget();
- return minimum;
+ return minimum;
}
/**
@@ -272,7 +272,7 @@ public int getMinimum () {
*/
public int getPageIncrement () {
checkWidget();
- return pageIncrement;
+ return pageIncrement;
}
/**
@@ -289,7 +289,7 @@ public int getSelection () {
checkWidget();
NSScroller widget = (NSScroller)view;
double value = widget.doubleValue();
- return (int)(0.5f + ((maximum - thumb - minimum) * value + minimum));
+ return (int)(0.5f + ((maximum - thumb - minimum) * value + minimum));
}
/**
@@ -304,7 +304,7 @@ public int getSelection () {
*/
public int getThumb () {
checkWidget();
- return thumb;
+ return thumb;
}
/**
@@ -338,25 +338,25 @@ void sendSelection () {
int hitPart = (int)((NSScroller)view).hitPart();
int value = getSelection ();
switch (hitPart) {
- case OS.NSScrollerDecrementLine:
- event.detail = SWT.ARROW_UP;
- value -= increment;
- break;
- case OS.NSScrollerDecrementPage:
- value -= pageIncrement;
- event.detail = SWT.PAGE_UP;
- break;
- case OS.NSScrollerIncrementLine:
- value += increment;
- event.detail = SWT.ARROW_DOWN;
- break;
- case OS.NSScrollerIncrementPage:
- value += pageIncrement;
- event.detail = SWT.PAGE_DOWN;
- break;
- case OS.NSScrollerKnob:
+ case OS.NSScrollerDecrementLine:
+ event.detail = SWT.ARROW_UP;
+ value -= increment;
+ break;
+ case OS.NSScrollerDecrementPage:
+ value -= pageIncrement;
+ event.detail = SWT.PAGE_UP;
+ break;
+ case OS.NSScrollerIncrementLine:
+ value += increment;
+ event.detail = SWT.ARROW_DOWN;
+ break;
+ case OS.NSScrollerIncrementPage:
+ value += pageIncrement;
+ event.detail = SWT.PAGE_DOWN;
+ break;
+ case OS.NSScrollerKnob:
event.detail = SWT.DRAG;
- break;
+ break;
}
if (event.detail != SWT.DRAG) {
setSelection(value);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Spinner.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Spinner.java
index b5ed9d4f6d..23d1b70abf 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Spinner.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Spinner.java
@@ -364,7 +364,7 @@ void drawInteriorWithFrame_inView(long id, long sel, NSRect cellFrame, long view
Image image = control.backgroundImage;
if (image != null && !image.isDisposed()) {
NSGraphicsContext context = NSGraphicsContext.currentContext();
- control.fillBackground (view, context, cellFrame, -1);
+ control.fillBackground (view, context, cellFrame, -1);
}
super.drawInteriorWithFrame_inView(id, sel, cellFrame, viewid);
}
@@ -551,7 +551,7 @@ public String getText () {
*/
public int getTextLimit () {
checkWidget();
- return textLimit;
+ return textLimit;
}
@Override
@@ -725,39 +725,39 @@ boolean sendKeyEvent (NSEvent nsEvent, int type) {
return true;
}
- case 116: delta = pageIncrement; break; /* Page Up */
- case 121: delta = -pageIncrement; break; /* Page Down */
- case 125: delta = -getIncrement(); break; /* Down arrow */
- case 126: delta = getIncrement(); break; /* Up arrow */
- }
-
- if (delta != 0) {
- boolean [] parseFail = new boolean [1];
- int value = getSelectionText (parseFail);
- if (parseFail [0]) {
- value = (int)buttonView.doubleValue();
- }
- int newValue = value + delta;
- int max = (int)buttonView.maxValue();
- int min = (int)buttonView.minValue();
- if ((style & SWT.WRAP) != 0) {
- if (newValue > max) newValue = min;
- if (newValue < min) newValue = max;
- }
- newValue = Math.min (Math.max (min, newValue), max);
- if (value != newValue) setSelection (newValue, true, true, true);
- // Prevent the arrow or page up/down from being handled by the text field.
- result = false;
- } else {
- boolean [] parseFail = new boolean [1];
- int value = getSelectionText (parseFail);
- if (!parseFail [0]) {
- int pos = (int)buttonView.doubleValue();
- if (pos != value) setSelection (value, true, false, true);
- }
- }
-
- return result;
+ case 116: delta = pageIncrement; break; /* Page Up */
+ case 121: delta = -pageIncrement; break; /* Page Down */
+ case 125: delta = -getIncrement(); break; /* Down arrow */
+ case 126: delta = getIncrement(); break; /* Up arrow */
+ }
+
+ if (delta != 0) {
+ boolean [] parseFail = new boolean [1];
+ int value = getSelectionText (parseFail);
+ if (parseFail [0]) {
+ value = (int)buttonView.doubleValue();
+ }
+ int newValue = value + delta;
+ int max = (int)buttonView.maxValue();
+ int min = (int)buttonView.minValue();
+ if ((style & SWT.WRAP) != 0) {
+ if (newValue > max) newValue = min;
+ if (newValue < min) newValue = max;
+ }
+ newValue = Math.min (Math.max (min, newValue), max);
+ if (value != newValue) setSelection (newValue, true, true, true);
+ // Prevent the arrow or page up/down from being handled by the text field.
+ result = false;
+ } else {
+ boolean [] parseFail = new boolean [1];
+ int value = getSelectionText (parseFail);
+ if (!parseFail [0]) {
+ int pos = (int)buttonView.doubleValue();
+ if (pos != value) setSelection (value, true, false, true);
+ }
+ }
+
+ return result;
}
@Override
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java
index fc32bd96be..a59833a48d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java
@@ -2084,7 +2084,7 @@ void mouseDownSuper(long id, long sel, long theEvent) {
NSRect checkRect = cell.imageRectForBounds(widget.frameOfCellAtColumn(column, row));
if (OS.NSPointInRect(pt, checkRect)) {
check = preventSelect = true;
- }
+ }
}
}
if (!check && row != -1 && (nsEvent.modifierFlags() & OS.NSDeviceIndependentModifierFlagsMask) == 0 && nsEvent.clickCount() == 1) {
@@ -2796,7 +2796,7 @@ public void setRedraw (boolean redraw) {
checkWidget ();
super.setRedraw (redraw);
if (redraw && drawCount == 0) {
- /* Resize the item array to match the item count */
+ /* Resize the item array to match the item count */
if (items.length > 4 && items.length - itemCount > 3) {
int length = Math.max (4, (itemCount + 3) / 4 * 4);
TableItem [] newItems = new TableItem [length];
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableColumn.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableColumn.java
index 4f67ed287f..e2b84453f9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableColumn.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableColumn.java
@@ -368,9 +368,9 @@ void drawInteriorWithFrame_inView (long id, long sel, NSRect cellRect, long view
if (isFlipped) {
context.saveGraphicsState ();
NSAffineTransform transform = NSAffineTransform.transform ();
- transform.scaleXBy (1, -1);
- transform.translateXBy (0, -(destRect.height + 2 * destRect.y));
- transform.concat ();
+ transform.scaleXBy (1, -1);
+ transform.translateXBy (0, -(destRect.height + 2 * destRect.y));
+ transform.concat ();
}
NSRect sourceRect = new NSRect ();
sourceRect.width = destRect.width;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Text.java
index 3e092ac31b..7014f7114b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Text.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Text.java
@@ -720,7 +720,7 @@ void drawInteriorWithFrame_inView (long id, long sel, NSRect cellFrame, long vie
if (image != null && !image.isDisposed()) {
NSGraphicsContext context = NSGraphicsContext.currentContext();
- control.fillBackground (view, context, cellFrame, -1);
+ control.fillBackground (view, context, cellFrame, -1);
} else if ((style & SWT.SEARCH) != 0) {
// If no background image is set, call custom paint code for search field
drawInteriorWithFrame_inView_searchfield(id, sel, cellFrame, viewid);
@@ -836,7 +836,7 @@ Cursor findCursor () {
public int getCaretLineNumber () {
checkWidget ();
if ((style & SWT.SINGLE) != 0) return 0;
- return (getTopPixel () + getCaretLocation ().y) / getLineHeight ();
+ return (getTopPixel () + getCaretLocation ().y) / getLineHeight ();
}
@Override
@@ -936,7 +936,7 @@ public int getCharCount () {
*/
public boolean getDoubleClickEnabled () {
checkWidget ();
- return doubleClick;
+ return doubleClick;
}
/**
@@ -1375,7 +1375,7 @@ public char[] getTextChars () {
*/
public int getTextLimit () {
checkWidget ();
- return textLimit;
+ return textLimit;
}
/**
@@ -1395,7 +1395,7 @@ public int getTextLimit () {
public int getTopIndex () {
checkWidget ();
if ((style & SWT.SINGLE) != 0) return 0;
- return getTopPixel () / getLineHeight ();
+ return getTopPixel () / getLineHeight ();
}
/**
@@ -2380,7 +2380,7 @@ boolean shouldChangeTextInRange_replacementString(long id, long sel, long affect
}
if ((style & SWT.SINGLE) != 0) {
if (text != newText || echoCharacter != '\0') {
- //handle backspace and delete
+ //handle backspace and delete
if (range.length == 1) {
NSText editor = new NSText(id);
editor.setSelectedRange (range);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolBar.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolBar.java
index 70cd65b720..699a0d64e2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolBar.java
@@ -278,13 +278,13 @@ void createItem (ToolItem item, int index) {
System.arraycopy (items, 0, newItems, 0, items.length);
items = newItems;
}
- item.createWidget();
+ item.createWidget();
System.arraycopy (items, index, items, index + 1, itemCount++ - index);
items [index] = item;
if (nsToolbar != null) {
- nsToolbar.insertItemWithItemIdentifier(item.getItemID(), index);
+ nsToolbar.insertItemWithItemIdentifier(item.getItemID(), index);
} else {
- view.addSubview(item.view);
+ view.addSubview(item.view);
}
relayout ();
}
@@ -671,11 +671,11 @@ void releaseChildren (boolean destroy) {
@Override
void releaseHandle () {
- super.releaseHandle ();
+ super.releaseHandle ();
- if (nsToolbar != null) {
- nsToolbar.release();
- nsToolbar = null;
+ if (nsToolbar != null) {
+ nsToolbar.release();
+ nsToolbar = null;
}
if (accessibilityAttributes != null) accessibilityAttributes.release();
@@ -768,8 +768,8 @@ public void setRedraw (boolean redraw) {
@Override
public void setVisible(boolean visible) {
- if (nsToolbar != null) nsToolbar.setVisible(visible);
- super.setVisible(visible);
+ if (nsToolbar != null) nsToolbar.setVisible(visible);
+ super.setVisible(visible);
}
@Override
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java
index ab80291ad7..b5df4a903b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java
@@ -459,11 +459,11 @@ void drawImageWithFrameInView (long id, long sel, long image, NSRect rect, long
@Override
NSRect drawTitleWithFrameInView (long id, long sel, long title, NSRect titleRect, long view) {
- boolean hiliteShadow = new NSButtonCell(id).isHighlighted() && text.length() > 0 && image == null;
+ boolean hiliteShadow = new NSButtonCell(id).isHighlighted() && text.length() > 0 && image == null;
- // An unbordered cell doesn't draw any highlighting when pushed or selected, so we have to do it here.
- if (hiliteShadow) {
- NSColor transWhiteColor = NSColor.colorWithDeviceRed(1.0f, 1.0f, 1.0f, .8f);
+ // An unbordered cell doesn't draw any highlighting when pushed or selected, so we have to do it here.
+ if (hiliteShadow) {
+ NSColor transWhiteColor = NSColor.colorWithDeviceRed(1.0f, 1.0f, 1.0f, .8f);
NSAttributedString attribStr = new NSAttributedString(title);
NSMutableAttributedString tmpString = new NSMutableAttributedString(attribStr.mutableCopy());
NSRange range = new NSRange();
@@ -472,7 +472,7 @@ NSRect drawTitleWithFrameInView (long id, long sel, long title, NSRect titleRect
tmpString.addAttribute(OS.NSForegroundColorAttributeName, transWhiteColor, range);
tmpString.autorelease();
title = tmpString.id;
- }
+ }
return super.drawTitleWithFrameInView(id, sel, title, titleRect, view);
}
@@ -873,12 +873,12 @@ void releaseHandle () {
if (button != null) button.release ();
view = button = null;
if (nsItem != null) {
- nsItem.release();
- nsItem = null;
+ nsItem.release();
+ nsItem = null;
}
if (id != null) {
- id.release();
- id = null;
+ id.release();
+ id = null;
}
if (nsMenuRep != null) {
nsMenuRep.release();
@@ -976,12 +976,12 @@ public void setControl (Control control) {
if (this.control == control) return;
if (parent.nsToolbar == null) {
- NSBox widget = (NSBox)view;
- if (control == null) {
- widget.setBoxType(OS.NSBoxSeparator);
- } else {
- widget.setBoxType(OS.NSBoxCustom);
- }
+ NSBox widget = (NSBox)view;
+ if (control == null) {
+ widget.setBoxType(OS.NSBoxSeparator);
+ } else {
+ widget.setBoxType(OS.NSBoxCustom);
+ }
} else {
nsItem.setMenuFormRepresentation(control == null ? nsMenuRep : NSMenuItem.separatorItem());
}
@@ -1211,14 +1211,14 @@ public void setToolTipText (String string) {
checkWidget();
if (string == null && toolTipText == null) return;
if (string != null && string.equals (toolTipText)) return;
- toolTipText = string;
+ toolTipText = string;
if (parent.nsToolbar != null) {
- char[] chars = new char [toolTipText.length ()];
- string.getChars (0, chars.length, chars, 0);
- int length = fixMnemonic (chars);
- nsItem.setToolTip(NSString.stringWithCharacters (chars, length));
+ char[] chars = new char [toolTipText.length ()];
+ string.getChars (0, chars.length, chars, 0);
+ int length = fixMnemonic (chars);
+ nsItem.setToolTip(NSString.stringWithCharacters (chars, length));
} else {
- parent.checkToolTip (this);
+ parent.checkToolTip (this);
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tracker.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tracker.java
index 5ea6a223c2..a4cd7ebf01 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tracker.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tracker.java
@@ -202,7 +202,7 @@ Point adjustMoveCursor () {
int newY = bounds.y;
/*
* Convert to screen coordinates if needed
- */
+ */
if (parent != null) {
Point pt = parent.toDisplay (newX, newY);
newX = pt.x;
@@ -234,7 +234,7 @@ Point adjustResizeCursor (boolean movePointer) {
/*
* Convert to screen coordinates if needed
- */
+ */
if (parent != null) {
Point pt = parent.toDisplay (newX, newY);
newX = pt.x;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java
index 3462e4e97b..b5d5988b80 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java
@@ -2133,7 +2133,7 @@ void mouseDownSuper(long id, long sel, long theEvent) {
NSRect checkRect = cell.imageRectForBounds(widget.frameOfCellAtColumn(column, row));
if (OS.NSPointInRect(pt, checkRect)) {
check = preventSelect = true;
- }
+ }
}
}
if (!check && row != -1 && (nsEvent.modifierFlags() & OS.NSDeviceIndependentModifierFlagsMask) == 0 && nsEvent.clickCount() == 1) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeColumn.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeColumn.java
index a8f2cfd3db..b3848ac431 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeColumn.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeColumn.java
@@ -370,9 +370,9 @@ void drawInteriorWithFrame_inView (long id, long sel, NSRect cellRect, long view
if (isFlipped) {
context.saveGraphicsState ();
NSAffineTransform transform = NSAffineTransform.transform ();
- transform.scaleXBy (1, -1);
- transform.translateXBy (0, -(destRect.height + 2 * destRect.y));
- transform.concat ();
+ transform.scaleXBy (1, -1);
+ transform.translateXBy (0, -(destRect.height + 2 * destRect.y));
+ transform.concat ();
}
NSRect sourceRect = new NSRect ();
sourceRect.width = destRect.width;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java
index 9e0ee05530..1e57d1b62b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java
@@ -718,10 +718,10 @@ public class SWT {
* should be opened.
* </p>
*
- * @see org.eclipse.swt.widgets.Display#addListener
- * @see org.eclipse.swt.widgets.Event
- *
- * @since 3.6
+ * @see org.eclipse.swt.widgets.Display#addListener
+ * @see org.eclipse.swt.widgets.Event
+ *
+ * @since 3.6
*/
public static final int OpenDocument = 46;
@@ -733,10 +733,10 @@ public class SWT {
* on a touch-based input source.
* </p>
*
- * @see org.eclipse.swt.widgets.Display#addListener
- * @see org.eclipse.swt.widgets.Event
- *
- * @since 3.7
+ * @see org.eclipse.swt.widgets.Display#addListener
+ * @see org.eclipse.swt.widgets.Event
+ *
+ * @since 3.7
*/
public static final int Touch = 47;
@@ -747,14 +747,14 @@ public class SWT {
* This event is sent when a gesture has been performed.
* </p>
*
- * @see org.eclipse.swt.widgets.Display#addListener
- * @see org.eclipse.swt.widgets.Event
- * @see SWT#GESTURE_MAGNIFY
- * @see SWT#GESTURE_PAN
- * @see SWT#GESTURE_ROTATE
- * @see SWT#GESTURE_SWIPE
- *
- * @since 3.7
+ * @see org.eclipse.swt.widgets.Display#addListener
+ * @see org.eclipse.swt.widgets.Event
+ * @see SWT#GESTURE_MAGNIFY
+ * @see SWT#GESTURE_PAN
+ * @see SWT#GESTURE_ROTATE
+ * @see SWT#GESTURE_SWIPE
+ *
+ * @since 3.7
*/
public static final int Gesture = 48;
@@ -771,8 +771,8 @@ public class SWT {
*
* @see org.eclipse.swt.widgets.Text#addSegmentListener
* @see org.eclipse.swt.events.SegmentEvent
- *
- * @since 3.8
+ *
+ * @since 3.8
*/
public static final int Segments = 49;
@@ -1271,16 +1271,16 @@ public class SWT {
*/
public static final int SEPARATOR = 1 << 1;
- /**
- * Constant representing a flexible space separator in a ToolBar.
+ /**
+ * Constant representing a flexible space separator in a ToolBar.
* <p><b>Used By:</b></p>
* <ul>
* <li><code>ToolItem.setWidth()</code></li>
* </ul>
*
* @since 3.7
- */
- public static final int SEPARATOR_FILL = -2;
+ */
+ public static final int SEPARATOR_FILL = -2;
/**
* Style constant for toggle button behavior (value is 1&lt;&lt;1).
@@ -2536,7 +2536,7 @@ public class SWT {
* any modifier is pressed and will continue to work as new modifier
* masks are added.
*
- * <code>(stateMask &amp; SWT.MODIFIER_MASK) != 0</code>.
+ * <code>(stateMask &amp; SWT.MODIFIER_MASK) != 0</code>.
*
* @since 2.1
*/
@@ -2586,7 +2586,7 @@ public class SWT {
* any button is pressed and will continue to work as new button
* masks are added.
*
- * <code>(stateMask &amp; SWT.BUTTON_MASK) != 0</code>.
+ * <code>(stateMask &amp; SWT.BUTTON_MASK) != 0</code>.
*
* @since 2.1
*/
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWTError.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWTError.java
index 2bd0f59eb8..03fc353428 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWTError.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWTError.java
@@ -41,9 +41,9 @@ package org.eclipse.swt;
*/
public class SWTError extends Error {
- /**
- * The SWT error code, one of SWT.ERROR_*.
- */
+ /**
+ * The SWT error code, one of SWT.ERROR_*.
+ */
public int code;
/**
@@ -52,7 +52,7 @@ public class SWTError extends Error {
*/
public Throwable throwable;
- static final long serialVersionUID = 3833467327105808433L;
+ static final long serialVersionUID = 3833467327105808433L;
/**
* Constructs a new instance of this class with its
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/KeyEvent.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/KeyEvent.java
index 4b8a378dc0..10700e53b3 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/KeyEvent.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/KeyEvent.java
@@ -39,14 +39,14 @@ import org.eclipse.swt.widgets.Event;
public class KeyEvent extends TypedEvent {
- /**
- * the character represented by the key that was typed.
+ /**
+ * the character represented by the key that was typed.
* This is the final character that results after all modifiers have been
- * applied. For example, when the user types Ctrl+A, the character value
- * is 0x01. It is important that applications do not attempt to modify the
- * character value based on a stateMask (such as SWT.CTRL) or the resulting
- * character will not be correct.
- */
+ * applied. For example, when the user types Ctrl+A, the character value
+ * is 0x01. It is important that applications do not attempt to modify the
+ * character value based on a stateMask (such as SWT.CTRL) or the resulting
+ * character will not be correct.
+ */
public char character;
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/PaintEvent.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/PaintEvent.java
index af08b195eb..ca80848811 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/PaintEvent.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/PaintEvent.java
@@ -61,7 +61,7 @@ public final class PaintEvent extends TypedEvent {
/**
* the number of following paint events which
- * are pending which may always be zero on
+ * are pending which may always be zero on
* some platforms
*/
public int count;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/DPIUtil.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/DPIUtil.java
index 354a2f8668..cbfa1c5ccc 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/DPIUtil.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/DPIUtil.java
@@ -453,7 +453,7 @@ public static boolean useCairoAutoScale() {
public static int getZoomForAutoscaleProperty (int nativeDeviceZoom) {
int zoom = 0;
- if (autoScaleValue != null) {
+ if (autoScaleValue != null) {
if ("false".equalsIgnoreCase (autoScaleValue)) {
zoom = 100;
} else if ("quarter".equalsIgnoreCase (autoScaleValue)) {
@@ -469,7 +469,7 @@ public static int getZoomForAutoscaleProperty (int nativeDeviceZoom) {
}
}
}
- if (zoom == 0) { // || "integer".equalsIgnoreCase (value) || "integer200".equalsIgnoreCase (value)
+ if (zoom == 0) { // || "integer".equalsIgnoreCase (value) || "integer200".equalsIgnoreCase (value)
zoom = Math.max ((nativeDeviceZoom + 25) / 100 * 100, 100);
if (!"integer".equalsIgnoreCase(autoScaleValue)) {
// integer200, or default
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/GIFFileFormat.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/GIFFileFormat.java
index 6aaa403a8c..09050a39bd 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/GIFFileFormat.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/GIFFileFormat.java
@@ -412,7 +412,7 @@ public final class GIFFileFormat extends FileFormat {
@Override
void unloadIntoByteStream(ImageLoader loader) {
- /* Step 1: Acquire GIF parameters. */
+ /* Step 1: Acquire GIF parameters. */
ImageData[] data = loader.data;
int frameCount = data.length;
boolean multi = frameCount > 1;
@@ -454,7 +454,7 @@ public final class GIFFileFormat extends FileFormat {
}
try {
- /* Step 3: Write the GIF89a Header and Logical Screen Descriptor. */
+ /* Step 3: Write the GIF89a Header and Logical Screen Descriptor. */
outputStream.write(GIF89a);
int bitField = globalTable*128 + (depth-1)*16 + depth-1;
outputStream.writeShort((short)logicalScreenWidth);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/JPEGDecoder.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/JPEGDecoder.java
index ef0d9004a1..40d5c98721 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/JPEGDecoder.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/JPEGDecoder.java
@@ -137,7 +137,7 @@ public class JPEGDecoder {
static final int M_APP13 = 0xed;
static final int M_APP14 = 0xee;
static final int M_APP15 = 0xef;
- static final int M_JPG0 = 0xf0;
+ static final int M_JPG0 = 0xf0;
static final int M_JPG13 = 0xfd;
static final int M_COM = 0xfe;
static final int M_TEM = 0x01;
@@ -832,7 +832,7 @@ public class JPEGDecoder {
{
if (bits_left < (1)) {
if (!jpeg_fill_bit_buffer(br_state,get_buffer,bits_left,1)) {
- return false;
+ return false;
}
get_buffer = (br_state).get_buffer; bits_left = (br_state).bits_left;
}
@@ -1716,7 +1716,7 @@ public class JPEGDecoder {
// JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode));
int process_data;
- /* Pointer to allocated workspace (M or M+2 row groups). */
+ /* Pointer to allocated workspace (M or M+2 row groups). */
byte[][][] buffer = new byte[MAX_COMPONENTS][][];
int[] buffer_offset = new int[MAX_COMPONENTS];
@@ -2325,8 +2325,8 @@ static void jinit_d_coef_controller (jpeg_decompress_struct cinfo, boolean need_
coef.whole_image[ci] =
new short
[(int)jround_up( compptr.height_in_blocks, compptr.v_samp_factor)]
- [(int)jround_up( compptr.width_in_blocks, compptr.h_samp_factor)]
- [DCTSIZE2];
+ [(int)jround_up( compptr.width_in_blocks, compptr.h_samp_factor)]
+ [DCTSIZE2];
}
// coef.consume_data = consume_data;
coef.decompress_data = DECOMPRESS_DATA;
@@ -3400,18 +3400,18 @@ jcopy_sample_rows (byte[][] input_array, int source_row,
* The source and destination arrays must be at least as wide as num_cols.
*/
{
- byte[] inptr, outptr;
- int count = num_cols;
- int row;
-
- int input_array_offset = source_row;
- int output_array_offset = dest_row;
-
- for (row = num_rows; row > 0; row--) {
- inptr = input_array[input_array_offset++];
- outptr = output_array[output_array_offset++];
- System.arraycopy(inptr, 0, outptr, 0, count);
- }
+ byte[] inptr, outptr;
+ int count = num_cols;
+ int row;
+
+ int input_array_offset = source_row;
+ int output_array_offset = dest_row;
+
+ for (row = num_rows; row > 0; row--) {
+ inptr = input_array[input_array_offset++];
+ outptr = output_array[output_array_offset++];
+ System.arraycopy(inptr, 0, outptr, 0, count);
+ }
}
static boolean jpeg_start_decompress (jpeg_decompress_struct cinfo) {
@@ -4418,8 +4418,8 @@ static boolean get_dht (jpeg_decompress_struct cinfo)
// ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
for (i = 0; i < count; i++) {
- if (cinfo.bytes_offset == cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
- huffval[i] = cinfo.buffer[cinfo.bytes_offset++];
+ if (cinfo.bytes_offset == cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+ huffval[i] = cinfo.buffer[cinfo.bytes_offset++];
}
length -= count;
@@ -5012,8 +5012,8 @@ static void grayscale_convert (jpeg_decompress_struct cinfo,
byte[][][] input_buf, int[] input_buf_offset, int input_row,
byte[][] output_buf, int output_buf_offset, int num_rows)
{
- jcopy_sample_rows(input_buf[0], input_row+input_buf_offset[0], output_buf, output_buf_offset,
- num_rows, cinfo.output_width);
+ jcopy_sample_rows(input_buf[0], input_row+input_buf_offset[0], output_buf, output_buf_offset,
+ num_rows, cinfo.output_width);
}
static void gray_rgb_convert (jpeg_decompress_struct cinfo,
@@ -5535,12 +5535,12 @@ static int consume_data (jpeg_decompress_struct cinfo) {
static int consume_input (jpeg_decompress_struct cinfo) {
switch (cinfo.inputctl.consume_input) {
case COEF_CONSUME_INPUT:
- switch (cinfo.coef.consume_data) {
+ switch (cinfo.coef.consume_data) {
case CONSUME_DATA: return consume_data(cinfo);
case DUMMY_CONSUME_DATA: return dummy_consume_data(cinfo);
default: error();
- }
- break;
+ }
+ break;
case INPUT_CONSUME_INPUT:
return consume_markers(cinfo);
default:
@@ -5617,7 +5617,7 @@ static boolean next_marker (jpeg_decompress_struct cinfo) {
* data source's input buffer.
*/
do {
- if (cinfo.bytes_offset == cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+ if (cinfo.bytes_offset == cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
c = cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
} while (c == 0xFF);
if (c != 0)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/JPEGFileFormat.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/JPEGFileFormat.java
index db721d53ba..0f5c6f82ca 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/JPEGFileFormat.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/JPEGFileFormat.java
@@ -1025,7 +1025,7 @@ void forwardDCT(int[] dataUnit) {
dataUnit[rIndex + 2] = n >> 11;
if ((n < 0) && ((n & 0x07FF) != 0)) dataUnit[rIndex + 2]--;
n = z1 + (tmp12 * (0 - FIX_1_847759065)) + 1024;
- dataUnit[rIndex + 6] = n >> 11;
+ dataUnit[rIndex + 6] = n >> 11;
if ((n < 0) && ((n & 0x07FF) != 0)) dataUnit[rIndex + 6]--;
/**
@@ -1277,7 +1277,7 @@ void inverseDCT(int[] dataUnit) {
dataUnit[rIndex + 5] = (tmp12 - tmp1 + 1024) >> 11;
dataUnit[rIndex + 3] = (tmp13 + tmp0 + 1024) >> 11;
dataUnit[rIndex + 4] = (tmp13 - tmp0 + 1024) >> 11;
- }
+ }
}
/**
* Pass 2: process columns.
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/LEDataInputStream.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/LEDataInputStream.java
index 75e53a6f61..54e5bbdfe8 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/LEDataInputStream.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/LEDataInputStream.java
@@ -103,13 +103,13 @@ final class LEDataInputStream extends InputStream {
}
/**
- * Reads at most <code>length</code> bytes from this LEDataInputStream and
- * stores them in byte array <code>buffer</code> starting at <code>offset</code>.
- * <p>
- * Answer the number of bytes actually read or -1 if no bytes were read and
- * end of stream was encountered. This implementation reads bytes from
- * the pushback buffer first, then the target stream if more bytes are required
- * to satisfy <code>count</code>.
+ * Reads at most <code>length</code> bytes from this LEDataInputStream and
+ * stores them in byte array <code>buffer</code> starting at <code>offset</code>.
+ * <p>
+ * Answer the number of bytes actually read or -1 if no bytes were read and
+ * end of stream was encountered. This implementation reads bytes from
+ * the pushback buffer first, then the target stream if more bytes are required
+ * to satisfy <code>count</code>.
* </p>
* @param buffer the byte array in which to store the read bytes.
* @param offset the offset in <code>buffer</code> to store the read bytes.
@@ -122,9 +122,9 @@ final class LEDataInputStream extends InputStream {
private int readData(byte[] buffer, int offset, int length) throws IOException {
if (buf == null) throw new IOException();
if (offset < 0 || offset > buffer.length ||
- length < 0 || (length > buffer.length - offset)) {
- throw new ArrayIndexOutOfBoundsException();
- }
+ length < 0 || (length > buffer.length - offset)) {
+ throw new ArrayIndexOutOfBoundsException();
+ }
int cacheCopied = 0;
int newOffset = offset;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngDeflater.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngDeflater.java
index 2683d0801c..695c68367c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngDeflater.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngDeflater.java
@@ -67,38 +67,38 @@ static class Match {
static final short mirrorBytes[] = {
- 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
- 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
- 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
- 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,
- 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4,
- 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,
- 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec,
- 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,
- 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2,
- 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2,
- 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea,
- 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa,
- 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6,
- 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6,
- 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee,
- 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe,
- 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1,
- 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1,
- 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9,
- 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9,
- 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5,
- 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5,
- 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed,
- 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd,
- 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3,
- 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3,
- 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb,
- 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb,
- 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7,
- 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7,
- 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef,
- 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff,
+ 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
+ 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
+ 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
+ 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,
+ 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4,
+ 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,
+ 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec,
+ 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,
+ 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2,
+ 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2,
+ 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea,
+ 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa,
+ 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6,
+ 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6,
+ 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee,
+ 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe,
+ 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1,
+ 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1,
+ 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9,
+ 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9,
+ 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5,
+ 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5,
+ 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed,
+ 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd,
+ 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3,
+ 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3,
+ 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb,
+ 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb,
+ 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7,
+ 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7,
+ 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef,
+ 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff,
};
@@ -113,7 +113,7 @@ static class Code {
this.min = min;
this.max = max;
- }
+ }
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngHuffmanTable.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngHuffmanTable.java
index c25cf0157f..ca7aef4890 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngHuffmanTable.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngHuffmanTable.java
@@ -102,7 +102,7 @@ int getNextValue(PngDecodingDataStream stream) throws IOException {
// a prefix to the longer codeValues.
while (codelength < MAX_CODE_LENGTH && code > codeLengthInfo[codelength].max) {
code = ((code << 1) | stream.getNextIdatBit());
- codelength++;
+ codelength++;
}
if (codelength >= MAX_CODE_LENGTH) stream.error();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngHuffmanTables.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngHuffmanTables.java
index cb78f2581f..9f60c6c12b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngHuffmanTables.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngHuffmanTables.java
@@ -24,18 +24,18 @@ public class PngHuffmanTables {
static final int LiteralTableSize = 288;
static final int[] FixedLiteralLengths = {
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8,
};
static final int DistanceTableSize = 32;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/WinBMPFileFormat.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/WinBMPFileFormat.java
index 120722dbdc..a20b88340b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/WinBMPFileFormat.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/WinBMPFileFormat.java
@@ -424,14 +424,14 @@ boolean isFileFormat(LEDataInputStream stream) {
boolean isPaletteBMP(PaletteData pal, int depth) {
switch(depth) {
case 32:
- if ((pal.redMask == 0xFF00) && (pal.greenMask == 0xFF0000) && (pal.blueMask == 0xFF000000)) return true;
- return false;
+ if ((pal.redMask == 0xFF00) && (pal.greenMask == 0xFF0000) && (pal.blueMask == 0xFF000000)) return true;
+ return false;
case 24:
if ((pal.redMask == 0xFF) && (pal.greenMask == 0xFF00) && (pal.blueMask == 0xFF0000)) return true;
return false;
case 16:
- if ((pal.redMask == 0x7C00) && (pal.greenMask == 0x3E0) && (pal.blueMask == 0x1F)) return true;
- return false;
+ if ((pal.redMask == 0x7C00) && (pal.greenMask == 0x3E0) && (pal.blueMask == 0x1F)) return true;
+ return false;
default:
return true;
}
@@ -735,7 +735,7 @@ void unloadIntoByteStream(ImageLoader loader) {
// If the pixels are not in the expected BMP format, convert them.
if (pal.isDirect && !isPaletteBMP(pal, image.depth)) {
// array to store the converted pixels
- iData = new byte[image.data.length];
+ iData = new byte[image.data.length];
convertPixelsToBGR(image, iData);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/FillLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/FillLayout.java
index 0bc3d8c3ca..f66f280bc8 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/FillLayout.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/FillLayout.java
@@ -68,7 +68,7 @@ public final class FillLayout extends Layout {
*
* @since 3.0
*/
- public int marginWidth = 0;
+ public int marginWidth = 0;
/**
* marginHeight specifies the number of points of vertical margin
@@ -78,9 +78,9 @@ public final class FillLayout extends Layout {
*
* @since 3.0
*/
- public int marginHeight = 0;
+ public int marginHeight = 0;
- /**
+ /**
* spacing specifies the number of points between the edge of one cell
* and the edge of its neighbouring cell.
*
@@ -233,13 +233,13 @@ protected void layout (Composite composite, boolean flushCache) {
*/
@Override
public String toString () {
- String string = getName ()+" {";
- string += "type="+((type == SWT.VERTICAL) ? "SWT.VERTICAL" : "SWT.HORIZONTAL")+" ";
- if (marginWidth != 0) string += "marginWidth="+marginWidth+" ";
- if (marginHeight != 0) string += "marginHeight="+marginHeight+" ";
- if (spacing != 0) string += "spacing="+spacing+" ";
- string = string.trim();
- string += "}";
- return string;
+ String string = getName ()+" {";
+ string += "type="+((type == SWT.VERTICAL) ? "SWT.VERTICAL" : "SWT.HORIZONTAL")+" ";
+ if (marginWidth != 0) string += "marginWidth="+marginWidth+" ";
+ if (marginHeight != 0) string += "marginHeight="+marginHeight+" ";
+ if (spacing != 0) string += "spacing="+spacing+" ";
+ string = string.trim();
+ string += "}";
+ return string;
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/FormAttachment.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/FormAttachment.java
index 0afc130fb9..c7bc0ef918 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/FormAttachment.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/FormAttachment.java
@@ -313,7 +313,7 @@ int solveY (int value) {
*/
@Override
public String toString () {
- String string = control != null ? control.toString () : numerator + "/" + denominator;
+ String string = control != null ? control.toString () : numerator + "/" + denominator;
return "{y = (" + string + (offset >= 0 ? ")x + " + offset: ")x - " + (-offset))+"}";
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/FormData.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/FormData.java
index 3159c799a0..56100f88c2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/FormData.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/FormData.java
@@ -333,15 +333,15 @@ FormAttachment getTopAttachment (Control control, int spacing, boolean flushCach
*/
@Override
public String toString () {
- String string = getName()+" {";
- if (width != SWT.DEFAULT) string += "width="+width+" ";
+ String string = getName()+" {";
+ if (width != SWT.DEFAULT) string += "width="+width+" ";
if (height != SWT.DEFAULT) string += "height="+height+" ";
- if (left != null) string += "left="+left+" ";
- if (right != null) string += "right="+right+" ";
- if (top != null) string += "top="+top+" ";
- if (bottom != null) string += "bottom="+bottom+" ";
- string = string.trim();
- string += "}";
+ if (left != null) string += "left="+left+" ";
+ if (right != null) string += "right="+right+" ";
+ if (top != null) string += "top="+top+" ";
+ if (bottom != null) string += "bottom="+bottom+" ";
+ string = string.trim();
+ string += "}";
return string;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/FormLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/FormLayout.java
index 52096c84c2..92272b0551 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/FormLayout.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/FormLayout.java
@@ -97,7 +97,7 @@ public final class FormLayout extends Layout {
*
* The default value is 0.
*/
- public int marginWidth = 0;
+ public int marginWidth = 0;
/**
* marginHeight specifies the number of points of vertical margin
@@ -105,10 +105,10 @@ public final class FormLayout extends Layout {
*
* The default value is 0.
*/
- public int marginHeight = 0;
+ public int marginHeight = 0;
- /**
+ /**
* marginLeft specifies the number of points of horizontal margin
* that will be placed along the left edge of the layout.
*
@@ -377,16 +377,16 @@ Point layout (Composite composite, boolean move, int x, int y, int width, int he
*/
@Override
public String toString () {
- String string = getName ()+" {";
- if (marginWidth != 0) string += "marginWidth="+marginWidth+" ";
- if (marginHeight != 0) string += "marginHeight="+marginHeight+" ";
- if (marginLeft != 0) string += "marginLeft="+marginLeft+" ";
- if (marginRight != 0) string += "marginRight="+marginRight+" ";
- if (marginTop != 0) string += "marginTop="+marginTop+" ";
- if (marginBottom != 0) string += "marginBottom="+marginBottom+" ";
- if (spacing != 0) string += "spacing="+spacing+" ";
- string = string.trim();
- string += "}";
- return string;
+ String string = getName ()+" {";
+ if (marginWidth != 0) string += "marginWidth="+marginWidth+" ";
+ if (marginHeight != 0) string += "marginHeight="+marginHeight+" ";
+ if (marginLeft != 0) string += "marginLeft="+marginLeft+" ";
+ if (marginRight != 0) string += "marginRight="+marginRight+" ";
+ if (marginTop != 0) string += "marginTop="+marginTop+" ";
+ if (marginBottom != 0) string += "marginBottom="+marginBottom+" ";
+ if (spacing != 0) string += "spacing="+spacing+" ";
+ string = string.trim();
+ string += "}";
+ return string;
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/GridData.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/GridData.java
index dcfed49551..6d5da5c766 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/GridData.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/GridData.java
@@ -556,22 +556,22 @@ public String toString () {
case CENTER: vAlign = "GridData.CENTER"; break;
default: vAlign = "Undefined "+verticalAlignment; break;
}
- String string = getName()+" {";
- string += "horizontalAlignment="+hAlign+" ";
- if (horizontalIndent != 0) string += "horizontalIndent="+horizontalIndent+" ";
- if (horizontalSpan != 1) string += "horizontalSpan="+horizontalSpan+" ";
- if (grabExcessHorizontalSpace) string += "grabExcessHorizontalSpace="+grabExcessHorizontalSpace+" ";
- if (widthHint != SWT.DEFAULT) string += "widthHint="+widthHint+" ";
- if (minimumWidth != 0) string += "minimumWidth="+minimumWidth+" ";
- string += "verticalAlignment="+vAlign+" ";
- if (verticalIndent != 0) string += "verticalIndent="+verticalIndent+" ";
+ String string = getName()+" {";
+ string += "horizontalAlignment="+hAlign+" ";
+ if (horizontalIndent != 0) string += "horizontalIndent="+horizontalIndent+" ";
+ if (horizontalSpan != 1) string += "horizontalSpan="+horizontalSpan+" ";
+ if (grabExcessHorizontalSpace) string += "grabExcessHorizontalSpace="+grabExcessHorizontalSpace+" ";
+ if (widthHint != SWT.DEFAULT) string += "widthHint="+widthHint+" ";
+ if (minimumWidth != 0) string += "minimumWidth="+minimumWidth+" ";
+ string += "verticalAlignment="+vAlign+" ";
+ if (verticalIndent != 0) string += "verticalIndent="+verticalIndent+" ";
if (verticalSpan != 1) string += "verticalSpan="+verticalSpan+" ";
- if (grabExcessVerticalSpace) string += "grabExcessVerticalSpace="+grabExcessVerticalSpace+" ";
- if (heightHint != SWT.DEFAULT) string += "heightHint="+heightHint+" ";
- if (minimumHeight != 0) string += "minimumHeight="+minimumHeight+" ";
- if (exclude) string += "exclude="+exclude+" ";
- string = string.trim();
- string += "}";
+ if (grabExcessVerticalSpace) string += "grabExcessVerticalSpace="+grabExcessVerticalSpace+" ";
+ if (heightHint != SWT.DEFAULT) string += "heightHint="+heightHint+" ";
+ if (minimumHeight != 0) string += "minimumHeight="+minimumHeight+" ";
+ if (exclude) string += "exclude="+exclude+" ";
+ string = string.trim();
+ string += "}";
return string;
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/GridLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/GridLayout.java
index d82e9ce63b..d0bb2c6f42 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/GridLayout.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/GridLayout.java
@@ -50,13 +50,13 @@ import org.eclipse.swt.widgets.*;
*/
public final class GridLayout extends Layout {
- /**
- * numColumns specifies the number of cell columns in the layout.
- * If numColumns has a value less than 1, the layout will not
- * set the size and position of any controls.
- *
- * The default value is 1.
- */
+ /**
+ * numColumns specifies the number of cell columns in the layout.
+ * If numColumns has a value less than 1, the layout will not
+ * set the size and position of any controls.
+ *
+ * The default value is 1.
+ */
public int numColumns = 1;
/**
@@ -73,7 +73,7 @@ public final class GridLayout extends Layout {
*
* The default value is 5.
*/
- public int marginWidth = 5;
+ public int marginWidth = 5;
/**
* marginHeight specifies the number of points of vertical margin
@@ -81,9 +81,9 @@ public final class GridLayout extends Layout {
*
* The default value is 5.
*/
- public int marginHeight = 5;
+ public int marginHeight = 5;
- /**
+ /**
* marginLeft specifies the number of points of horizontal margin
* that will be placed along the left edge of the layout.
*
@@ -130,7 +130,7 @@ public final class GridLayout extends Layout {
*
* The default value is 5.
*/
- public int horizontalSpacing = 5;
+ public int horizontalSpacing = 5;
/**
* verticalSpacing specifies the number of points between the bottom
@@ -138,7 +138,7 @@ public final class GridLayout extends Layout {
*
* The default value is 5.
*/
- public int verticalSpacing = 5;
+ public int verticalSpacing = 5;
/**
* Constructs a new instance of this class
@@ -736,19 +736,19 @@ String getName () {
*/
@Override
public String toString () {
- String string = getName ()+" {";
- if (numColumns != 1) string += "numColumns="+numColumns+" ";
- if (makeColumnsEqualWidth) string += "makeColumnsEqualWidth="+makeColumnsEqualWidth+" ";
- if (marginWidth != 0) string += "marginWidth="+marginWidth+" ";
- if (marginHeight != 0) string += "marginHeight="+marginHeight+" ";
- if (marginLeft != 0) string += "marginLeft="+marginLeft+" ";
- if (marginRight != 0) string += "marginRight="+marginRight+" ";
- if (marginTop != 0) string += "marginTop="+marginTop+" ";
- if (marginBottom != 0) string += "marginBottom="+marginBottom+" ";
- if (horizontalSpacing != 0) string += "horizontalSpacing="+horizontalSpacing+" ";
- if (verticalSpacing != 0) string += "verticalSpacing="+verticalSpacing+" ";
- string = string.trim();
- string += "}";
- return string;
+ String string = getName ()+" {";
+ if (numColumns != 1) string += "numColumns="+numColumns+" ";
+ if (makeColumnsEqualWidth) string += "makeColumnsEqualWidth="+makeColumnsEqualWidth+" ";
+ if (marginWidth != 0) string += "marginWidth="+marginWidth+" ";
+ if (marginHeight != 0) string += "marginHeight="+marginHeight+" ";
+ if (marginLeft != 0) string += "marginLeft="+marginLeft+" ";
+ if (marginRight != 0) string += "marginRight="+marginRight+" ";
+ if (marginTop != 0) string += "marginTop="+marginTop+" ";
+ if (marginBottom != 0) string += "marginBottom="+marginBottom+" ";
+ if (horizontalSpacing != 0) string += "horizontalSpacing="+horizontalSpacing+" ";
+ if (verticalSpacing != 0) string += "verticalSpacing="+verticalSpacing+" ";
+ string = string.trim();
+ string += "}";
+ return string;
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/RowLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/RowLayout.java
index ceb4a8edeb..cb21fcd139 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/RowLayout.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/RowLayout.java
@@ -82,7 +82,7 @@ public final class RowLayout extends Layout {
*
* @since 3.0
*/
- public int marginWidth = 0;
+ public int marginWidth = 0;
/**
* marginHeight specifies the number of points of vertical margin
@@ -92,7 +92,7 @@ public final class RowLayout extends Layout {
*
* @since 3.0
*/
- public int marginHeight = 0;
+ public int marginHeight = 0;
/**
* spacing specifies the number of points between the edge of one cell
@@ -502,21 +502,21 @@ Point layoutVertical (Composite composite, boolean move, boolean wrap, int heigh
*/
@Override
public String toString () {
- String string = getName ()+" {";
- string += "type="+((type != SWT.HORIZONTAL) ? "SWT.VERTICAL" : "SWT.HORIZONTAL")+" ";
- if (marginWidth != 0) string += "marginWidth="+marginWidth+" ";
- if (marginHeight != 0) string += "marginHeight="+marginHeight+" ";
- if (marginLeft != 0) string += "marginLeft="+marginLeft+" ";
- if (marginTop != 0) string += "marginTop="+marginTop+" ";
- if (marginRight != 0) string += "marginRight="+marginRight+" ";
- if (marginBottom != 0) string += "marginBottom="+marginBottom+" ";
- if (spacing != 0) string += "spacing="+spacing+" ";
- string += "wrap="+wrap+" ";
+ String string = getName ()+" {";
+ string += "type="+((type != SWT.HORIZONTAL) ? "SWT.VERTICAL" : "SWT.HORIZONTAL")+" ";
+ if (marginWidth != 0) string += "marginWidth="+marginWidth+" ";
+ if (marginHeight != 0) string += "marginHeight="+marginHeight+" ";
+ if (marginLeft != 0) string += "marginLeft="+marginLeft+" ";
+ if (marginTop != 0) string += "marginTop="+marginTop+" ";
+ if (marginRight != 0) string += "marginRight="+marginRight+" ";
+ if (marginBottom != 0) string += "marginBottom="+marginBottom+" ";
+ if (spacing != 0) string += "spacing="+spacing+" ";
+ string += "wrap="+wrap+" ";
string += "pack="+pack+" ";
string += "fill="+fill+" ";
string += "justify="+justify+" ";
string = string.trim();
string += "}";
- return string;
+ return string;
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java
index 223b5060c6..58a8649530 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java
@@ -446,12 +446,12 @@ public FontData[] getFontList (String faceName, boolean scalable) {
match = faceName.equalsIgnoreCase(name);
}
if (match) {
- OS.pango_font_family_list_faces(family[0], faces, n_faces);
- for (int j=0; j<n_faces[0]; j++) {
- C.memmove(face, faces[0] + j * C.PTR_SIZEOF, C.PTR_SIZEOF);
- long fontDesc = OS.pango_font_face_describe(face[0]);
- Font font = Font.gtk_new(this, fontDesc);
- FontData data = font.getFontData()[0];
+ OS.pango_font_family_list_faces(family[0], faces, n_faces);
+ for (int j=0; j<n_faces[0]; j++) {
+ C.memmove(face, faces[0] + j * C.PTR_SIZEOF, C.PTR_SIZEOF);
+ long fontDesc = OS.pango_font_face_describe(face[0]);
+ Font font = Font.gtk_new(this, fontDesc);
+ FontData data = font.getFontData()[0];
if (nFds == fds.length) {
FontData[] newFds = new FontData[fds.length + n_families[0]];
System.arraycopy(fds, 0, newFds, 0, nFds);
@@ -459,9 +459,9 @@ public FontData[] getFontList (String faceName, boolean scalable) {
}
fds[nFds++] = data;
OS.pango_font_description_free(fontDesc);
- }
- OS.g_free(faces[0]);
- if (faceName != null) break;
+ }
+ OS.g_free(faces[0]);
+ if (faceName != null) break;
}
}
OS.g_free(families[0]);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
index a841d7e07a..0a9c534a1f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
@@ -721,20 +721,20 @@ void drawArcInPixels(int x, int y, int width, int height, int startAngle, int ar
long cairo = data.cairo;
double xOffset = data.cairoXoffset, yOffset = data.cairoYoffset;
if (width == height) {
- if (arcAngle >= 0) {
- Cairo.cairo_arc_negative(cairo, x + xOffset + width / 2f, y + yOffset + height / 2f, width / 2f, -startAngle * (float)Math.PI / 180, -(startAngle + arcAngle) * (float)Math.PI / 180);
- } else {
- Cairo.cairo_arc(cairo, x + xOffset + width / 2f, y + yOffset + height / 2f, width / 2f, -startAngle * (float)Math.PI / 180, -(startAngle + arcAngle) * (float)Math.PI / 180);
- }
+ if (arcAngle >= 0) {
+ Cairo.cairo_arc_negative(cairo, x + xOffset + width / 2f, y + yOffset + height / 2f, width / 2f, -startAngle * (float)Math.PI / 180, -(startAngle + arcAngle) * (float)Math.PI / 180);
+ } else {
+ Cairo.cairo_arc(cairo, x + xOffset + width / 2f, y + yOffset + height / 2f, width / 2f, -startAngle * (float)Math.PI / 180, -(startAngle + arcAngle) * (float)Math.PI / 180);
+ }
} else {
Cairo.cairo_save(cairo);
Cairo.cairo_translate(cairo, x + xOffset + width / 2f, y + yOffset + height / 2f);
Cairo.cairo_scale(cairo, width / 2f, height / 2f);
- if (arcAngle >= 0) {
- Cairo.cairo_arc_negative(cairo, 0, 0, 1, -startAngle * (float)Math.PI / 180, -(startAngle + arcAngle) * (float)Math.PI / 180);
- } else {
- Cairo.cairo_arc(cairo, 0, 0, 1, -startAngle * (float)Math.PI / 180, -(startAngle + arcAngle) * (float)Math.PI / 180);
- }
+ if (arcAngle >= 0) {
+ Cairo.cairo_arc_negative(cairo, 0, 0, 1, -startAngle * (float)Math.PI / 180, -(startAngle + arcAngle) * (float)Math.PI / 180);
+ } else {
+ Cairo.cairo_arc(cairo, 0, 0, 1, -startAngle * (float)Math.PI / 180, -(startAngle + arcAngle) * (float)Math.PI / 180);
+ }
Cairo.cairo_restore(cairo);
}
Cairo.cairo_stroke(cairo);
@@ -849,17 +849,17 @@ void drawImage(Image srcImage, int srcX, int srcY, int srcWidth, int srcHeight,
int imgWidth = srcImage.width;
int imgHeight = srcImage.height;
- if (simple) {
- srcWidth = destWidth = imgWidth;
- srcHeight = destHeight = imgHeight;
- } else {
- simple = srcX == 0 && srcY == 0 &&
- srcWidth == destWidth && destWidth == imgWidth &&
- srcHeight == destHeight && destHeight == imgHeight;
+ if (simple) {
+ srcWidth = destWidth = imgWidth;
+ srcHeight = destHeight = imgHeight;
+ } else {
+ simple = srcX == 0 && srcY == 0 &&
+ srcWidth == destWidth && destWidth == imgWidth &&
+ srcHeight == destHeight && destHeight == imgHeight;
if (srcX + srcWidth > imgWidth + 1 || srcY + srcHeight > imgHeight + 1) { //rounding error correction for hidpi
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}
- }
+ }
long cairo = data.cairo;
if (data.alpha != 0) {
srcImage.createSurface();
@@ -1240,10 +1240,10 @@ void drawRoundRectangleInPixels(int x, int y, int width, int height, int arcWidt
Cairo.cairo_translate(cairo, nx + xOffset, ny + yOffset);
Cairo.cairo_scale(cairo, naw2, nah2);
Cairo.cairo_move_to(cairo, fw - 1, 0);
- Cairo.cairo_arc(cairo, fw - 1, 1, 1, Math.PI + Math.PI/2.0, Math.PI*2.0);
- Cairo.cairo_arc(cairo, fw - 1, fh - 1, 1, 0, Math.PI/2.0);
- Cairo.cairo_arc(cairo, 1, fh - 1, 1, Math.PI/2, Math.PI);
- Cairo.cairo_arc(cairo, 1, 1, 1, Math.PI, 270.0*Math.PI/180.0);
+ Cairo.cairo_arc(cairo, fw - 1, 1, 1, Math.PI + Math.PI/2.0, Math.PI*2.0);
+ Cairo.cairo_arc(cairo, fw - 1, fh - 1, 1, 0, Math.PI/2.0);
+ Cairo.cairo_arc(cairo, 1, fh - 1, 1, Math.PI/2, Math.PI);
+ Cairo.cairo_arc(cairo, 1, 1, 1, Math.PI, 270.0*Math.PI/180.0);
Cairo.cairo_close_path(cairo);
Cairo.cairo_restore(cairo);
}
@@ -1500,11 +1500,11 @@ void fillArcInPixels(int x, int y, int width, int height, int startAngle, int ar
if (width == 0 || height == 0 || arcAngle == 0) return;
long cairo = data.cairo;
if (width == height) {
- if (arcAngle >= 0) {
- Cairo.cairo_arc_negative(cairo, x + width / 2f, y + height / 2f, width / 2f, -startAngle * (float)Math.PI / 180, -(startAngle + arcAngle) * (float)Math.PI / 180);
- } else {
- Cairo.cairo_arc(cairo, x + width / 2f, y + height / 2f, width / 2f, -startAngle * (float)Math.PI / 180, -(startAngle + arcAngle) * (float)Math.PI / 180);
- }
+ if (arcAngle >= 0) {
+ Cairo.cairo_arc_negative(cairo, x + width / 2f, y + height / 2f, width / 2f, -startAngle * (float)Math.PI / 180, -(startAngle + arcAngle) * (float)Math.PI / 180);
+ } else {
+ Cairo.cairo_arc(cairo, x + width / 2f, y + height / 2f, width / 2f, -startAngle * (float)Math.PI / 180, -(startAngle + arcAngle) * (float)Math.PI / 180);
+ }
Cairo.cairo_line_to(cairo, x + width / 2f, y + height / 2f);
} else {
Cairo.cairo_save(cairo);
@@ -1839,10 +1839,10 @@ void fillRoundRectangleInPixels(int x, int y, int width, int height, int arcWidt
Cairo.cairo_translate(cairo, nx, ny);
Cairo.cairo_scale(cairo, naw2, nah2);
Cairo.cairo_move_to(cairo, fw - 1, 0);
- Cairo.cairo_arc(cairo, fw - 1, 1, 1, Math.PI + Math.PI/2.0, Math.PI*2.0);
- Cairo.cairo_arc(cairo, fw - 1, fh - 1, 1, 0, Math.PI/2.0);
- Cairo.cairo_arc(cairo, 1, fh - 1, 1, Math.PI/2, Math.PI);
- Cairo.cairo_arc(cairo, 1, 1, 1, Math.PI, 270.0*Math.PI/180.0);
+ Cairo.cairo_arc(cairo, fw - 1, 1, 1, Math.PI + Math.PI/2.0, Math.PI*2.0);
+ Cairo.cairo_arc(cairo, fw - 1, fh - 1, 1, 0, Math.PI/2.0);
+ Cairo.cairo_arc(cairo, 1, fh - 1, 1, Math.PI/2, Math.PI);
+ Cairo.cairo_arc(cairo, 1, 1, 1, Math.PI, 270.0*Math.PI/180.0);
Cairo.cairo_close_path(cairo);
Cairo.cairo_restore(cairo);
}
@@ -1950,8 +1950,8 @@ public int getAlpha() {
*/
public int getAntialias() {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
- if (data.cairo == 0) return SWT.DEFAULT;
- int antialias = Cairo.cairo_get_antialias(data.cairo);
+ if (data.cairo == 0) return SWT.DEFAULT;
+ int antialias = Cairo.cairo_get_antialias(data.cairo);
switch (antialias) {
case Cairo.CAIRO_ANTIALIAS_DEFAULT: return SWT.DEFAULT;
case Cairo.CAIRO_ANTIALIAS_NONE: return SWT.OFF;
@@ -2515,9 +2515,9 @@ void getSize(int[] width, int[] height) {
* @since 3.1
*/
public int getTextAntialias() {
- if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
- if (data.cairo == 0) return SWT.DEFAULT;
- int antialias = Cairo.CAIRO_ANTIALIAS_DEFAULT;
+ if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (data.cairo == 0) return SWT.DEFAULT;
+ int antialias = Cairo.CAIRO_ANTIALIAS_DEFAULT;
if (data.context != 0) {
long options = OS.pango_cairo_context_get_font_options(data.context);
if (options != 0) antialias = Cairo.cairo_font_options_get_antialias(options);
@@ -2855,13 +2855,13 @@ public void setAntialias(int antialias) {
case SWT.DEFAULT: mode = Cairo.CAIRO_ANTIALIAS_DEFAULT; break;
case SWT.OFF: mode = Cairo.CAIRO_ANTIALIAS_NONE; break;
case SWT.ON: mode = Cairo.CAIRO_ANTIALIAS_GRAY;
- break;
+ break;
default:
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}
- initCairo();
- long cairo = data.cairo;
- Cairo.cairo_set_antialias(cairo, mode);
+ initCairo();
+ long cairo = data.cairo;
+ Cairo.cairo_set_antialias(cairo, mode);
}
/**
@@ -3761,23 +3761,23 @@ void setString(String string, int flags) {
* @since 3.1
*/
public void setTextAntialias(int antialias) {
- if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (data.cairo == 0 && antialias == SWT.DEFAULT) return;
int mode = 0;
switch (antialias) {
case SWT.DEFAULT: mode = Cairo.CAIRO_ANTIALIAS_DEFAULT; break;
case SWT.OFF: mode = Cairo.CAIRO_ANTIALIAS_NONE; break;
case SWT.ON: mode = Cairo.CAIRO_ANTIALIAS_GRAY;
- break;
+ break;
default:
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}
- initCairo();
- long options = Cairo.cairo_font_options_create();
- Cairo.cairo_font_options_set_antialias(options, mode);
+ initCairo();
+ long options = Cairo.cairo_font_options_create();
+ Cairo.cairo_font_options_set_antialias(options, mode);
if (data.context == 0) createLayout();
OS.pango_cairo_context_set_font_options(data.context, options);
- Cairo.cairo_font_options_destroy(options);
+ Cairo.cairo_font_options_destroy(options);
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java
index 961d0fdd04..da7ed3aad7 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java
@@ -1236,7 +1236,7 @@ public int hashCode () {
if (imageDataProvider != null) {
return imageDataProvider.hashCode();
} else if (imageFileNameProvider != null) {
- return imageFileNameProvider.hashCode();
+ return imageFileNameProvider.hashCode();
} else {
return (int)surface;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java
index a1c0692119..fabec60987 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java
@@ -539,7 +539,7 @@ void drawInPixels(GC gc, int x, int y, int selectionStart, int selectionEnd, Col
OS.pango_cairo_show_layout(cairo, layout);
drawBorder(gc, x, y, null);
if ((data.style & SWT.MIRRORED) != 0) {
- Cairo.cairo_restore(cairo);
+ Cairo.cairo_restore(cairo);
}
} else {
selectionStart = Math.min(Math.max(0, selectionStart), length - 1);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/internal/GDBus.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/internal/GDBus.java
index 6c118f8d35..b2a8da2bb4 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/internal/GDBus.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/internal/GDBus.java
@@ -67,7 +67,7 @@ public class GDBus {
* // From command line, it can be called like this:
* // gdbus call --session --dest org.eclipse.swt --object-path /org/eclipse/swt --method org.eclipse.swt.typeTest true "world" 1234
* // The call will return a tuple (struct) like: (true, 'world', 5678)
- * GDBusMethod typeTest = new GDBusMethod(
+ * GDBusMethod typeTest = new GDBusMethod(
* "typeTest",
* new String [][] {{OS.DBUS_TYPE_BOOLEAN, "boolean Test Val"}, {OS.DBUS_TYPE_STRING, "string Test Val"}, {OS.DBUS_TYPE_INT32, "int Test Val"}},
* new String [][] {{OS.DBUS_TYPE_BOOLEAN, "boolean Response"}, {OS.DBUS_TYPE_STRING, "string Test Response"}, {OS.DBUS_TYPE_INT32, "int Test Response"}},
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
index b842510a02..32c59c5e4b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
@@ -116,26 +116,26 @@ static int checkStyle (int style) {
}
GtkBorder getBorder (byte[] border, long handle, int defaultBorder) {
- GtkBorder gtkBorder = new GtkBorder();
- long [] borderPtr = new long [1];
- if (GTK.GTK4) {
+ GtkBorder gtkBorder = new GtkBorder();
+ long [] borderPtr = new long [1];
+ if (GTK.GTK4) {
long context = GTK.gtk_widget_get_style_context (handle);
int stateFlag = GTK.gtk_widget_get_state_flags(handle);
gtk_style_context_get_border(context, stateFlag, gtkBorder);
return gtkBorder;
- } else {
- GTK.gtk_widget_style_get (handle, border, borderPtr,0);
- if (borderPtr[0] != 0) {
- OS.memmove (gtkBorder, borderPtr[0], GtkBorder.sizeof);
- GTK.gtk_border_free(borderPtr[0]);
- return gtkBorder;
- }
- }
- gtkBorder.left = defaultBorder;
- gtkBorder.top = defaultBorder;
- gtkBorder.right = defaultBorder;
- gtkBorder.bottom = defaultBorder;
- return gtkBorder;
+ } else {
+ GTK.gtk_widget_style_get (handle, border, borderPtr,0);
+ if (borderPtr[0] != 0) {
+ OS.memmove (gtkBorder, borderPtr[0], GtkBorder.sizeof);
+ GTK.gtk_border_free(borderPtr[0]);
+ return gtkBorder;
+ }
+ }
+ gtkBorder.left = defaultBorder;
+ gtkBorder.top = defaultBorder;
+ gtkBorder.right = defaultBorder;
+ gtkBorder.bottom = defaultBorder;
+ return gtkBorder;
}
@Override
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java
index 81e68c30d5..e5a3478986 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java
@@ -175,7 +175,7 @@ long gtk_draw (long widget, long cairo) {
if ( GTK.GTK_VERSION < OS.VERSION(3, 22, 0)) {
boolean isFocus = caret != null && caret.isFocusCaret ();
if (isFocus) caret.killFocus ();
- result = super.gtk_draw (widget, cairo);
+ result = super.gtk_draw (widget, cairo);
if (isFocus) caret.setFocus ();
} else {
result = super.gtk_draw (widget, cairo);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ColorDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ColorDialog.java
index cea49d7de2..510bf686c9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ColorDialog.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ColorDialog.java
@@ -239,21 +239,21 @@ public void setRGBs(RGB[] rgbs) {
this.rgbs = rgbs;
}
static String[] splitString(String text, char ch) {
- String[] substrings = new String[1];
- int start = 0, pos = 0;
- while (pos != -1) {
- pos = text.indexOf(ch, start);
- if (pos == -1) {
- substrings[substrings.length - 1] = text.substring(start);
- } else {
- substrings[substrings.length - 1] = text.substring(start, pos);
- start = pos + 1;
- String[] newSubstrings = new String[substrings.length+1];
- System.arraycopy(substrings, 0, newSubstrings, 0, substrings.length);
- substrings = newSubstrings;
- }
- }
- return substrings;
+ String[] substrings = new String[1];
+ int start = 0, pos = 0;
+ while (pos != -1) {
+ pos = text.indexOf(ch, start);
+ if (pos == -1) {
+ substrings[substrings.length - 1] = text.substring(start);
+ } else {
+ substrings[substrings.length - 1] = text.substring(start, pos);
+ start = pos + 1;
+ String[] newSubstrings = new String[substrings.length+1];
+ System.arraycopy(substrings, 0, newSubstrings, 0, substrings.length);
+ substrings = newSubstrings;
+ }
+ }
+ return substrings;
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java
index 48e7fa637f..410757b993 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java
@@ -764,7 +764,7 @@ long findMenuHandle() {
long result = 0;
GTK.gtk_container_forall (popupHandle, display.allChildrenProc, 0);
if (display.allChildren != 0) {
- long list = display.allChildren;
+ long list = display.allChildren;
while (list != 0) {
long widget = OS.g_list_data (list);
if (OS.G_OBJECT_TYPE (widget) == GTK.GTK_TYPE_MENU ()) {
@@ -773,8 +773,8 @@ long findMenuHandle() {
}
list = OS.g_list_next (list);
}
- OS.g_list_free (display.allChildren);
- display.allChildren = 0;
+ OS.g_list_free (display.allChildren);
+ display.allChildren = 0;
}
return result;
}
@@ -1662,9 +1662,9 @@ long gtk_insert_text (long widget, long new_text, long new_text_length, long pos
long gtk_key_press_event (long widget, long event) {
long result = super.gtk_key_press_event (widget, event);
if (result != 0) {
- gdkEventKey = 0;
- fixIM ();
- return result;
+ gdkEventKey = 0;
+ fixIM ();
+ return result;
}
if (gdkEventKey == -1) result = 1;
gdkEventKey = 0;
@@ -1676,10 +1676,10 @@ long gtk_key_press_event (long widget, long event) {
switch (eventKeyval[0]) {
case GDK.GDK_Down:
case GDK.GDK_KP_Down:
- if (oldIndex != (items.length - 1)) {
+ if (oldIndex != (items.length - 1)) {
newIndex = oldIndex + 1;
- }
- break;
+ }
+ break;
case GDK.GDK_Up:
case GDK.GDK_KP_Up:
if (oldIndex != -1 && oldIndex != 0) {
@@ -1693,13 +1693,13 @@ long gtk_key_press_event (long widget, long event) {
* gtk_combo_box_entry.
*/
case GDK.GDK_Page_Up:
- case GDK.GDK_KP_Page_Up:
- newIndex = 0;
- break;
- case GDK.GDK_Page_Down:
- case GDK.GDK_KP_Page_Down:
- newIndex = items.length - 1;
- break;
+ case GDK.GDK_KP_Page_Up:
+ newIndex = 0;
+ break;
+ case GDK.GDK_Page_Down:
+ case GDK.GDK_KP_Page_Down:
+ newIndex = items.length - 1;
+ break;
}
if (newIndex != oldIndex) {
GTK.gtk_combo_box_set_active (handle, newIndex);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
index cd3b5b32a6..a5316e97f3 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
@@ -2710,7 +2710,7 @@ boolean dragDetect (int x, int y, boolean filter, boolean dragOnTimeout, boolean
* See Bug 503431.
*/
if (!OS.isX11()) { // Wayland
- double [] offsetX = new double[1];
+ double [] offsetX = new double[1];
double [] offsetY = new double [1];
double [] startX = new double[1];
double [] startY = new double [1];
@@ -4679,7 +4679,7 @@ void releaseWidget () {
* should be raised or lowered
*/
void restackWindow (long window, long sibling, boolean above) {
- GDK.gdk_window_restack (window, sibling, above);
+ GDK.gdk_window_restack (window, sibling, above);
}
/**
@@ -4690,7 +4690,7 @@ void restackWindow (long window, long sibling, boolean above) {
* should be raised or lowered
*/
void restackSurface (long surface, long sibling, boolean above) {
- GDK.gdk_surface_restack (surface, sibling, above);
+ GDK.gdk_surface_restack (surface, sibling, above);
}
boolean sendDragEvent (int button, int stateMask, int x, int y, boolean isStateMask) {
@@ -4738,7 +4738,7 @@ void sendFocusEvent (int type) {
}
boolean sendGestureEvent (int stateMask, int detail, int x, int y, double delta) {
- if (containedInRegion(x, y)) return false;
+ if (containedInRegion(x, y)) return false;
switch (detail) {
case SWT.GESTURE_ROTATE: {
return sendGestureEvent(stateMask, detail, x, y, delta, 0, 0, 0);
@@ -5032,23 +5032,23 @@ private void _setBackground (Color color) {
void setBackgroundGdkRGBA (long context, long handle, GdkRGBA rgba) {
GdkRGBA selectedBackground = display.getSystemColor(SWT.COLOR_LIST_SELECTION).handle;
- if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
- // Form background string
- String name = GTK.GTK_VERSION >= OS.VERSION(3, 20, 0) ? display.gtk_widget_class_get_css_name(handle)
- : display.gtk_widget_get_name(handle);
- String css = name + " {background-color: " + display.gtk_rgba_to_css_string(rgba) + ";}\n"
- + name + ":selected" + " {background-color: " + display.gtk_rgba_to_css_string(selectedBackground) + ";}";
+ if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
+ // Form background string
+ String name = GTK.GTK_VERSION >= OS.VERSION(3, 20, 0) ? display.gtk_widget_class_get_css_name(handle)
+ : display.gtk_widget_get_name(handle);
+ String css = name + " {background-color: " + display.gtk_rgba_to_css_string(rgba) + ";}\n"
+ + name + ":selected" + " {background-color: " + display.gtk_rgba_to_css_string(selectedBackground) + ";}";
- // Cache background
- cssBackground = css;
+ // Cache background
+ cssBackground = css;
- // Apply background color and any cached foreground color
- String finalCss = display.gtk_css_create_css_color_string (cssBackground, cssForeground, SWT.BACKGROUND);
- gtk_css_provider_load_from_css (context, finalCss);
- } else {
- GTK.gtk_widget_override_background_color (handle, GTK.GTK_STATE_FLAG_NORMAL, rgba);
- GTK.gtk_widget_override_background_color(handle, GTK.GTK_STATE_FLAG_SELECTED, selectedBackground);
- }
+ // Apply background color and any cached foreground color
+ String finalCss = display.gtk_css_create_css_color_string (cssBackground, cssForeground, SWT.BACKGROUND);
+ gtk_css_provider_load_from_css (context, finalCss);
+ } else {
+ GTK.gtk_widget_override_background_color (handle, GTK.GTK_STATE_FLAG_NORMAL, rgba);
+ GTK.gtk_widget_override_background_color(handle, GTK.GTK_STATE_FLAG_SELECTED, selectedBackground);
+ }
}
void setBackgroundGradientGdkRGBA (long context, long handle, GdkRGBA rgba) {
@@ -5504,7 +5504,7 @@ void setForegroundGdkRGBA (long handle, GdkRGBA rgba) {
// Form foreground string
String color = display.gtk_rgba_to_css_string(toSet);
String name = GTK.GTK_VERSION >= OS.VERSION(3, 20, 0) ? display.gtk_widget_class_get_css_name(handle)
- : display.gtk_widget_get_name(handle);
+ : display.gtk_widget_get_name(handle);
GdkRGBA selectedForeground = display.COLOR_LIST_SELECTION_TEXT_RGBA;
String selection = GTK.GTK_VERSION >= OS.VERSION(3, 20, 0) &&
!name.contains("treeview") ? " selection" : ":selected";
@@ -5578,7 +5578,7 @@ boolean mustBeVisibleOnInitBounds() {
* TODO currently phase is set to BUBBLE = 2. Look into using groups perhaps.
*/
private void setDragGesture () {
- if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
+ if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
dragGesture = GTK.gtk_gesture_drag_new (handle);
GTK.gtk_event_controller_set_propagation_phase (dragGesture,
2);
@@ -5586,7 +5586,7 @@ private void setDragGesture () {
OS.g_signal_connect(dragGesture, OS.begin, gestureBegin.getAddress(), this.handle);
OS.g_signal_connect(dragGesture, OS.end, gestureEnd.getAddress(), this.handle);
return;
- }
+ }
}
//private void setPanGesture () {
@@ -5594,7 +5594,7 @@ private void setDragGesture () {
//}
private void setRotateGesture () {
- if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
+ if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
rotateGesture = GTK.gtk_gesture_rotate_new(handle);
GTK.gtk_event_controller_set_propagation_phase (rotateGesture,
2);
@@ -5602,11 +5602,11 @@ private void setRotateGesture () {
OS.g_signal_connect(rotateGesture, OS.begin, gestureBegin.getAddress(), this.handle);
OS.g_signal_connect(rotateGesture, OS.end, gestureEnd.getAddress(), this.handle);
return;
- }
+ }
}
private void setZoomGesture () {
- if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
+ if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
zoomGesture = GTK.gtk_gesture_zoom_new(handle);
GTK.gtk_event_controller_set_propagation_phase (zoomGesture,
2);
@@ -5614,7 +5614,7 @@ private void setZoomGesture () {
OS.g_signal_connect(zoomGesture, OS.begin, gestureBegin.getAddress(), this.handle);
OS.g_signal_connect(zoomGesture, OS.end, gestureEnd.getAddress(), this.handle);
return;
- }
+ }
}
static Control getControl(long handle) {
@@ -6115,7 +6115,7 @@ public void setVisible (boolean visible) {
}
void setZOrder (Control sibling, boolean above, boolean fixRelations) {
- setZOrder (sibling, above, fixRelations, true);
+ setZOrder (sibling, above, fixRelations, true);
}
void setZOrder (Control sibling, boolean above, boolean fixRelations, boolean fixChildren) {
@@ -6180,7 +6180,7 @@ void setZOrder (Control sibling, boolean above, boolean fixRelations, boolean fi
if (redrawSurface != 0 && siblingSurface == 0) stack_mode = false;
restackSurface (surface, siblingS, stack_mode);
if (enableSurface != 0) {
- restackSurface (enableSurface, surface, true);
+ restackSurface (enableSurface, surface, true);
}
}
}
@@ -6211,7 +6211,7 @@ void setZOrder (Control sibling, boolean above, boolean fixRelations, boolean fi
if (redrawWindow != 0 && siblingWindow == 0) stack_mode = false;
restackWindow (window, siblingW, stack_mode);
if (enableWindow != 0) {
- restackWindow (enableWindow, window, true);
+ restackWindow (enableWindow, window, true);
}
}
}
@@ -6313,13 +6313,13 @@ void sort (int [] items) {
for (int gap=length/2; gap>0; gap/=2) {
for (int i=gap; i<length; i++) {
for (int j=i-gap; j>=0; j-=gap) {
- if (items [j] <= items [j + gap]) {
+ if (items [j] <= items [j + gap]) {
int swap = items [j];
items [j] = items [j + gap];
items [j + gap] = swap;
- }
- }
- }
+ }
+ }
+ }
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java
index ba938b20c1..b4013d8871 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java
@@ -919,7 +919,7 @@ long fontHandle () {
private long dateTimeHandle () {
if (isCalendar () && calendarHandle != 0) {
- return calendarHandle;
+ return calendarHandle;
} else if ((isDate () || isTime ())) {
if (GTK.GTK4) {
if (spinButtonHandle != 0) return spinButtonHandle;
@@ -1394,21 +1394,21 @@ void setBackgroundGdkRGBA (long context, long handle, GdkRGBA rgba) {
// We need to override here because DateTime widgets use "background" instead of
// "background-color" as their CSS property.
if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
- // Form background string
- String name = GTK.GTK_VERSION >= OS.VERSION(3, 20, 0) ? display.gtk_widget_class_get_css_name(handle)
- : display.gtk_widget_get_name(handle);
- String css = name + " {background: " + display.gtk_rgba_to_css_string (rgba) + ";}\n" +
- name + ":selected" + " {background: " + display.gtk_rgba_to_css_string(display.COLOR_LIST_SELECTION_RGBA) + ";}";
-
- // Cache background
- cssBackground = css;
-
- // Apply background color and any cached foreground color
- String finalCss = display.gtk_css_create_css_color_string (cssBackground, cssForeground, SWT.BACKGROUND);
- gtk_css_provider_load_from_css (context, finalCss);
- } else {
- super.setBackgroundGdkRGBA(context, handle, rgba);
- }
+ // Form background string
+ String name = GTK.GTK_VERSION >= OS.VERSION(3, 20, 0) ? display.gtk_widget_class_get_css_name(handle)
+ : display.gtk_widget_get_name(handle);
+ String css = name + " {background: " + display.gtk_rgba_to_css_string (rgba) + ";}\n" +
+ name + ":selected" + " {background: " + display.gtk_rgba_to_css_string(display.COLOR_LIST_SELECTION_RGBA) + ";}";
+
+ // Cache background
+ cssBackground = css;
+
+ // Apply background color and any cached foreground color
+ String finalCss = display.gtk_css_create_css_color_string (cssBackground, cssForeground, SWT.BACKGROUND);
+ gtk_css_provider_load_from_css (context, finalCss);
+ } else {
+ super.setBackgroundGdkRGBA(context, handle, rgba);
+ }
}
@Override
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Decorations.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Decorations.java
index 619035829b..31b825e3e2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Decorations.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Decorations.java
@@ -720,10 +720,10 @@ public void setMinimized (boolean minimized) {
@Override
void setOrientation (boolean create) {
- super.setOrientation (create);
- if (!create) {
- if (menuBar != null) menuBar._setOrientation (style & (SWT.RIGHT_TO_LEFT | SWT.LEFT_TO_RIGHT));
- }
+ super.setOrientation (create);
+ if (!create) {
+ if (menuBar != null) menuBar._setOrientation (style & (SWT.RIGHT_TO_LEFT | SWT.LEFT_TO_RIGHT));
+ }
}
void setSavedFocus (Control control) {
@@ -767,16 +767,16 @@ void sort (Image [] images) {
for (int gap=length/2; gap>0; gap/=2) {
for (int i=gap; i<length; i++) {
for (int j=i-gap; j>=0; j-=gap) {
- if (compare (datas [j], datas [j + gap]) >= 0) {
+ if (compare (datas [j], datas [j + gap]) >= 0) {
Image swap = images [j];
images [j] = images [j + gap];
images [j + gap] = swap;
ImageData swapData = datas [j];
datas [j] = datas [j + gap];
datas [j + gap] = swapData;
- }
- }
- }
+ }
+ }
+ }
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
index 757369b3a3..1896c3477c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
@@ -887,7 +887,7 @@ public void asyncExec (Runnable runnable) {
if (isDisposed ()) error (SWT.ERROR_DEVICE_DISPOSED);
synchronized (idleLock) {
if (idleNeeded && idleHandle == 0) {
- //NOTE: calling unlocked function in OS
+ //NOTE: calling unlocked function in OS
idleHandle = OS._g_idle_add (idleProc, 0);
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Link.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Link.java
index 3147f53bd8..74d35d9347 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Link.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Link.java
@@ -783,9 +783,9 @@ public void setLinkForeground (Color color) {
@Override
void setOrientation (boolean create) {
- super.setOrientation (create);
- layout.setOrientation (style & (SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT));
- if (!create) redraw (true);
+ super.setOrientation (create);
+ layout.setOrientation (style & (SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT));
+ if (!create) redraw (true);
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java
index 08433b8107..5c82b3f469 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java
@@ -266,11 +266,11 @@ Point computeSizeInPixels (int wHint, int hHint, boolean changed) {
* So if the height is returned as zero calculate the table height
* based on the number of items in the table
*/
- if (size.y == 0 && hHint == SWT.DEFAULT) {
- size.y = getItemCount() * getItemHeightInPixels();
- }
+ if (size.y == 0 && hHint == SWT.DEFAULT) {
+ size.y = getItemCount() * getItemHeightInPixels();
+ }
- /*
+ /*
* In case the table doesn't contain any elements,
* getItemCount returns 0 and size.y will be 0
* so need to assign default height
@@ -950,8 +950,8 @@ long gtk_button_release_event (long widget, long event) {
if ((eventState[0] & (GDK.GDK_CONTROL_MASK|GDK.GDK_SHIFT_MASK)) == 0) {
GTK.gtk_tree_view_set_cursor(handle, path[0], 0, false);
}
- // Check to see if there has been a new tree item selected when holding Control in Path.
- // If not, deselect the item.
+ // Check to see if there has been a new tree item selected when holding Control in Path.
+ // If not, deselect the item.
if ((eventState[0] & GDK.GDK_CONTROL_MASK) != 0 && selectionCountOnRelease == selectionCountOnPress) {
GTK.gtk_tree_selection_unselect_path (selection,path[0]);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java
index 190e45bb5e..4b992d3786 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java
@@ -241,8 +241,8 @@ void _setVisible (boolean visible) {
*/
TrayItem item = display.currentTrayItem;
if (item != null && !item.isDisposed()) {
- data = item.handle;
- address = GTK.gtk_status_icon_position_menu_func ();
+ data = item.handle;
+ address = GTK.gtk_status_icon_position_menu_func ();
}
/*
* Bug in GTK. The timestamp passed into gtk_menu_popup is used
@@ -1170,29 +1170,29 @@ void setLocationInPixels (Point location) {
* @since 3.7
*/
public void setOrientation (int orientation) {
- checkWidget ();
- if ((style & (SWT.BAR | SWT.DROP_DOWN)) != 0) return;
- _setOrientation (orientation);
+ checkWidget ();
+ if ((style & (SWT.BAR | SWT.DROP_DOWN)) != 0) return;
+ _setOrientation (orientation);
}
void _setOrientation (int orientation) {
- int flags = SWT.RIGHT_TO_LEFT | SWT.LEFT_TO_RIGHT;
- if ((orientation & flags) == 0 || (orientation & flags) == flags) return;
- style &= ~flags;
- style |= orientation & flags;
- setOrientation (false);
+ int flags = SWT.RIGHT_TO_LEFT | SWT.LEFT_TO_RIGHT;
+ if ((orientation & flags) == 0 || (orientation & flags) == flags) return;
+ style &= ~flags;
+ style |= orientation & flags;
+ setOrientation (false);
}
@Override
void setOrientation (boolean create) {
- if ((style & SWT.RIGHT_TO_LEFT) != 0 || !create) {
- int dir = (style & SWT.RIGHT_TO_LEFT) != 0 ? GTK.GTK_TEXT_DIR_RTL : GTK.GTK_TEXT_DIR_LTR;
- if (handle != 0) GTK.gtk_widget_set_direction (handle, dir);
- MenuItem [] items = getItems ();
- for (int i = 0; i < items.length; i++) {
- items [i].setOrientation (create);
- }
- }
+ if ((style & SWT.RIGHT_TO_LEFT) != 0 || !create) {
+ int dir = (style & SWT.RIGHT_TO_LEFT) != 0 ? GTK.GTK_TEXT_DIR_RTL : GTK.GTK_TEXT_DIR_LTR;
+ if (handle != 0) GTK.gtk_widget_set_direction (handle, dir);
+ MenuItem [] items = getItems ();
+ for (int i = 0; i < items.length; i++) {
+ items [i].setOrientation (create);
+ }
+ }
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java
index 81196176f5..e95b49733d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java
@@ -954,13 +954,13 @@ public void setMenu (Menu menu) {
@Override
void setOrientation (boolean create) {
- super.setOrientation (create);
- if ((parent.style & SWT.RIGHT_TO_LEFT) != 0 || !create) {
- int dir = (parent.style & SWT.RIGHT_TO_LEFT) != 0 ? GTK.GTK_TEXT_DIR_RTL : GTK.GTK_TEXT_DIR_LTR;
- GTK.gtk_widget_set_direction (handle, dir);
- GTK.gtk_container_forall (handle, display.setDirectionProc, dir);
- if (menu != null) menu._setOrientation (parent.style & (SWT.RIGHT_TO_LEFT | SWT.LEFT_TO_RIGHT));
- }
+ super.setOrientation (create);
+ if ((parent.style & SWT.RIGHT_TO_LEFT) != 0 || !create) {
+ int dir = (parent.style & SWT.RIGHT_TO_LEFT) != 0 ? GTK.GTK_TEXT_DIR_RTL : GTK.GTK_TEXT_DIR_LTR;
+ GTK.gtk_widget_set_direction (handle, dir);
+ GTK.gtk_container_forall (handle, display.setDirectionProc, dir);
+ if (menu != null) menu._setOrientation (parent.style & (SWT.RIGHT_TO_LEFT | SWT.LEFT_TO_RIGHT));
+ }
}
boolean setRadioSelection (boolean value) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java
index fc20a5d2e0..21d0e260b2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java
@@ -729,20 +729,20 @@ void reskinChildren (int flags) {
@Override
void setBackgroundGdkRGBA (long context, long handle, GdkRGBA rgba) {
- if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
- // Form background string
- String name = GTK.GTK_VERSION >= OS.VERSION(3, 20, 0) ? "notebook header" : "GtkNotebook.header";
- String css = name + " {background-color: " + display.gtk_rgba_to_css_string (rgba) + ";}";
-
- // Cache background
- cssBackground = css;
-
- // Apply background color and any cached foreground color
- String finalCss = display.gtk_css_create_css_color_string (cssBackground, cssForeground, SWT.BACKGROUND);
- gtk_css_provider_load_from_css (context, finalCss);
- } else {
- GTK.gtk_widget_override_background_color (handle, GTK.GTK_STATE_FLAG_NORMAL, rgba);
- }
+ if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
+ // Form background string
+ String name = GTK.GTK_VERSION >= OS.VERSION(3, 20, 0) ? "notebook header" : "GtkNotebook.header";
+ String css = name + " {background-color: " + display.gtk_rgba_to_css_string (rgba) + ";}";
+
+ // Cache background
+ cssBackground = css;
+
+ // Apply background color and any cached foreground color
+ String finalCss = display.gtk_css_create_css_color_string (cssBackground, cssForeground, SWT.BACKGROUND);
+ gtk_css_provider_load_from_css (context, finalCss);
+ } else {
+ GTK.gtk_widget_override_background_color (handle, GTK.GTK_STATE_FLAG_NORMAL, rgba);
+ }
}
@Override
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
index 2bb970c8b4..4a539aba02 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
@@ -728,8 +728,8 @@ void createItem (TableColumn column, int index) {
/*
* Feature in GTK. The tree view does not resize immediately if a table
* column is created when the table is not visible. If the width of the
- * new column is queried, GTK returns an incorrect value. The fix is to
- * ensure that the columns are resized before any queries.
+ * new column is queried, GTK returns an incorrect value. The fix is to
+ * ensure that the columns are resized before any queries.
*/
if(!isVisible ()) {
forceResize();
@@ -1958,7 +1958,7 @@ long getTextRenderer (long column) {
long textRenderer = 0;
while (list != 0) {
long renderer = OS.g_list_data (list);
- if (GTK.GTK_IS_CELL_RENDERER_TEXT (renderer)) {
+ if (GTK.GTK_IS_CELL_RENDERER_TEXT (renderer)) {
textRenderer = renderer;
break;
}
@@ -2226,8 +2226,8 @@ long gtk_button_release_event (long widget, long event) {
if ((eventState[0] & (GDK.GDK_CONTROL_MASK|GDK.GDK_SHIFT_MASK)) == 0) {
GTK.gtk_tree_view_set_cursor(handle, path[0], 0, false);
}
- // Check to see if there has been a new tree item selected when holding Control in Path.
- // If not, deselect the item.
+ // Check to see if there has been a new tree item selected when holding Control in Path.
+ // If not, deselect the item.
if ((eventState[0] & GDK.GDK_CONTROL_MASK) != 0 && selectionCountOnRelease == selectionCountOnPress) {
GTK.gtk_tree_selection_unselect_path (selection,path[0]);
}
@@ -3398,7 +3398,7 @@ void setBackgroundGdkRGBA (long context, long handle, GdkRGBA rgba) {
if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
String name = GTK.GTK_VERSION >= OS.VERSION(3, 20, 0) ? "treeview" : "GtkTreeView";
String css = name + " {background-color: " + display.gtk_rgba_to_css_string(background) + ";}\n"
- + name + ":selected {background-color: " + display.gtk_rgba_to_css_string(selectedBackground) + ";}";
+ + name + ":selected {background-color: " + display.gtk_rgba_to_css_string(selectedBackground) + ";}";
// Cache background color
cssBackground = css;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java
index 1b52111e33..40f22b9fef 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java
@@ -834,7 +834,7 @@ int getBorderWidthInPixels () {
checkWidget();
if ((style & SWT.MULTI) != 0) return super.getBorderWidthInPixels ();
if ((this.style & SWT.BORDER) != 0) {
- return getThickness (handle).x;
+ return getThickness (handle).x;
}
return 0;
}
@@ -2275,20 +2275,20 @@ void setBackgroundGdkRGBA (long context, long handle, GdkRGBA rgba) {
String properties;
String name;
String selection = GTK.GTK_VERSION >= OS.VERSION(3, 20, 0) ? " selection" : ":selected";
- if ((style & SWT.SINGLE) != 0) {
- name = GTK.GTK_VERSION >= OS.VERSION(3, 20, 0) ? "entry" : "GtkEntry";
- properties = " {background: " + display.gtk_rgba_to_css_string(background) + ";}\n"
- + name + ":selected {background-color: " + display.gtk_rgba_to_css_string(selectedBackground) + ";}\n"
- + name + selection + " {color: " + display.gtk_rgba_to_css_string(selectedForeground) + ";}";
- } else {
- name = GTK.GTK_VERSION >= OS.VERSION(3, 20, 0) ? "textview text" : "GtkTextView";
- properties = " {background-color: " + display.gtk_rgba_to_css_string(background) + ";}\n"
- + name + ":selected {background-color: " + display.gtk_rgba_to_css_string(selectedBackground) + ";}\n"
- + name + selection + " {color: " + display.gtk_rgba_to_css_string(selectedForeground) + ";}";
- }
- css = name + properties;
-
- // Cache background color
+ if ((style & SWT.SINGLE) != 0) {
+ name = GTK.GTK_VERSION >= OS.VERSION(3, 20, 0) ? "entry" : "GtkEntry";
+ properties = " {background: " + display.gtk_rgba_to_css_string(background) + ";}\n"
+ + name + ":selected {background-color: " + display.gtk_rgba_to_css_string(selectedBackground) + ";}\n"
+ + name + selection + " {color: " + display.gtk_rgba_to_css_string(selectedForeground) + ";}";
+ } else {
+ name = GTK.GTK_VERSION >= OS.VERSION(3, 20, 0) ? "textview text" : "GtkTextView";
+ properties = " {background-color: " + display.gtk_rgba_to_css_string(background) + ";}\n"
+ + name + ":selected {background-color: " + display.gtk_rgba_to_css_string(selectedBackground) + ";}\n"
+ + name + selection + " {color: " + display.gtk_rgba_to_css_string(selectedForeground) + ";}";
+ }
+ css = name + properties;
+
+ // Cache background color
cssBackground = css;
// Apply background color and any foreground color
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java
index 7376a23cc5..22c51802f6 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java
@@ -387,7 +387,7 @@ ToolItem [] _getItems () {
*/
public int getRowCount () {
checkWidget();
- /* On GTK, toolbars cannot wrap */
+ /* On GTK, toolbars cannot wrap */
return 1;
}
@@ -626,7 +626,7 @@ void setForegroundGdkRGBA (long handle, GdkRGBA rgba) {
// Form foreground string
String color = display.gtk_rgba_to_css_string(toSet);
String name = GTK.GTK_VERSION >= OS.VERSION(3, 20, 0) ? display.gtk_widget_class_get_css_name(handle)
- : display.gtk_widget_get_name(handle);
+ : display.gtk_widget_get_name(handle);
GdkRGBA selectedForeground = display.COLOR_LIST_SELECTION_TEXT_RGBA;
String selection = GTK.GTK_VERSION >= OS.VERSION(3, 20, 0) ? " selection" : ":selected";
String css = "* {color: " + color + ";}\n"
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
index 4223d39f02..c4897b4c4f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
@@ -1015,7 +1015,7 @@ void setBackgroundRGBA (long handle, GdkRGBA rgba) {
// Form background string
long context = GTK.gtk_widget_get_style_context(handle);
String name = GTK.GTK_VERSION >= OS.VERSION(3, 20, 0) ? display.gtk_widget_class_get_css_name(handle)
- : display.gtk_widget_get_name(handle);
+ : display.gtk_widget_get_name(handle);
String css = name + " {background-color: " + display.gtk_rgba_to_css_string(rgba) + "}";
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
index 374bc60e39..af67fbb6c6 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
@@ -2060,7 +2060,7 @@ TreeItem _getCachedTopItem() {
long iter = OS.g_malloc (GTK.GtkTreeIter_sizeof ());
long data = OS.g_list_data (list);
if (GTK.gtk_tree_model_get_iter (modelHandle, iter, data)) {
- treeSelection = _getItem (iter);
+ treeSelection = _getItem (iter);
}
OS.g_free (iter);
GTK.gtk_tree_path_free (data);
@@ -2306,8 +2306,8 @@ long gtk_button_release_event (long widget, long event) {
if ((eventState[0] & (GDK.GDK_CONTROL_MASK|GDK.GDK_SHIFT_MASK)) == 0) {
GTK.gtk_tree_view_set_cursor(handle, path[0], 0, false);
}
- // Check to see if there has been a new tree item selected when holding Control in Path.
- // If not, deselect the item.
+ // Check to see if there has been a new tree item selected when holding Control in Path.
+ // If not, deselect the item.
if ((eventState[0] & GDK.GDK_CONTROL_MASK) != 0 && selectionCountOnRelease == selectionCountOnPress) {
GTK.gtk_tree_selection_unselect_path (selection,path[0]);
}
@@ -3485,7 +3485,7 @@ void setBackgroundGdkRGBA (long context, long handle, GdkRGBA rgba) {
if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) {
String name = GTK.GTK_VERSION >= OS.VERSION(3, 20, 0) ? "treeview" : "GtkTreeView";
String css = name + " {background-color: " + display.gtk_rgba_to_css_string(background) + ";}\n"
- + name + ":selected {background-color: " + display.gtk_rgba_to_css_string(selectedBackground) + ";}";
+ + name + ":selected {background-color: " + display.gtk_rgba_to_css_string(selectedBackground) + ";}";
// Cache background color
cssBackground = css;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Cursor.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Cursor.java
index 6e2946c31f..3c7149a8ec 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Cursor.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Cursor.java
@@ -340,12 +340,12 @@ void destroy () {
OS.DestroyIcon(handle);
} else {
/*
- * The MSDN states that one should not destroy a shared
- * cursor, that is, one obtained from LoadCursor.
- * However, it does not appear to do any harm, so rather
- * than keep track of how a cursor was created, we just
- * destroy them all. If this causes problems in the future,
- * put the flag back in.
+ * The MSDN states that one should not destroy a shared
+ * cursor, that is, one obtained from LoadCursor.
+ * However, it does not appear to do any harm, so rather
+ * than keep track of how a cursor was created, we just
+ * destroy them all. If this causes problems in the future,
+ * put the flag back in.
*/
OS.DestroyCursor(handle);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
index 3158b3d157..7bfc551f52 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
@@ -452,7 +452,7 @@ void copyAreaInPixels(Image image, int x, int y) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (image == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
if (image.type != SWT.BITMAP || image.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
- /* Copy the bitmap area */
+ /* Copy the bitmap area */
Rectangle rect = image.getBoundsInPixels();
long /*int*/ memHdc = OS.CreateCompatibleDC(handle);
long /*int*/ hOldBitmap = OS.SelectObject(memHdc, image.handle);
@@ -1067,7 +1067,7 @@ void drawIcon(Image srcImage, int srcX, int srcY, int srcWidth, int srcHeight, i
OS.DrawIconEx(handle, destX - offsetX, destY - offsetY, srcImage.handle, 0, 0, 0, 0, flags);
if (offsetX != 0 || offsetY != 0) OS.SetWindowOrgEx(handle, offsetX, offsetY, null);
} else {
- /* Create the icon info and HDC's */
+ /* Create the icon info and HDC's */
ICONINFO newIconInfo = new ICONINFO();
newIconInfo.fIcon = true;
long /*int*/ srcHdc = OS.CreateCompatibleDC(handle);
@@ -1287,9 +1287,9 @@ void drawBitmapAlpha(Image srcImage, int srcX, int srcY, int srcWidth, int srcHe
byte[] destData = new byte[sizeInBytes];
OS.MoveMemory(destData, dibBM.bmBits, sizeInBytes);
- /* Get the foreground pixels */
- OS.BitBlt(memHdc, 0, 0, srcWidth, srcHeight, srcHdc, srcX, srcY, OS.SRCCOPY);
- byte[] srcData = new byte[sizeInBytes];
+ /* Get the foreground pixels */
+ OS.BitBlt(memHdc, 0, 0, srcWidth, srcHeight, srcHdc, srcX, srcY, OS.SRCCOPY);
+ byte[] srcData = new byte[sizeInBytes];
OS.MoveMemory(srcData, dibBM.bmBits, sizeInBytes);
/* Merge the alpha channel in place */
@@ -4830,7 +4830,7 @@ public void setTransform(Transform transform) {
initGdip();
long /*int*/ identity = identity();
if (transform != null) {
- Gdip.Matrix_Multiply(identity, transform.handle, Gdip.MatrixOrderPrepend);
+ Gdip.Matrix_Multiply(identity, transform.handle, Gdip.MatrixOrderPrepend);
}
Gdip.Graphics_SetTransform(data.gdipGraphics, identity);
Gdip.Matrix_delete(identity);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
index e8e2f61a12..25af16c849 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
@@ -940,16 +940,16 @@ void initNative(String filename) {
OS.MoveMemory(data, pixels, data.length);
switch (bitmapData.PixelFormat) {
case Gdip.PixelFormat16bppARGB1555:
- alphaData = new byte[width * height];
- for (int i = 1, j = 0; i < data.length; i += 2, j++) {
- alphaData[j] = (byte)((data[i] & 0x80) != 0 ? 255 : 0);
- }
+ alphaData = new byte[width * height];
+ for (int i = 1, j = 0; i < data.length; i += 2, j++) {
+ alphaData[j] = (byte)((data[i] & 0x80) != 0 ? 255 : 0);
+ }
break;
case Gdip.PixelFormat32bppARGB:
- alphaData = new byte[width * height];
- for (int i = 3, j = 0; i < data.length; i += 4, j++) {
- alphaData[j] = data[i];
- }
+ alphaData = new byte[width * height];
+ for (int i = 3, j = 0; i < data.length; i += 4, j++) {
+ alphaData[j] = data[i];
+ }
break;
}
ImageData img = new ImageData(width, height, depth, paletteData, scanlinePad, data);
@@ -957,7 +957,7 @@ void initNative(String filename) {
img.alphaData = alphaData;
init(img);
}
- Gdip.Bitmap_UnlockBits(bitmap, lockedBitmapData);
+ Gdip.Bitmap_UnlockBits(bitmap, lockedBitmapData);
} else {
error = SWT.ERROR_INVALID_IMAGE;
}
@@ -992,9 +992,9 @@ long /*int*/ [] createGdipImage() {
BITMAP dibBM = new BITMAP();
OS.GetObject(memDib, BITMAP.sizeof, dibBM);
int sizeInBytes = dibBM.bmWidthBytes * dibBM.bmHeight;
- OS.BitBlt(memHdc, 0, 0, imgWidth, imgHeight, srcHdc, 0, 0, OS.SRCCOPY);
- byte red = 0, green = 0, blue = 0;
- if (transparentPixel != -1) {
+ OS.BitBlt(memHdc, 0, 0, imgWidth, imgHeight, srcHdc, 0, 0, OS.SRCCOPY);
+ byte red = 0, green = 0, blue = 0;
+ if (transparentPixel != -1) {
if (bm.bmBitsPixel <= 8) {
byte[] color = new byte[4];
OS.GetDIBColorTable(srcHdc, transparentPixel, 1, color);
@@ -1029,12 +1029,12 @@ long /*int*/ [] createGdipImage() {
break;
}
}
- }
+ }
OS.SelectObject(srcHdc, oldSrcBitmap);
OS.SelectObject(memHdc, oldMemBitmap);
OS.DeleteObject(srcHdc);
OS.DeleteObject(memHdc);
- byte[] srcData = new byte[sizeInBytes];
+ byte[] srcData = new byte[sizeInBytes];
OS.MoveMemory(srcData, dibBM.bmBits, sizeInBytes);
OS.DeleteObject(memDib);
device.internal_dispose_GC(hDC, null);
@@ -1104,10 +1104,10 @@ long /*int*/ [] createGdipImage() {
long /*int*/ oldMemBitmap = OS.SelectObject(memHdc, memDib);
BITMAP dibBM = new BITMAP();
OS.GetObject(memDib, BITMAP.sizeof, dibBM);
- OS.BitBlt(memHdc, 0, 0, imgWidth, imgHeight, srcHdc, 0, hBitmap == iconInfo.hbmMask ? imgHeight : 0, OS.SRCCOPY);
+ OS.BitBlt(memHdc, 0, 0, imgWidth, imgHeight, srcHdc, 0, hBitmap == iconInfo.hbmMask ? imgHeight : 0, OS.SRCCOPY);
OS.SelectObject(memHdc, oldMemBitmap);
OS.DeleteObject(memHdc);
- byte[] srcData = new byte[dibBM.bmWidthBytes * dibBM.bmHeight];
+ byte[] srcData = new byte[dibBM.bmWidthBytes * dibBM.bmHeight];
OS.MoveMemory(srcData, dibBM.bmBits, srcData.length);
OS.DeleteObject(memDib);
OS.SelectObject(srcHdc, iconInfo.hbmMask);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/ImageList.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/ImageList.java
index 14ee7c26bc..3859a51c39 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/ImageList.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/ImageList.java
@@ -143,9 +143,9 @@ long /*int*/ copyWithAlpha (long /*int*/ hBitmap, int background, byte[] alphaDa
OS.GetObject (memDib, BITMAP.sizeof, dibBM);
int sizeInBytes = dibBM.bmWidthBytes * dibBM.bmHeight;
- /* Get the foreground pixels */
- OS.BitBlt (memHdc, 0, 0, srcWidth, srcHeight, srcHdc, 0, 0, OS.SRCCOPY);
- byte[] srcData = new byte [sizeInBytes];
+ /* Get the foreground pixels */
+ OS.BitBlt (memHdc, 0, 0, srcWidth, srcHeight, srcHdc, 0, 0, OS.SRCCOPY);
+ byte[] srcData = new byte [sizeInBytes];
OS.MoveMemory (srcData, dibBM.bmBits, sizeInBytes);
/* Merge the alpha channel in place */
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Combo.java
index 66623517f1..cd4c2404e9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Combo.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Combo.java
@@ -440,15 +440,15 @@ void applyListSegments () {
}
while (index-- > 0) {
buffer = null;
- if (add) {
+ if (add) {
int length = (int)/*64*/OS.SendMessage (handle, OS.CB_GETLBTEXTLEN, index, 0);
if (length == OS.CB_ERR) error (SWT.ERROR);
buffer = new TCHAR (cp, length + 1);
if (OS.SendMessage (handle, OS.CB_GETLBTEXT, index, buffer) == OS.CB_ERR) return;
items [index] = string = buffer.toString (0, length);
- } else {
- string = items [index];
- }
+ } else {
+ string = items [index];
+ }
if (OS.SendMessage (handle, OS.CB_DELETESTRING, index, 0) == OS.CB_ERR) return;
if (buffer == null) buffer = new TCHAR (cp, string, true);
if (OS.SendMessage (handle, OS.CB_INSERTSTRING, index, buffer) == OS.CB_ERR) return;
@@ -556,7 +556,7 @@ void clearSegments (boolean applyText) {
if (nSegments == 0) return;
long /*int*/ hwndText = OS.GetDlgItem (handle, CBID_EDIT);
int/*64*/ limit = (int/*64*/)OS.SendMessage (hwndText, OS.EM_GETLIMITTEXT, 0, 0) & 0x7fffffff;
- if (limit < LIMIT) {
+ if (limit < LIMIT) {
OS.SendMessage (hwndText, OS.EM_SETLIMITTEXT, Math.max (1, limit - nSegments), 0);
}
if (!applyText) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
index 61cacd758f..6f8f72bd84 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
@@ -1046,7 +1046,7 @@ char findMnemonic (String string) {
if (string.charAt (index) != '&') return string.charAt (index);
index++;
} while (index < length);
- return '\0';
+ return '\0';
}
void fixChildren (Shell newShell, Shell oldShell, Decorations newDecorations, Decorations oldDecorations, Menu [] menus) {
@@ -3046,7 +3046,7 @@ boolean sendGestureEvent (GESTUREINFO gi) {
break;
}
- if (type == 0) return true;
+ if (type == 0) return true;
setInputState (event, type);
sendEvent (type, event);
return event.doit;
@@ -3968,13 +3968,13 @@ void sort (int [] items) {
for (int gap=length/2; gap>0; gap/=2) {
for (int i=gap; i<length; i++) {
for (int j=i-gap; j>=0; j-=gap) {
- if (items [j] <= items [j + gap]) {
+ if (items [j] <= items [j + gap]) {
int swap = items [j];
items [j] = items [j + gap];
items [j + gap] = swap;
- }
- }
- }
+ }
+ }
+ }
}
}
@@ -5394,7 +5394,7 @@ LRESULT WM_RBUTTONUP (long /*int*/ wParam, long /*int*/ lParam) {
LRESULT WM_SETCURSOR (long /*int*/ wParam, long /*int*/ lParam) {
int hitTest = (short) OS.LOWORD (lParam);
- if (hitTest == OS.HTCLIENT) {
+ if (hitTest == OS.HTCLIENT) {
Control control = display.getControl (wParam);
if (control == null) return null;
Cursor cursor = control.findCursor ();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Decorations.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Decorations.java
index 97e04a6c81..112577a494 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Decorations.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Decorations.java
@@ -1090,15 +1090,15 @@ public void setMinimized (boolean minimized) {
@Override
public void setOrientation (int orientation) {
- super.setOrientation (orientation);
- if (menus != null) {
- for (int i=0; i<menus.length; i++) {
- Menu menu = menus [i];
- if (menu != null && !menu.isDisposed () && (menu.getStyle () & SWT.POP_UP) != 0) {
- menu._setOrientation (menu.getOrientation ());
- }
- }
- }
+ super.setOrientation (orientation);
+ if (menus != null) {
+ for (int i=0; i<menus.length; i++) {
+ Menu menu = menus [i];
+ if (menu != null && !menu.isDisposed () && (menu.getStyle () & SWT.POP_UP) != 0) {
+ menu._setOrientation (menu.getOrientation ());
+ }
+ }
+ }
}
void setParent () {
@@ -1339,16 +1339,16 @@ void sort (Image [] images, ImageData [] datas, int width, int height, int depth
for (int gap=length/2; gap>0; gap/=2) {
for (int i=gap; i<length; i++) {
for (int j=i-gap; j>=0; j-=gap) {
- if (compare (datas [j], datas [j + gap], width, height, depth) >= 0) {
+ if (compare (datas [j], datas [j + gap], width, height, depth) >= 0) {
Image swap = images [j];
images [j] = images [j + gap];
images [j + gap] = swap;
ImageData swapData = datas [j];
datas [j] = datas [j + gap];
datas [j + gap] = swapData;
- }
- }
- }
+ }
+ }
+ }
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/DirectoryDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/DirectoryDialog.java
index 4cf84ac2cb..50b3be4d3f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/DirectoryDialog.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/DirectoryDialog.java
@@ -46,7 +46,7 @@ public class DirectoryDialog extends Dialog {
OS.IIDFromString("{DC1C5A9C-E88A-4dde-A5A1-60F82A20AEF7}\0".toCharArray(), CLSID_FileOpenDialog); //$NON-NLS-1$
OS.IIDFromString("{d57c7288-d4ad-4768-be02-9d969532d960}\0".toCharArray(), IID_IFileOpenDialog); //$NON-NLS-1$
OS.IIDFromString("{43826d1e-e718-42ee-bc55-a1e261c37bfe}\0".toCharArray(), IID_IShellItem); //$NON-NLS-1$
- }
+ }
String message = "", filterPath = ""; //$NON-NLS-1$//$NON-NLS-2$
String directoryPath;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java
index 0aad7e5b74..1aa83e1836 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java
@@ -865,9 +865,9 @@ static long /*int*/ create32bitDIB (Image image) {
BITMAP dibBM = new BITMAP ();
OS.GetObject (memDib, BITMAP.sizeof, dibBM);
int sizeInBytes = dibBM.bmWidthBytes * dibBM.bmHeight;
- OS.BitBlt (memHdc, 0, 0, imgWidth, imgHeight, srcHdc, 0, 0, OS.SRCCOPY);
- byte red = 0, green = 0, blue = 0;
- if (transparentPixel != -1) {
+ OS.BitBlt (memHdc, 0, 0, imgWidth, imgHeight, srcHdc, 0, 0, OS.SRCCOPY);
+ byte red = 0, green = 0, blue = 0;
+ if (transparentPixel != -1) {
if (bm.bmBitsPixel <= 8) {
byte [] color = new byte [4];
OS.GetDIBColorTable (srcHdc, transparentPixel, 1, color);
@@ -893,8 +893,8 @@ static long /*int*/ create32bitDIB (Image image) {
break;
}
}
- }
- byte [] srcData = new byte [sizeInBytes];
+ }
+ byte [] srcData = new byte [sizeInBytes];
OS.MoveMemory (srcData, pBits [0], sizeInBytes);
if (hMask != 0) {
OS.SelectObject(srcHdc, hMask);
@@ -995,9 +995,9 @@ static long /*int*/ create32bitDIB (long /*int*/ hBitmap, int alpha, byte [] alp
BITMAP dibBM = new BITMAP ();
OS.GetObject (memDib, BITMAP.sizeof, dibBM);
int sizeInBytes = dibBM.bmWidthBytes * dibBM.bmHeight;
- OS.BitBlt (memHdc, 0, 0, imgWidth, imgHeight, srcHdc, 0, 0, OS.SRCCOPY);
- byte red = 0, green = 0, blue = 0;
- if (transparentPixel != -1) {
+ OS.BitBlt (memHdc, 0, 0, imgWidth, imgHeight, srcHdc, 0, 0, OS.SRCCOPY);
+ byte red = 0, green = 0, blue = 0;
+ if (transparentPixel != -1) {
if (bm.bmBitsPixel <= 8) {
byte [] color = new byte [4];
OS.GetDIBColorTable (srcHdc, transparentPixel, 1, color);
@@ -1023,13 +1023,13 @@ static long /*int*/ create32bitDIB (long /*int*/ hBitmap, int alpha, byte [] alp
break;
}
}
- }
+ }
OS.SelectObject (srcHdc, oldSrcBitmap);
OS.SelectObject (memHdc, oldMemBitmap);
OS.DeleteObject (srcHdc);
OS.DeleteObject (memHdc);
OS.ReleaseDC (0, hDC);
- byte [] srcData = new byte [sizeInBytes];
+ byte [] srcData = new byte [sizeInBytes];
OS.MoveMemory (srcData, pBits [0], sizeInBytes);
if (alpha != -1) {
for (int y = 0, dp = 0; y < imgHeight; ++y) {
@@ -2738,7 +2738,7 @@ public void internal_dispose_GC (long /*int*/ hDC, GCData data) {
boolean isXMouseActive () {
/*
* NOTE: X-Mouse is active when bit 1 of the UserPreferencesMask is set.
- */
+ */
boolean xMouseActive = false;
TCHAR key = new TCHAR (0, "Control Panel\\Desktop", true); //$NON-NLS-1$
long /*int*/ [] phKey = new long /*int*/ [1];
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandBar.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandBar.java
index 053a20d1ab..8b85c43964 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ExpandBar.java
@@ -821,7 +821,7 @@ LRESULT WM_SETCURSOR (long /*int*/ wParam, long /*int*/ lParam) {
LRESULT result = super.WM_SETCURSOR (wParam, lParam);
if (result != null) return result;
int hitTest = (short) OS.LOWORD (lParam);
- if (hitTest == OS.HTCLIENT) {
+ if (hitTest == OS.HTCLIENT) {
for (int i = 0; i < itemCount; i++) {
ExpandItem item = items [i];
if (item.hover) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FileDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FileDialog.java
index 9c7e8fd3d8..a04c0608cc 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FileDialog.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FileDialog.java
@@ -218,9 +218,9 @@ long /*int*/ OFNHookProc (long /*int*/ hdlg, long /*int*/ uiMsg, long /*int*/ wP
OS.MoveMemory (ofn.lpOFN, lpofn, OPENFILENAME.sizeof);
}
}
- }
- }
- break;
+ }
+ }
+ break;
}
return 0;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/IME.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/IME.java
index 9e3e860ae6..8d1b099210 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/IME.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/IME.java
@@ -545,9 +545,9 @@ LRESULT WM_KEYDOWN (long /*int*/ wParam, long /*int*/ lParam) {
}
if (event.text != null && event.text.length() > 0) {
int length = event.text.length();
- if (length > 1) {
- event.end = event.start + 1;
- }
+ if (length > 1) {
+ event.end = event.start + 1;
+ }
long /*int*/ hwnd = parent.handle;
long /*int*/ hIMC = OS.ImmGetContext (hwnd);
TCHAR buffer = new TCHAR (0, event.text, true);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/List.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/List.java
index 0aa83f7cb3..e393f1abcd 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/List.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/List.java
@@ -253,7 +253,7 @@ static int checkStyle (int style) {
if (hHint == SWT.DEFAULT) {
int count = (int)/*64*/OS.SendMessage (handle, OS.LB_GETCOUNT, 0, 0);
int itemHeight = (int)/*64*/OS.SendMessage (handle, OS.LB_GETITEMHEIGHT, 0, 0);
- height = count * itemHeight;
+ height = count * itemHeight;
}
if (width == 0) width = DEFAULT_WIDTH;
if (height == 0) height = DEFAULT_HEIGHT;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Menu.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Menu.java
index 3a7bb7164b..3f4b7dcd23 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Menu.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Menu.java
@@ -1232,21 +1232,21 @@ public void setLocation (Point location) {
* @since 3.7
*/
public void setOrientation (int orientation) {
- checkWidget ();
- if ((style & (SWT.BAR | SWT.DROP_DOWN)) != 0) return;
- _setOrientation (orientation);
+ checkWidget ();
+ if ((style & (SWT.BAR | SWT.DROP_DOWN)) != 0) return;
+ _setOrientation (orientation);
}
void _setOrientation (int orientation) {
- int flags = SWT.RIGHT_TO_LEFT | SWT.LEFT_TO_RIGHT;
- if ((orientation & flags) == 0 || (orientation & flags) == flags) return;
- style &= ~flags;
- style |= orientation & flags;
- style &= ~SWT.FLIP_TEXT_DIRECTION;
- MenuItem [] itms = getItems ();
- for (int i=0; i<itms.length; i++) {
- itms [i].setOrientation (orientation);
- }
+ int flags = SWT.RIGHT_TO_LEFT | SWT.LEFT_TO_RIGHT;
+ if ((orientation & flags) == 0 || (orientation & flags) == flags) return;
+ style &= ~flags;
+ style |= orientation & flags;
+ style &= ~SWT.FLIP_TEXT_DIRECTION;
+ MenuItem [] itms = getItems ();
+ for (int i=0; i<itms.length; i++) {
+ itms [i].setOrientation (orientation);
+ }
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MenuItem.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MenuItem.java
index 97138d6755..e29920f5dc 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MenuItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MenuItem.java
@@ -913,13 +913,13 @@ boolean setRadioSelection (boolean value) {
}
void setOrientation (int orientation) {
- long /*int*/ hMenu = parent.handle;
- MENUITEMINFO info = new MENUITEMINFO ();
- info.cbSize = MENUITEMINFO.sizeof;
- info.fMask = OS.MIIM_FTYPE;
- info.fType = widgetStyle ();
- OS.SetMenuItemInfo (hMenu, id, false, info);
- if (menu != null) menu._setOrientation (orientation);
+ long /*int*/ hMenu = parent.handle;
+ MENUITEMINFO info = new MENUITEMINFO ();
+ info.cbSize = MENUITEMINFO.sizeof;
+ info.fMask = OS.MIIM_FTYPE;
+ info.fType = widgetStyle ();
+ OS.SetMenuItemInfo (hMenu, id, false, info);
+ if (menu != null) menu._setOrientation (orientation);
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Sash.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Sash.java
index 959fc05a01..886379ba00 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Sash.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Sash.java
@@ -397,13 +397,13 @@ LRESULT WM_SETCURSOR (long /*int*/ wParam, long /*int*/ lParam) {
LRESULT result = super.WM_SETCURSOR (wParam, lParam);
if (result != null) return result;
int hitTest = (short) OS.LOWORD (lParam);
- if (hitTest == OS.HTCLIENT) {
- long /*int*/ hCursor = 0;
- if ((style & SWT.HORIZONTAL) != 0) {
+ if (hitTest == OS.HTCLIENT) {
+ long /*int*/ hCursor = 0;
+ if ((style & SWT.HORIZONTAL) != 0) {
hCursor = OS.LoadCursor (0, OS.IDC_SIZENS);
- } else {
+ } else {
hCursor = OS.LoadCursor (0, OS.IDC_SIZEWE);
- }
+ }
OS.SetCursor (hCursor);
return LRESULT.ONE;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scale.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scale.java
index 2b78ffd3e4..b5119af1ff 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scale.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scale.java
@@ -475,7 +475,7 @@ LRESULT WM_KEYDOWN (long /*int*/ wParam, long /*int*/ lParam) {
* The fix is to replace VK_LEFT by VK_RIGHT and VK_RIGHT by VK_LEFT
* when the current orientation differs from the orientation used to
* create the control.
- */
+ */
boolean isRTL = (style & SWT.RIGHT_TO_LEFT) != 0;
if (isRTL != createdAsRTL) {
long /*int*/ code = callWindowProc (handle, OS.WM_KEYDOWN, wParam == OS.VK_RIGHT ? OS.VK_LEFT : OS.VK_RIGHT, lParam);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scrollable.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scrollable.java
index 81a335f82d..c82dc1f750 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scrollable.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scrollable.java
@@ -43,7 +43,7 @@ public abstract class Scrollable extends Control {
* The regular expression used to determine the string which should be deleted
* when Ctrl+Bs is hit.
*/
- static final java.util.regex.Pattern CTRL_BS_PATTERN =
+ static final java.util.regex.Pattern CTRL_BS_PATTERN =
java.util.regex.Pattern.compile ("\\r?\\n\\z|[\\p{Punct}]+[\\t ]*\\z|[^\\p{Punct}\\s\\n\\r]*[\\t ]*\\z");
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Slider.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Slider.java
index a3e9d04da7..94b0c0f8e1 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Slider.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Slider.java
@@ -643,29 +643,29 @@ long /*int*/ windowProc () {
@Override
LRESULT WM_KEYDOWN (long /*int*/ wParam, long /*int*/ lParam) {
- LRESULT result = super.WM_KEYDOWN (wParam, lParam);
- if (result != null) return result;
- if ((style & SWT.VERTICAL) != 0) return result;
- /*
- * Bug in Windows. When a horizontal scroll bar is mirrored,
- * the native control does not correctly swap the arrow keys.
- * The fix is to swap them before calling the scroll bar window
- * proc.
- *
- * NOTE: This fix is not ideal. It breaks when the bug is fixed
- * in the operating system.
- */
+ LRESULT result = super.WM_KEYDOWN (wParam, lParam);
+ if (result != null) return result;
+ if ((style & SWT.VERTICAL) != 0) return result;
+ /*
+ * Bug in Windows. When a horizontal scroll bar is mirrored,
+ * the native control does not correctly swap the arrow keys.
+ * The fix is to swap them before calling the scroll bar window
+ * proc.
+ *
+ * NOTE: This fix is not ideal. It breaks when the bug is fixed
+ * in the operating system.
+ */
if ((style & SWT.MIRRORED) != 0) {
- switch ((int)/*64*/wParam) {
- case OS.VK_LEFT:
+ switch ((int)/*64*/wParam) {
+ case OS.VK_LEFT:
case OS.VK_RIGHT: {
int key = wParam == OS.VK_LEFT ? OS.VK_RIGHT : OS.VK_LEFT;
long /*int*/ code = callWindowProc (handle, OS.WM_KEYDOWN, key, lParam);
- return new LRESULT (code);
- }
- }
+ return new LRESULT (code);
+ }
+ }
}
- return result;
+ return result;
}
@Override
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Spinner.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Spinner.java
index 1c5c4cb0b0..5fff0cf3c2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Spinner.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Spinner.java
@@ -153,15 +153,15 @@ void createHandle () {
if ((style & SWT.READ_ONLY) != 0) textStyle |= OS.ES_READONLY;
if ((style & SWT.RIGHT_TO_LEFT) != 0) textExStyle |= OS.WS_EX_LAYOUTRTL;
hwndText = OS.CreateWindowEx (
- textExStyle,
- EditClass,
- null,
- textStyle,
- 0, 0, 0, 0,
- handle,
- 0,
- hInstance,
- null);
+ textExStyle,
+ EditClass,
+ null,
+ textStyle,
+ 0, 0, 0, 0,
+ handle,
+ 0,
+ hInstance,
+ null);
if (hwndText == 0) error (SWT.ERROR_NO_HANDLES);
OS.SetWindowLongPtr (hwndText, OS.GWLP_ID, hwndText);
int upDownStyle = OS.WS_CHILD | OS.WS_VISIBLE | OS.UDS_AUTOBUDDY;
@@ -174,15 +174,15 @@ void createHandle () {
}
}
hwndUpDown = OS.CreateWindowEx (
- 0,
- UpDownClass,
- null,
- upDownStyle,
- 0, 0, 0, 0,
- handle,
- 0,
- hInstance,
- null);
+ 0,
+ UpDownClass,
+ null,
+ upDownStyle,
+ 0, 0, 0, 0,
+ handle,
+ 0,
+ hInstance,
+ null);
if (hwndUpDown == 0) error (SWT.ERROR_NO_HANDLES);
int flags = OS.SWP_NOSIZE | OS.SWP_NOMOVE | OS.SWP_NOACTIVATE;
OS.SetWindowPos (hwndText, hwndUpDown, 0, 0, 0, 0, flags);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TabFolder.java
index ea336bef0c..adbae64c5e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TabFolder.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TabFolder.java
@@ -922,7 +922,7 @@ LRESULT WM_KEYDOWN (long /*int*/ wParam, long /*int*/ lParam) {
* The fix is to replace VK_LEFT by VK_RIGHT and VK_RIGHT by VK_LEFT
* when the current orientation differs from the orientation used to
* create the control.
- */
+ */
boolean isRTL = (style & SWT.RIGHT_TO_LEFT) != 0;
if (isRTL != createdAsRTL) {
long /*int*/ code = callWindowProc (handle, OS.WM_KEYDOWN, wParam == OS.VK_RIGHT ? OS.VK_LEFT : OS.VK_RIGHT, lParam);
@@ -1022,7 +1022,7 @@ LRESULT WM_PARENTNOTIFY (long /*int*/ wParam, long /*int*/ lParam) {
switch (code) {
case OS.WM_CREATE: {
int id = OS.HIWORD (wParam);
- long /*int*/ hwnd = lParam;
+ long /*int*/ hwnd = lParam;
if (id == ID_UPDOWN) {
int bits = OS.GetWindowLong (hwnd, OS.GWL_EXSTYLE);
OS.SetWindowLong (hwnd, OS.GWL_EXSTYLE, bits | OS.WS_EX_LAYOUTRTL);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
index 90f908fd0b..4cf3fba318 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
@@ -288,26 +288,26 @@ TableItem _getItem (int index, boolean create, int count) {
if ((style & SWT.VIRTUAL) == 0 || !create) {
return keyIndex < 0 ? null : items [keyIndex];
}
- if (keyIndex < 0) {
- if (count == -1) {
- count = (int)/*64*/OS.SendMessage (handle, OS.LVM_GETITEMCOUNT, 0, 0);
- }
- //TODO - _checkGrow() doesn't return a value, check keys == null instead
- if (_checkGrow (count)) {
- if (items [index] != null) return items [index];
- return items [index] = new TableItem (this, SWT.NONE, -1, false);
- }
- keyIndex = -keyIndex - 1;
- if (keyIndex < keyCount) {
- System.arraycopy(keys, keyIndex, keys, keyIndex + 1, keyCount - keyIndex);
- System.arraycopy(items, keyIndex, items, keyIndex + 1, keyCount - keyIndex);
- }
- keyCount++;
- keys [keyIndex] = index;
- } else {
- if (items [keyIndex] != null) return items [keyIndex];
- }
- return items [keyIndex] = new TableItem (this, SWT.NONE, -1, false);
+ if (keyIndex < 0) {
+ if (count == -1) {
+ count = (int)/*64*/OS.SendMessage (handle, OS.LVM_GETITEMCOUNT, 0, 0);
+ }
+ //TODO - _checkGrow() doesn't return a value, check keys == null instead
+ if (_checkGrow (count)) {
+ if (items [index] != null) return items [index];
+ return items [index] = new TableItem (this, SWT.NONE, -1, false);
+ }
+ keyIndex = -keyIndex - 1;
+ if (keyIndex < keyCount) {
+ System.arraycopy(keys, keyIndex, keys, keyIndex + 1, keyCount - keyIndex);
+ System.arraycopy(items, keyIndex, items, keyIndex + 1, keyCount - keyIndex);
+ }
+ keyCount++;
+ keys [keyIndex] = index;
+ } else {
+ if (items [keyIndex] != null) return items [keyIndex];
+ }
+ return items [keyIndex] = new TableItem (this, SWT.NONE, -1, false);
}
}
@@ -344,13 +344,13 @@ void _insertItem (int index, TableItem item, int count) {
items [index] = item;
} else {
int keyIndex = binarySearch (keys, 0, keyCount, index);
- if (keyIndex < 0) keyIndex = -keyIndex - 1;
- System.arraycopy(keys, keyIndex, keys, keyIndex + 1, keyCount - keyIndex);
- keys [keyIndex] = index;
- System.arraycopy(items, keyIndex, items, keyIndex + 1, keyCount - keyIndex);
- items [keyIndex] = item;
- keyCount++;
- for (int i=keyIndex + 1; i<keyCount; i++) keys[i]++;
+ if (keyIndex < 0) keyIndex = -keyIndex - 1;
+ System.arraycopy(keys, keyIndex, keys, keyIndex + 1, keyCount - keyIndex);
+ keys [keyIndex] = index;
+ System.arraycopy(items, keyIndex, items, keyIndex + 1, keyCount - keyIndex);
+ items [keyIndex] = item;
+ keyCount++;
+ for (int i=keyIndex + 1; i<keyCount; i++) keys[i]++;
}
}
@@ -360,16 +360,16 @@ void _removeItem (int index, int count) {
items [count] = null;
} else {
int keyIndex = binarySearch (keys, 0, keyCount, index);
- if (keyIndex < 0) {
- keyIndex = -keyIndex - 1;
- } else {
- --keyCount;
- System.arraycopy (keys, keyIndex + 1, keys, keyIndex, keyCount - keyIndex);
- keys [keyCount] = 0;
- System.arraycopy (items, keyIndex + 1, items, keyIndex, keyCount - keyIndex);
- items [keyCount] = null;
- }
- for (int i=keyIndex; i<keyCount; i++) --keys[i];
+ if (keyIndex < 0) {
+ keyIndex = -keyIndex - 1;
+ } else {
+ --keyCount;
+ System.arraycopy (keys, keyIndex + 1, keys, keyIndex, keyCount - keyIndex);
+ keys [keyCount] = 0;
+ System.arraycopy (items, keyIndex + 1, items, keyIndex, keyCount - keyIndex);
+ items [keyCount] = null;
+ }
+ for (int i=keyIndex; i<keyCount; i++) --keys[i];
}
}
@@ -403,9 +403,9 @@ void _setItemCount (int count, int itemCount) {
} else {
int index = Math.min (count, itemCount);
keyCount = binarySearch (keys, 0, keyCount, index);
- if (keyCount < 0) keyCount = -keyCount - 1;
- int length = Math.max (4, (keyCount + 3) / 4 * 4);
- int [] newKeys = new int [length];
+ if (keyCount < 0) keyCount = -keyCount - 1;
+ int length = Math.max (4, (keyCount + 3) / 4 * 4);
+ int [] newKeys = new int [length];
System.arraycopy (keys, 0, newKeys, 0, keyCount);
keys = newKeys;
TableItem [] newItems = new TableItem [length];
@@ -3278,8 +3278,8 @@ public void select (int [] indices) {
for (int i=length-1; i>=0; --i) {
/*
* An index of -1 will apply the change to all
- * items. Ensure that indices are greater than -1.
- */
+ * items. Ensure that indices are greater than -1.
+ */
if (indices [i] >= 0) {
ignoreSelect = true;
OS.SendMessage (handle, OS.LVM_SETITEMSTATE, indices [i], lvItem);
@@ -5600,7 +5600,7 @@ void updateOrientation () {
imageList = display.getImageList (style & SWT.RIGHT_TO_LEFT, size.x, size.y);
int count = (int)/*64*/OS.SendMessage (handle, OS.LVM_GETITEMCOUNT, 0, 0);
for (int i = 0; i < count; i++) {
- TableItem item = _getItem (i, false);
+ TableItem item = _getItem (i, false);
if (item != null) {
Image image = item.image;
if (image != null) {
@@ -7070,7 +7070,7 @@ LRESULT wmNotifyHeader (NMHDR hdr, long /*int*/ wParam, long /*int*/ lParam) {
OS.SendMessage (handle, OS.LVM_GETCOLUMNORDERARRAY, columnCount, order);
int index = 0;
while (index < order.length) {
- if (order [index] == phdn.iItem) break;
+ if (order [index] == phdn.iItem) break;
index++;
}
if (index == order.length) index = 0;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java
index 336ded9566..68a1eff19a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java
@@ -2651,8 +2651,8 @@ LRESULT WM_CHAR (long /*int*/ wParam, long /*int*/ lParam) {
int x = selection.x;
int y = selection.y;
if (x == y) {
- String actText = getText (0, x - 1);
- java.util.regex.Matcher m = CTRL_BS_PATTERN.matcher (actText);
+ String actText = getText (0, x - 1);
+ java.util.regex.Matcher m = CTRL_BS_PATTERN.matcher (actText);
if (m.find ()) {
x = m.start ();
y = m.end ();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tracker.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tracker.java
index 49d85ecd1d..1727a13bed 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tracker.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tracker.java
@@ -207,7 +207,7 @@ Point adjustMoveCursor () {
pt.x = newX; pt.y = newY;
/*
* Convert to screen coordinates iff needed
- */
+ */
if (parent != null) {
OS.ClientToScreen (parent.handle, pt);
}
@@ -1139,9 +1139,9 @@ LRESULT wmMouse (int message, long /*int*/ wParam, long /*int*/ lParam) {
event.setLocationInPixels(newX, newY);
if ((style & SWT.RESIZE) != 0) {
if (isMirrored) {
- resizeRectangles (oldX - newX, newY - oldY);
+ resizeRectangles (oldX - newX, newY - oldY);
} else {
- resizeRectangles (newX - oldX, newY - oldY);
+ resizeRectangles (newX - oldX, newY - oldY);
}
inEvent = true;
sendEvent (SWT.Resize, event);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
index 877edcd18d..a03c5bd9a8 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
@@ -6102,13 +6102,13 @@ LRESULT WM_KEYDOWN (long /*int*/ wParam, long /*int*/ lParam) {
* The fix is to replace VK_LEFT by VK_RIGHT and VK_RIGHT by VK_LEFT
* when the current orientation differs from the orientation used to
* create the control.
- */
- boolean isRTL = (style & SWT.RIGHT_TO_LEFT) != 0;
- if (isRTL != createdAsRTL) {
- long /*int*/ code = callWindowProc (handle, OS.WM_KEYDOWN, wParam == OS.VK_RIGHT ? OS.VK_LEFT : OS.VK_RIGHT, lParam);
- return new LRESULT (code);
- }
- break;
+ */
+ boolean isRTL = (style & SWT.RIGHT_TO_LEFT) != 0;
+ if (isRTL != createdAsRTL) {
+ long /*int*/ code = callWindowProc (handle, OS.WM_KEYDOWN, wParam == OS.VK_RIGHT ? OS.VK_LEFT : OS.VK_RIGHT, lParam);
+ return new LRESULT (code);
+ }
+ break;
case OS.VK_SPACE:
/*
* Ensure that the window proc does not process VK_SPACE
@@ -7816,7 +7816,7 @@ LRESULT wmNotifyHeader (NMHDR hdr, long /*int*/ wParam, long /*int*/ lParam) {
OS.SendMessage (hwndHeader, OS.HDM_GETORDERARRAY, columnCount, order);
int index = 0;
while (index < order.length) {
- if (order [index] == phdn.iItem) break;
+ if (order [index] == phdn.iItem) break;
index++;
}
if (index == order.length) index = 0;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeItem.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeItem.java
index 1dd27b6dd0..54aaebb7b7 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeItem.java
@@ -1235,7 +1235,7 @@ public void setExpanded (boolean expanded) {
RECT [] rects = null;
SCROLLINFO oldInfo = null;
int count = 0;
- long /*int*/ hBottomItem = 0;
+ long /*int*/ hBottomItem = 0;
boolean redraw = false, noScroll = true;
long /*int*/ hTopItem = OS.SendMessage (hwnd, OS.TVM_GETNEXTITEM, OS.TVGN_FIRSTVISIBLE, 0);
if (noScroll && hTopItem != 0) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java
index d8b2584dcb..1b2e9c5195 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java
@@ -1677,7 +1677,7 @@ LRESULT wmKeyDown (long /*int*/ hwnd, long /*int*/ wParam, long /*int*/ lParam)
* upper case values in WM_KEYDOWN despite the fact that the
* Shift was not pressed.
*/
- display.lastKey = (int)/*64*/OS.CharLower ((short) mapKey);
+ display.lastKey = (int)/*64*/OS.CharLower ((short) mapKey);
/*
* Feature in Windows. The virtual key VK_CANCEL is treated
@@ -1732,12 +1732,12 @@ LRESULT wmKeyDown (long /*int*/ hwnd, long /*int*/ wParam, long /*int*/ lParam)
* If the user types Ctrl+Shift+6, the value of LastAscii will
* depend on the international keyboard.
*/
- if (OS.GetKeyState (OS.VK_SHIFT) < 0) {
+ if (OS.GetKeyState (OS.VK_SHIFT) < 0) {
display.lastAscii = display.shiftedKey ((int)/*64*/wParam);
if (display.lastAscii == 0) display.lastAscii = mapKey;
- } else {
- display.lastAscii = (int)/*64*/OS.CharLower ((short) mapKey);
- }
+ } else {
+ display.lastAscii = (int)/*64*/OS.CharLower ((short) mapKey);
+ }
/* Note that Ctrl+'@' is ASCII NUL and is delivered in WM_CHAR */
if (display.lastAscii == '@') return null;
@@ -2318,7 +2318,7 @@ LRESULT wmSysKeyDown (long /*int*/ hwnd, long /*int*/ wParam, long /*int*/ lPara
display.lastVirtual = mapKey == 0 || display.numpadKey ((int)/*64*/wParam) != 0;
if (display.lastVirtual) {
- display.lastKey = (int)/*64*/wParam;
+ display.lastKey = (int)/*64*/wParam;
/*
* Feature in Windows. The virtual key VK_DELETE is not
* treated as both a virtual key and an ASCII key by Windows.
@@ -2355,7 +2355,7 @@ LRESULT wmSysKeyDown (long /*int*/ hwnd, long /*int*/ wParam, long /*int*/ lPara
* upper case values in WM_SYSKEYDOWN despite the fact that the
* Shift was not pressed.
*/
- display.lastKey = (int)/*64*/OS.CharLower ((short) mapKey);
+ display.lastKey = (int)/*64*/OS.CharLower ((short) mapKey);
return null;
}
diff --git a/examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/LauncherPlugin.java b/examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/LauncherPlugin.java
index 579af02866..8d98dce347 100644
--- a/examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/LauncherPlugin.java
+++ b/examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/LauncherPlugin.java
@@ -79,12 +79,12 @@ public class LauncherPlugin extends AbstractUIPlugin {
plugin = this;
}
- @Override
+ @Override
public void start(BundleContext context) throws Exception {
- super.start(context);
- resourceBundle = Platform.getResourceBundle(getBundle());
- }
-
+ super.start(context);
+ resourceBundle = Platform.getResourceBundle(getBundle());
+ }
+
/**
* Clean up
*/
@@ -173,9 +173,9 @@ public class LauncherPlugin extends AbstractUIPlugin {
}
/**
- * Constructs a list of available programs from registered extensions.
- *
- * @return an ItemTreeNode representing the root of a tree of items (the root is not to be displayed)
+ * Constructs a list of available programs from registered extensions.
+ *
+ * @return an ItemTreeNode representing the root of a tree of items (the root is not to be displayed)
*/
public static ItemTreeNode getLaunchItemTree() {
ItemTreeNode categoryTree =
diff --git a/examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OLEExample.java b/examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OLEExample.java
index 409c43d3a5..0e7ea33c97 100644
--- a/examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OLEExample.java
+++ b/examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OLEExample.java
@@ -182,18 +182,18 @@ public class OLEExample {
try {
clientSite = createSite(oleFrame, "PDF.PdfCtrl.5");
clientSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE);
- OleAutomation pdf = new OleAutomation (clientSite);
- int loadFile[] = pdf.getIDsOfNames (new String [] {"LoadFile"});
- if (loadFile != null) {
- Variant result = pdf.invoke(loadFile[0], new Variant[] {new Variant(fileName)});
+ OleAutomation pdf = new OleAutomation (clientSite);
+ int loadFile[] = pdf.getIDsOfNames (new String [] {"LoadFile"});
+ if (loadFile != null) {
+ Variant result = pdf.invoke(loadFile[0], new Variant[] {new Variant(fileName)});
if (result == null)
disposeClient();
else
result.dispose();
- } else {
+ } else {
disposeClient();
- }
- pdf.dispose();
+ }
+ pdf.dispose();
} catch (SWTException error2) {
disposeClient();
}
diff --git a/examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OleBrowserView.java b/examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OleBrowserView.java
index afe7d9c6d4..da0828d52f 100644
--- a/examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OleBrowserView.java
+++ b/examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OleBrowserView.java
@@ -336,10 +336,10 @@ public class OleBrowserView extends ViewPart {
switch (commandID) {
case OleWebBrowser.CSC_NAVIGATEBACK:
- webCommandBackward.setEnabled(commandEnabled);
- break;
+ webCommandBackward.setEnabled(commandEnabled);
+ break;
case OleWebBrowser.CSC_NAVIGATEFORWARD:
- webCommandForward.setEnabled(commandEnabled);
+ webCommandForward.setEnabled(commandEnabled);
break;
}
});
diff --git a/examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OlePlugin.java b/examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OlePlugin.java
index a3cb1897c8..52f20cd99b 100644
--- a/examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OlePlugin.java
+++ b/examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OlePlugin.java
@@ -49,7 +49,7 @@ public class OlePlugin extends AbstractUIPlugin {
"icons/search_nav.gif" };
static Image images[];
static Font browserFont;
-
+
/**
* Constructs an OLE plugin.
*/
@@ -58,12 +58,12 @@ public class OlePlugin extends AbstractUIPlugin {
plugin = this;
}
- @Override
+ @Override
public void start(BundleContext context) throws Exception {
- super.start(context);
- resourceBundle = Platform.getResourceBundle(getBundle());
- }
-
+ super.start(context);
+ resourceBundle = Platform.getResourceBundle(getBundle());
+ }
+
/**
* Clean up
*/
diff --git a/examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OleWebBrowser.java b/examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OleWebBrowser.java
index a70797716c..52931b9d48 100644
--- a/examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OleWebBrowser.java
+++ b/examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OleWebBrowser.java
@@ -75,8 +75,8 @@ class OleWebBrowser {
* OleWebBrowser webBrowser = new OleWebBrowser(oleControlSite, oleAutomation);<br>
* </code>
*
- * @param oleAutomation the OleAutomation object for this control.
- * @param oleControlSite the OleControlSite object for this control.
+ * @param oleAutomation the OleAutomation object for this control.
+ * @param oleControlSite the OleControlSite object for this control.
*/
public OleWebBrowser(OleAutomation oleAutomation) {
this.oleAutomation = oleAutomation;
@@ -98,7 +98,7 @@ class OleWebBrowser {
* this is of course the fastest way, but you increase coupling
* to the control.
*/
-
+
/**
* Returns the current web page title.
*
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTable.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTable.java
index 1b5f23322e..56b64d1145 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTable.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTable.java
@@ -889,9 +889,9 @@ public Control[] getChildren () {
/* remove the Header from the returned set of children */
int index = 0;
for (Control control : controls) {
- if (control != header) {
- result [index++] = control;
- }
+ if (control != header) {
+ result [index++] = control;
+ }
}
return result;
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableColumn.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableColumn.java
index 2f76f9a612..07af3a09c7 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableColumn.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableColumn.java
@@ -852,7 +852,7 @@ Accessible getAccessible(final Accessible accessibleTable) {
}
@Override
public void getRowHeaders(AccessibleTableCellEvent e) {
- /* CTable does not support row headers. */
+ /* CTable does not support row headers. */
}
@Override
public void getRowIndex(AccessibleTableCellEvent e) {
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableItem.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableItem.java
index a2e43502aa..9d492249a5 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableItem.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableItem.java
@@ -508,7 +508,7 @@ Accessible getAccessible(final Accessible accessibleTable, final int columnIndex
}
@Override
public void getRowHeaders(AccessibleTableCellEvent e) {
- /* CTable does not support row headers. */
+ /* CTable does not support row headers. */
}
@Override
public void getRowIndex(AccessibleTableCellEvent e) {
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/ControlsWithAccessibleNamesExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/ControlsWithAccessibleNamesExample.java
index ac1e79463f..56e3f9113c 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/ControlsWithAccessibleNamesExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/ControlsWithAccessibleNamesExample.java
@@ -372,12 +372,12 @@ public class ControlsWithAccessibleNamesExample {
item.setToolTipText("ToolItem ToolTip" + i + j);
if (item.getWidth() > toolItemWidth) toolItemWidth = item.getWidth();
}
- coolItem.setControl(coolItemToolBar);
- Point size = coolItemToolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- Point coolSize = coolItem.computeSize (size.x, size.y);
- coolItem.setMinimumSize(toolItemWidth, coolSize.y);
- coolItem.setPreferredSize(coolSize);
- coolItem.setSize(coolSize);
+ coolItem.setControl(coolItemToolBar);
+ Point size = coolItemToolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ Point coolSize = coolItem.computeSize (size.x, size.y);
+ coolItem.setMinimumSize(toolItemWidth, coolSize.y);
+ coolItem.setPreferredSize(coolSize);
+ coolItem.setSize(coolSize);
}
overrideCoolBar = new CoolBar(shell, SWT.FLAT);
@@ -391,12 +391,12 @@ public class ControlsWithAccessibleNamesExample {
item.setToolTipText("ToolItem ToolTip" + i + j);
if (item.getWidth() > toolItemWidth) toolItemWidth = item.getWidth();
}
- coolItem.setControl(coolItemToolBar);
- Point size = coolItemToolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- Point coolSize = coolItem.computeSize (size.x, size.y);
- coolItem.setMinimumSize(toolItemWidth, coolSize.y);
- coolItem.setPreferredSize(coolSize);
- coolItem.setSize(coolSize);
+ coolItem.setControl(coolItemToolBar);
+ Point size = coolItemToolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ Point coolSize = coolItem.computeSize (size.x, size.y);
+ coolItem.setMinimumSize(toolItemWidth, coolSize.y);
+ coolItem.setPreferredSize(coolSize);
+ coolItem.setSize(coolSize);
}
overrideCoolBar.setData("name", "CoolBar");
overrideCoolBar.setData("child", "CoolBar Item");
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ColorTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ColorTab.java
index 187f5aa47d..0fa1c6ad30 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ColorTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ColorTab.java
@@ -38,9 +38,9 @@ class ColorTab extends Tab {
HashMap <Integer, String> hmap = new HashMap <> ();
static final int namedColorEnd = 8;
static String [] columnTitles = {ControlExample.getResourceString("ColorTitle_0"),
- ControlExample.getResourceString("ColorTitle_1"),
- ControlExample.getResourceString("ColorTitle_2"),
- ControlExample.getResourceString("ColorTitle_3")};
+ ControlExample.getResourceString("ColorTitle_1"),
+ ControlExample.getResourceString("ColorTitle_2"),
+ ControlExample.getResourceString("ColorTitle_3")};
/* Size widgets added to the "Size" group */
Button packColumnsButton;
@@ -54,34 +54,34 @@ class ColorTab extends Tab {
}
void addTableElements () {
- hmap.put(SWT.COLOR_WHITE, "COLOR_WHITE");
- hmap.put(SWT.COLOR_BLACK, "COLOR_BLACK");
- hmap.put(SWT.COLOR_RED, "COLOR_RED");
- hmap.put(SWT.COLOR_DARK_RED, "COLOR_DARK_RED");
- hmap.put(SWT.COLOR_GREEN, "COLOR_GREEN");
- hmap.put(SWT.COLOR_DARK_GREEN, "COLOR_DARK_GREEN");
- hmap.put(SWT.COLOR_YELLOW, "COLOR_YELLOW");
- hmap.put(SWT.COLOR_DARK_YELLOW, "COLOR_DARK_YELLOW");
- hmap.put(SWT.COLOR_WIDGET_DARK_SHADOW, "COLOR_WIDGET_DARK_SHADOW");
- hmap.put(SWT.COLOR_WIDGET_NORMAL_SHADOW, "COLOR_WIDGET_NORMAL_SHADOW");
- hmap.put(SWT.COLOR_WIDGET_LIGHT_SHADOW, "COLOR_WIDGET_LIGHT_SHADOW");
- hmap.put(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW, "COLOR_WIDGET_HIGHLIGHT_SHADOW");
- hmap.put(SWT.COLOR_WIDGET_FOREGROUND, "COLOR_WIDGET_FOREGROUND");
- hmap.put(SWT.COLOR_WIDGET_BACKGROUND, "COLOR_WIDGET_BACKGROUND");
- hmap.put(SWT.COLOR_WIDGET_BORDER, "COLOR_WIDGET_BORDER");
- hmap.put(SWT.COLOR_LIST_FOREGROUND, "COLOR_LIST_FOREGROUND");
- hmap.put(SWT.COLOR_LIST_BACKGROUND, "COLOR_LIST_BACKGROUND");
- hmap.put(SWT.COLOR_LIST_SELECTION, "COLOR_LIST_SELECTION");
- hmap.put(SWT.COLOR_LIST_SELECTION_TEXT, "COLOR_LIST_SELECTION_TEXT");
- hmap.put(SWT.COLOR_INFO_FOREGROUND, "COLOR_INFO_FOREGROUND");
- hmap.put(SWT.COLOR_INFO_BACKGROUND, "COLOR_INFO_BACKGROUND");
- hmap.put(SWT.COLOR_TITLE_FOREGROUND, "COLOR_TITLE_FOREGROUND");
- hmap.put(SWT.COLOR_TITLE_BACKGROUND, "COLOR_TITLE_BACKGROUND");
- hmap.put(SWT.COLOR_TITLE_BACKGROUND_GRADIENT, "COLOR_TITLE_BACKGROUND_GRADIENT");
- hmap.put(SWT.COLOR_TITLE_INACTIVE_FOREGROUND, "COLOR_TITLE_INACTIVE_FOREGROUND");
- hmap.put(SWT.COLOR_TITLE_INACTIVE_BACKGROUND, "COLOR_TITLE_INACTIVE_BACKGROUND");
- hmap.put(SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT, "COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT");
- hmap.put(SWT.COLOR_LINK_FOREGROUND, "COLOR_LINK_FOREGROUND");
+ hmap.put(SWT.COLOR_WHITE, "COLOR_WHITE");
+ hmap.put(SWT.COLOR_BLACK, "COLOR_BLACK");
+ hmap.put(SWT.COLOR_RED, "COLOR_RED");
+ hmap.put(SWT.COLOR_DARK_RED, "COLOR_DARK_RED");
+ hmap.put(SWT.COLOR_GREEN, "COLOR_GREEN");
+ hmap.put(SWT.COLOR_DARK_GREEN, "COLOR_DARK_GREEN");
+ hmap.put(SWT.COLOR_YELLOW, "COLOR_YELLOW");
+ hmap.put(SWT.COLOR_DARK_YELLOW, "COLOR_DARK_YELLOW");
+ hmap.put(SWT.COLOR_WIDGET_DARK_SHADOW, "COLOR_WIDGET_DARK_SHADOW");
+ hmap.put(SWT.COLOR_WIDGET_NORMAL_SHADOW, "COLOR_WIDGET_NORMAL_SHADOW");
+ hmap.put(SWT.COLOR_WIDGET_LIGHT_SHADOW, "COLOR_WIDGET_LIGHT_SHADOW");
+ hmap.put(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW, "COLOR_WIDGET_HIGHLIGHT_SHADOW");
+ hmap.put(SWT.COLOR_WIDGET_FOREGROUND, "COLOR_WIDGET_FOREGROUND");
+ hmap.put(SWT.COLOR_WIDGET_BACKGROUND, "COLOR_WIDGET_BACKGROUND");
+ hmap.put(SWT.COLOR_WIDGET_BORDER, "COLOR_WIDGET_BORDER");
+ hmap.put(SWT.COLOR_LIST_FOREGROUND, "COLOR_LIST_FOREGROUND");
+ hmap.put(SWT.COLOR_LIST_BACKGROUND, "COLOR_LIST_BACKGROUND");
+ hmap.put(SWT.COLOR_LIST_SELECTION, "COLOR_LIST_SELECTION");
+ hmap.put(SWT.COLOR_LIST_SELECTION_TEXT, "COLOR_LIST_SELECTION_TEXT");
+ hmap.put(SWT.COLOR_INFO_FOREGROUND, "COLOR_INFO_FOREGROUND");
+ hmap.put(SWT.COLOR_INFO_BACKGROUND, "COLOR_INFO_BACKGROUND");
+ hmap.put(SWT.COLOR_TITLE_FOREGROUND, "COLOR_TITLE_FOREGROUND");
+ hmap.put(SWT.COLOR_TITLE_BACKGROUND, "COLOR_TITLE_BACKGROUND");
+ hmap.put(SWT.COLOR_TITLE_BACKGROUND_GRADIENT, "COLOR_TITLE_BACKGROUND_GRADIENT");
+ hmap.put(SWT.COLOR_TITLE_INACTIVE_FOREGROUND, "COLOR_TITLE_INACTIVE_FOREGROUND");
+ hmap.put(SWT.COLOR_TITLE_INACTIVE_BACKGROUND, "COLOR_TITLE_INACTIVE_BACKGROUND");
+ hmap.put(SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT, "COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT");
+ hmap.put(SWT.COLOR_LINK_FOREGROUND, "COLOR_LINK_FOREGROUND");
}
/**
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java
index a200a54f58..9d7ae24bd9 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java
@@ -67,9 +67,9 @@ public class ControlExample {
tabs = createTabs();
for (Tab tab : tabs) {
TabItem item = new TabItem (tabFolder, SWT.NONE);
- item.setText (tab.getTabText ());
- item.setControl (tab.createTabFolderPage (tabFolder));
- item.setData (tab);
+ item.setText (tab.getTabText ());
+ item.setControl (tab.createTabFolderPage (tabFolder));
+ item.setData (tab);
}
/* Workaround: if the tab folder is wider than the screen,
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CoolBarTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CoolBarTab.java
index b6c008a295..d9642c8008 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CoolBarTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CoolBarTab.java
@@ -448,9 +448,9 @@ class CoolBarTab extends Tab {
pt = toolBar.toDisplay(new Point(toolBounds.x, toolBounds.y));
toolBounds.x = pt.x;
toolBounds.y = pt.y;
- Rectangle intersection = itemBounds.intersection (toolBounds);
- if (!intersection.equals (toolBounds)) break;
- i++;
+ Rectangle intersection = itemBounds.intersection (toolBounds);
+ if (!intersection.equals (toolBounds)) break;
+ i++;
}
/* Create a pop-up menu with items for each of the hidden buttons. */
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/Tab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/Tab.java
index 0c0fa3f036..702c092a9f 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/Tab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/Tab.java
@@ -1280,10 +1280,10 @@ abstract class Tab {
}
if (menu == null && popupMenuButton.getSelection()) {
menu = new Menu(shell, SWT.POP_UP | (control.getStyle() & (SWT.RIGHT_TO_LEFT | SWT.LEFT_TO_RIGHT)));
- MenuItem item = new MenuItem(menu, SWT.PUSH);
- item.setText("Sample popup menu item");
- specialPopupMenuItems(menu, event);
- control.setMenu(menu);
+ MenuItem item = new MenuItem(menu, SWT.PUSH);
+ item.setText("Sample popup menu item");
+ specialPopupMenuItems(menu, event);
+ control.setMenu(menu);
samplePopup = true;
}
});
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TableTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TableTab.java
index 040721f61a..061c0bf250 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TableTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TableTab.java
@@ -739,10 +739,10 @@ class TableTab extends ScrollableTab {
@Override
protected void specialPopupMenuItems(Menu menu, Event event) {
- MenuItem item = new MenuItem(menu, SWT.PUSH);
- item.setText("getItem(Point) on mouse coordinates");
- menuMouseCoords = table1.toControl(new Point(event.x, event.y));
- item.addSelectionListener(widgetSelectedAdapter(e -> {
+ MenuItem item = new MenuItem(menu, SWT.PUSH);
+ item.setText("getItem(Point) on mouse coordinates");
+ menuMouseCoords = table1.toControl(new Point(event.x, event.y));
+ item.addSelectionListener(widgetSelectedAdapter(e -> {
eventConsole.append ("getItem(Point(" + menuMouseCoords + ")) returned: " + table1.getItem(menuMouseCoords));
eventConsole.append ("\n");
}));
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TreeTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TreeTab.java
index 6536521f66..f8046568fa 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TreeTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TreeTab.java
@@ -66,9 +66,9 @@ class TreeTab extends ScrollableTab {
Font itemFont, cellFont;
static String [] columnTitles = {ControlExample.getResourceString("TableTitle_0"),
- ControlExample.getResourceString("TableTitle_1"),
- ControlExample.getResourceString("TableTitle_2"),
- ControlExample.getResourceString("TableTitle_3")};
+ ControlExample.getResourceString("TableTitle_1"),
+ ControlExample.getResourceString("TableTitle_2"),
+ ControlExample.getResourceString("TableTitle_3")};
static String[][] tableData = {
{ ControlExample.getResourceString("TableLine0_0"),
@@ -535,7 +535,7 @@ class TreeTab extends ScrollableTab {
}
/* Set the header background color item's image to match the header background color. */
Color color = headerBackgroundColor;
- if (color == null) color = tree1.getHeaderBackground();
+ if (color == null) color = tree1.getHeaderBackground();
TableItem item = colorAndFontTable.getItem(HEADER_BACKGROUND_COLOR);
Image oldImage1 = item.getImage();
if (oldImage1 != null) oldImage1.dispose();
@@ -840,11 +840,11 @@ class TreeTab extends ScrollableTab {
@Override
protected void specialPopupMenuItems(Menu menu, Event event) {
- MenuItem item = new MenuItem(menu, SWT.PUSH);
- item.setText("getItem(Point) on mouse coordinates");
- final Tree t = (Tree) event.widget;
- menuMouseCoords = t.toControl(new Point(event.x, event.y));
- item.addSelectionListener(widgetSelectedAdapter(e -> {
+ MenuItem item = new MenuItem(menu, SWT.PUSH);
+ item.setText("getItem(Point) on mouse coordinates");
+ final Tree t = (Tree) event.widget;
+ menuMouseCoords = t.toControl(new Point(event.x, event.y));
+ item.addSelectionListener(widgetSelectedAdapter(e -> {
eventConsole.append ("getItem(Point(" + menuMouseCoords + ")) returned: " + t.getItem(menuMouseCoords));
eventConsole.append ("\n");
}));
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/dnd/DNDExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/dnd/DNDExample.java
index 49abdeb549..d69916d205 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/dnd/DNDExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/dnd/DNDExample.java
@@ -773,10 +773,10 @@ private void createDropTarget() {
printEvent(event);
String[] strings = null;
if (TextTransfer.getInstance().isSupportedType(event.currentDataType) ||
- RTFTransfer.getInstance().isSupportedType(event.currentDataType) ||
- HTMLTransfer.getInstance().isSupportedType(event.currentDataType) ||
- URLTransfer.getInstance().isSupportedType(event.currentDataType)) {
- strings = new String[] {(String)event.data};
+ RTFTransfer.getInstance().isSupportedType(event.currentDataType) ||
+ HTMLTransfer.getInstance().isSupportedType(event.currentDataType) ||
+ URLTransfer.getInstance().isSupportedType(event.currentDataType)) {
+ strings = new String[] {(String)event.data};
}
if (FileTransfer.getInstance().isSupportedType(event.currentDataType)) {
strings = (String[])event.data;
@@ -787,8 +787,8 @@ private void createDropTarget() {
}
if (strings.length == 1 && (dropControlType == TABLE ||
- dropControlType == TREE ||
- dropControlType == LIST)) {
+ dropControlType == TREE ||
+ dropControlType == LIST)) {
// convert string separated by "\n" into an array of strings
String string = strings[0];
int count = 0;
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/FileViewer.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/FileViewer.java
index 4a9a92f609..ef212e122f 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/FileViewer.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/FileViewer.java
@@ -73,7 +73,7 @@ import org.eclipse.swt.widgets.TreeItem;
* File Viewer example
*/
public class FileViewer {
- private static ResourceBundle resourceBundle = ResourceBundle.getBundle("examples_fileviewer");
+ private static ResourceBundle resourceBundle = ResourceBundle.getBundle("examples_fileviewer");
private final static String DRIVE_A = "a:" + File.separator;
private final static String DRIVE_B = "b:" + File.separator;
@@ -1428,11 +1428,11 @@ public class FileViewer {
for (int i = end; i > start; --i) {
for (int j = end; j > start; --j) {
if (compareFiles(files[j - 1], files[j]) > 0) {
- final File temp = files[j];
- files[j] = files[j-1];
- files[j-1] = temp;
+ final File temp = files[j];
+ files[j] = files[j-1];
+ files[j-1] = temp;
}
- }
+ }
}
return;
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CardsTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CardsTab.java
index 2d75192637..82501ae2e9 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CardsTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CardsTab.java
@@ -91,40 +91,40 @@ public void next(int width, int height) {
scaleWidth = (float) ((movClubY/height)*0.35 + 0.15);
movClubY = 2*height/5 * (float)Math.sin(0.01*movClubX - 90) + 2*height/5;
- movDiamondY = 2*height/5 * (float)Math.cos(0.01*movDiamondX) + 2*height/5;
-
- if (movClubX + clubWidth*scaleWidth > width) {
- movClubX = width - clubWidth*scaleWidth;
- inc_club = -inc_club;
- }
- if (movClubX < 0) {
- movClubX = 0;
- inc_club = -inc_club;
- }
- if (movDiamondX + diamondWidth*scaleWidth > width) {
- movDiamondX = width - diamondWidth*scaleWidth;
- inc_diamond = -inc_diamond;
- }
- if (movDiamondX < 0) {
- movDiamondX = 0;
- inc_diamond = -inc_diamond;
- }
- if (movHeart + heartWidth*heartScale > width) {
- movHeart = width - heartWidth*heartScale;
- inc_hearts = -inc_hearts;
- }
- if (movHeart < 0) {
- movHeart = 0;
- inc_hearts = -inc_hearts;
- }
- if (movSpade + spadeHeight*spadeScale > height) {
- movSpade = height - spadeHeight*spadeScale;
- inc_spade = -inc_spade;
- }
- if (movSpade < 0) {
- movSpade = 0;
- inc_spade = -inc_spade;
- }
+ movDiamondY = 2*height/5 * (float)Math.cos(0.01*movDiamondX) + 2*height/5;
+
+ if (movClubX + clubWidth*scaleWidth > width) {
+ movClubX = width - clubWidth*scaleWidth;
+ inc_club = -inc_club;
+ }
+ if (movClubX < 0) {
+ movClubX = 0;
+ inc_club = -inc_club;
+ }
+ if (movDiamondX + diamondWidth*scaleWidth > width) {
+ movDiamondX = width - diamondWidth*scaleWidth;
+ inc_diamond = -inc_diamond;
+ }
+ if (movDiamondX < 0) {
+ movDiamondX = 0;
+ inc_diamond = -inc_diamond;
+ }
+ if (movHeart + heartWidth*heartScale > width) {
+ movHeart = width - heartWidth*heartScale;
+ inc_hearts = -inc_hearts;
+ }
+ if (movHeart < 0) {
+ movHeart = 0;
+ inc_hearts = -inc_hearts;
+ }
+ if (movSpade + spadeHeight*spadeScale > height) {
+ movSpade = height - spadeHeight*spadeScale;
+ inc_spade = -inc_spade;
+ }
+ if (movSpade < 0) {
+ movSpade = 0;
+ inc_spade = -inc_spade;
+ }
}
@Override
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CustomAlphaTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CustomAlphaTab.java
index 92fc6f634c..f81fd723ac 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CustomAlphaTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CustomAlphaTab.java
@@ -166,6 +166,6 @@ public void paint(GC gc, int width, int height) {
gc.fillPath(path);
path.dispose();
- if (pattern != null) pattern.dispose();
+ if (pattern != null) pattern.dispose();
}
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/FontBounceTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/FontBounceTab.java
index c55c286d7b..27ba6c8c9e 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/FontBounceTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/FontBounceTab.java
@@ -59,49 +59,49 @@ public String getDescription() {
@Override
public void next(int width, int height) {
x += incX;
- y += incY;
+ y += incY;
float random = (float)Math.random();
// collision with right side of screen
- if (x + textWidth > width) {
- x = width - textWidth;
- incX = random * -width / 16 - 1;
- fontFace = 0;
- fontSize = 125;
- fillColor = SWT.COLOR_DARK_BLUE;
- foreGrdColor = SWT.COLOR_YELLOW;
- fontStyle = SWT.ITALIC;
- }
+ if (x + textWidth > width) {
+ x = width - textWidth;
+ incX = random * -width / 16 - 1;
+ fontFace = 0;
+ fontSize = 125;
+ fillColor = SWT.COLOR_DARK_BLUE;
+ foreGrdColor = SWT.COLOR_YELLOW;
+ fontStyle = SWT.ITALIC;
+ }
// collision with left side of screen
- if (x < 0) {
- x = 0;
- incX = random * width / 16 + 1;
- fontFace = 1;
- fontSize = 80;
- fillColor = SWT.COLOR_DARK_MAGENTA;
- foreGrdColor = SWT.COLOR_CYAN;
- fontStyle = SWT.NONE;
- }
+ if (x < 0) {
+ x = 0;
+ incX = random * width / 16 + 1;
+ fontFace = 1;
+ fontSize = 80;
+ fillColor = SWT.COLOR_DARK_MAGENTA;
+ foreGrdColor = SWT.COLOR_CYAN;
+ fontStyle = SWT.NONE;
+ }
// collision with bottom side of screen
- if (y + textHeight > height) {
- y = (height - textHeight)- 2;
- incY = random * -height / 16 - 1;
- fontFace = 2;
- fontSize = 100;
- fillColor = SWT.COLOR_YELLOW;
- foreGrdColor = SWT.COLOR_BLACK;
- fontStyle = SWT.BOLD;
- }
+ if (y + textHeight > height) {
+ y = (height - textHeight)- 2;
+ incY = random * -height / 16 - 1;
+ fontFace = 2;
+ fontSize = 100;
+ fillColor = SWT.COLOR_YELLOW;
+ foreGrdColor = SWT.COLOR_BLACK;
+ fontStyle = SWT.BOLD;
+ }
// collision with top side of screen
- if (y < 0) {
- y = 0;
- incY = random * height / 16 + 1;
- fontFace = 3;
- fontSize = 120;
- fillColor = SWT.COLOR_GREEN;
- foreGrdColor = SWT.COLOR_GRAY;
- fontStyle = SWT.NONE;
- }
+ if (y < 0) {
+ y = 0;
+ incY = random * height / 16 + 1;
+ fontFace = 3;
+ fontSize = 120;
+ fillColor = SWT.COLOR_GREEN;
+ foreGrdColor = SWT.COLOR_GRAY;
+ fontStyle = SWT.NONE;
+ }
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GradientDialog.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GradientDialog.java
index a1c6d45a35..ea18fde7c7 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GradientDialog.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GradientDialog.java
@@ -74,13 +74,13 @@ public class GradientDialog extends Dialog {
dialog.setText(GraphicsExample.getResourceString("Gradient")); //$NON-NLS-1$
GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 2;
- gridLayout.marginHeight = 10;
- gridLayout.marginWidth = 10;
- dialog.setLayout(gridLayout);
+ gridLayout.numColumns = 2;
+ gridLayout.marginHeight = 10;
+ gridLayout.marginWidth = 10;
+ dialog.setLayout(gridLayout);
- // create the controls in the dialog
- createDialogControls(dialog);
+ // create the controls in the dialog
+ createDialogControls(dialog);
dialog.addListener(SWT.Close, event -> {
for (int i = 0; i < resources.size(); i++) {
@@ -169,7 +169,7 @@ public class GradientDialog extends Dialog {
// position composite
gridData = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
- colorButtonComp.setLayoutData(gridData);
+ colorButtonComp.setLayoutData(gridData);
ColorMenu colorMenu = new ColorMenu();
@@ -228,10 +228,10 @@ public class GradientDialog extends Dialog {
// position composite
gridData = new GridData(GridData.HORIZONTAL_ALIGN_END);
- gridData.horizontalSpan = 2;
- okCancelComp.setLayoutData(gridData);
+ gridData.horizontalSpan = 2;
+ okCancelComp.setLayoutData(gridData);
- // OK button
+ // OK button
okButton = new Button (okCancelComp, SWT.PUSH);
okButton.setText("&OK");
okButton.addListener(SWT.Selection, event -> {
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GraphicAntialiasTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GraphicAntialiasTab.java
index 7f08715970..4432dd71a0 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GraphicAntialiasTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GraphicAntialiasTab.java
@@ -98,7 +98,7 @@ public void createControlPanel(Composite parent) {
comp = new Composite(parent, SWT.NONE);
comp.setLayout(new GridLayout());
- // initialize the background to the 5th item in the menu (blue)
+ // initialize the background to the 5th item in the menu (blue)
ovalColorGB = (GraphicsBackground)menu.getItem(4).getData();
// color button
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/IntroTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/IntroTab.java
index f061cccfb4..121b69ff7c 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/IntroTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/IntroTab.java
@@ -24,7 +24,7 @@ public class IntroTab extends AnimatedGraphicsTab {
Image image;
Random random = new Random();
float x, y;
- float incX = 10.0f;
+ float incX = 10.0f;
float incY = 5.0f;
int textWidth, textHeight;
String text = GraphicsExample.getResourceString("SWT");
@@ -58,25 +58,25 @@ public String getDescription() {
@Override
public void next(int width, int height) {
- x += incX;
- y += incY;
+ x += incX;
+ y += incY;
float random = (float)Math.random();
- if (x + textWidth > width) {
- x = width - textWidth;
- incX = random * -width / 16 - 1;
- }
- if (x < 0) {
- x = 0;
- incX = random * width / 16 + 1;
- }
- if (y + textHeight > height) {
- y = (height - textHeight)- 2;
- incY = random * -height / 16 - 1;
- }
- if (y < 0) {
- y = 0;
- incY = random * height / 16 + 1;
- }
+ if (x + textWidth > width) {
+ x = width - textWidth;
+ incX = random * -width / 16 - 1;
+ }
+ if (x < 0) {
+ x = 0;
+ incX = random * width / 16 + 1;
+ }
+ if (y + textHeight > height) {
+ y = (height - textHeight)- 2;
+ incY = random * -height / 16 - 1;
+ }
+ if (y < 0) {
+ y = 0;
+ incY = random * height / 16 + 1;
+ }
}
@Override
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/PathClippingTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/PathClippingTab.java
index b66aa2dc10..60962f8b46 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/PathClippingTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/PathClippingTab.java
@@ -249,7 +249,7 @@ public void paint(GC gc, int width, int height) {
pattern = new Pattern(device, background.getBgImage());
gc.setBackgroundPattern(pattern);
}
- gc.fillRectangle(0, 0, width, height);
- if (pattern != null) pattern.dispose();
+ gc.fillRectangle(0, 0, width, height);
+ if (pattern != null) pattern.dispose();
}
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/RegionClippingTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/RegionClippingTab.java
index b0d99a181f..c75ac01916 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/RegionClippingTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/RegionClippingTab.java
@@ -206,10 +206,10 @@ public void paint(GC gc, int width, int height) {
gc.fillPolygon(polygon1);
gc.setBackground(colorGB2.getBgColor1());
- gc.fillPolygon(polygon2);
+ gc.fillPolygon(polygon2);
}
region1.dispose();
region2.dispose();
- }
+ }
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/StarPolyTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/StarPolyTab.java
index 9dc68324bc..c5b71711aa 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/StarPolyTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/StarPolyTab.java
@@ -57,18 +57,18 @@ public String getDescription() {
@Override
public void paint(GC gc, int width, int height) {
- int centerX = width / 2;
- int centerY = height / 2;
- int pos = 0;
- for (int i = 0; i < POINTS; ++i) {
- double r = Math.PI*2 * pos/POINTS;
- radial[i*2] = (int)((1+Math.cos(r))*centerX);
- radial[i*2+1] = (int)((1+Math.sin(r))*centerY);
- pos = (pos + POINTS/2) % POINTS;
- }
+ int centerX = width / 2;
+ int centerY = height / 2;
+ int pos = 0;
+ for (int i = 0; i < POINTS; ++i) {
+ double r = Math.PI*2 * pos/POINTS;
+ radial[i*2] = (int)((1+Math.cos(r))*centerX);
+ radial[i*2+1] = (int)((1+Math.sin(r))*centerY);
+ pos = (pos + POINTS/2) % POINTS;
+ }
gc.setFillRule(fillRuleCb.getSelectionIndex() != 0 ? SWT.FILL_WINDING : SWT.FILL_EVEN_ODD);
gc.setBackground(gc.getDevice().getSystemColor(SWT.COLOR_YELLOW));
- gc.fillPolygon(radial);
- gc.drawPolygon(radial);
+ gc.fillPolygon(radial);
+ gc.drawPolygon(radial);
}
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/imageanalyzer/ImageAnalyzer.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/imageanalyzer/ImageAnalyzer.java
index 43355157c5..39b4c08b44 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/imageanalyzer/ImageAnalyzer.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/imageanalyzer/ImageAnalyzer.java
@@ -1451,8 +1451,8 @@ public class ImageAnalyzer {
animateLoop();
} catch (final SWTException e) {
display.syncExec(() -> showErrorDialog(createMsg(bundle.getString("Creating_image"),
- Integer.valueOf(imageDataIndex+1)),
- currentName, e));
+ Integer.valueOf(imageDataIndex+1)),
+ currentName, e));
}
// Post animation widget reset.
@@ -1696,7 +1696,7 @@ public class ImageAnalyzer {
string = createMsg(bundle.getString("Size_value"),
new Object[] {Integer.valueOf(imageData.width),
- Integer.valueOf(imageData.height)});
+ Integer.valueOf(imageData.height)});
sizeLabel.setText(string);
string = createMsg(bundle.getString("Depth_value"),
@@ -1723,7 +1723,7 @@ public class ImageAnalyzer {
string = createMsg(bundle.getString("Disposal_value"),
new Object[] {Integer.valueOf(imageData.disposalMethod),
- disposalString(imageData.disposalMethod)});
+ disposalString(imageData.disposalMethod)});
disposalMethodLabel.setText(string);
int delay = imageData.delayTime * 10;
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaLineStyler.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaLineStyler.java
index 1a4e63ce82..cf982f3540 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaLineStyler.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaLineStyler.java
@@ -377,7 +377,7 @@ public class JavaScanner {
protected void unread(int c) {
if (c != EOF)
- fPos--;
+ fPos--;
}
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/GridLayoutTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/GridLayoutTab.java
index 24c143e9cc..80d6ede38f 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/GridLayoutTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/GridLayoutTab.java
@@ -277,7 +277,7 @@ class GridLayoutTab extends Tab {
*/
@Override
void createControlWidgets () {
- /* Controls the columns in the GridLayout */
+ /* Controls the columns in the GridLayout */
Group columnGroup = new Group (controlGroup, SWT.NONE);
columnGroup.setText (LayoutExample.getResourceString ("Columns"));
columnGroup.setLayout(new GridLayout(2, false));
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/LayoutExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/LayoutExample.java
index ca83839952..e76927ef80 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/LayoutExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/LayoutExample.java
@@ -47,8 +47,8 @@ public class LayoutExample {
};
for (Tab tab : tabs) {
TabItem item = new TabItem (tabFolder, SWT.NONE);
- item.setText (tab.getTabText ());
- item.setControl (tab.createTabFolderPage (tabFolder));
+ item.setText (tab.getTabText ());
+ item.setControl (tab.createTabFolderPage (tabFolder));
}
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/StackLayoutTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/StackLayoutTab.java
index 9f7bd57a66..1f765541be 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/StackLayoutTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/StackLayoutTab.java
@@ -92,14 +92,14 @@ class StackLayoutTab extends Tab {
*/
@Override
void createControlWidgets() {
- /* Controls the topControl in the StackLayout */
+ /* Controls the topControl in the StackLayout */
Group columnGroup = new Group (controlGroup, SWT.NONE);
columnGroup.setText ("topControl");//(LayoutExample.getResourceString ("Top_Control"));
columnGroup.setLayout(new GridLayout(3, false));
columnGroup.setLayoutData(new GridData (SWT.FILL, SWT.FILL, false, false));
backButton = new Button(columnGroup, SWT.PUSH);
- backButton.setText("<<");
- backButton.setEnabled(false);
+ backButton.setText("<<");
+ backButton.setEnabled(false);
backButton.setLayoutData(new GridData (SWT.END, SWT.CENTER, false, false));
backButton.addSelectionListener(SelectionListener.widgetSelectedAdapter( e ->setTopControl (currentLayer - 1)));
topControl = new Label (columnGroup, SWT.BORDER);
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/Tab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/Tab.java
index 45b4890f0d..a18048ca0f 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/Tab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/Tab.java
@@ -305,11 +305,11 @@ abstract class Tab {
combo.addTraverseListener(e -> {
if (e.detail == SWT.TRAVERSE_TAB_NEXT || e.detail == SWT.TRAVERSE_RETURN) {
comboReset = true;
- resetEditors ();
- }
- if (e.detail == SWT.TRAVERSE_ESCAPE) {
- disposeEditors ();
- }
+ resetEditors ();
+ }
+ if (e.detail == SWT.TRAVERSE_ESCAPE) {
+ disposeEditors ();
+ }
});
}
@@ -429,11 +429,11 @@ abstract class Tab {
text.addTraverseListener(e -> {
if (e.detail == SWT.TRAVERSE_TAB_NEXT) {
- resetEditors (true);
- }
- if (e.detail == SWT.TRAVERSE_ESCAPE) {
- disposeEditors ();
- }
+ resetEditors (true);
+ }
+ if (e.detail == SWT.TRAVERSE_ESCAPE) {
+ disposeEditors ();
+ }
});
}
@@ -642,28 +642,28 @@ abstract class Tab {
} else if (control.equals ("Composite")) {
Composite composite = new Composite (layoutComposite, SWT.BORDER);
children [i] = composite;
- } else if (control.equals ("CoolBar")) {
- CoolBar coolBar = new CoolBar (layoutComposite, SWT.NONE);
- ToolBar toolBar = new ToolBar (coolBar, SWT.BORDER);
+ } else if (control.equals ("CoolBar")) {
+ CoolBar coolBar = new CoolBar (layoutComposite, SWT.NONE);
+ ToolBar toolBar = new ToolBar (coolBar, SWT.BORDER);
ToolItem item = new ToolItem (toolBar, 0);
item.setText (LayoutExample.getResourceString ("Item",new String [] {"1"}));
item = new ToolItem (toolBar, 0);
item.setText (LayoutExample.getResourceString ("Item",new String [] {"2"}));
- CoolItem coolItem1 = new CoolItem (coolBar, 0);
- coolItem1.setControl (toolBar);
+ CoolItem coolItem1 = new CoolItem (coolBar, 0);
+ coolItem1.setControl (toolBar);
toolBar = new ToolBar (coolBar, SWT.BORDER);
item = new ToolItem (toolBar, 0);
item.setText (LayoutExample.getResourceString ("Item",new String [] {"3"}));
item = new ToolItem (toolBar, 0);
item.setText (LayoutExample.getResourceString ("Item",new String [] {"4"}));
- CoolItem coolItem2 = new CoolItem (coolBar, 0);
- coolItem2.setControl (toolBar);
- Point size = toolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- coolItem1.setSize(coolItem1.computeSize (size.x, size.y));
- coolItem2.setSize(coolItem2.computeSize (size.x, size.y));
- coolBar.setSize(coolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+ CoolItem coolItem2 = new CoolItem (coolBar, 0);
+ coolItem2.setControl (toolBar);
+ Point size = toolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ coolItem1.setSize(coolItem1.computeSize (size.x, size.y));
+ coolItem2.setSize(coolItem2.computeSize (size.x, size.y));
+ coolBar.setSize(coolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT));
children [i] = coolBar;
- } else if (control.equals ("Group")) {
+ } else if (control.equals ("Group")) {
Group group = new Group (layoutComposite, SWT.NONE);
group.setText (controlName);
children [i] = group;
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/ContinuousPaintSession.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/ContinuousPaintSession.java
index 1a9c8a296b..b3225e70dc 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/ContinuousPaintSession.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/ContinuousPaintSession.java
@@ -76,7 +76,7 @@ public abstract class ContinuousPaintSession extends BasicPaintSession {
/**
* Deactivates the tool.
- */
+ */
@Override
public void endSession() {
abortRetrigger();
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/DragPaintSession.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/DragPaintSession.java
index 199d3c9a23..de93ba76e8 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/DragPaintSession.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/DragPaintSession.java
@@ -59,7 +59,7 @@ public abstract class DragPaintSession extends BasicPaintSession {
/**
* Deactivates the tool.
- */
+ */
@Override
public void endSession() {
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintSession.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintSession.java
index 50ba9498f7..bcfda6669e 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintSession.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintSession.java
@@ -38,9 +38,9 @@ public interface PaintSession extends MouseListener, MouseMoveListener {
/**
* Deactivates the session.
- *
+ *
* Note: When overriding this method, call super.endSession() at method exit.
- */
+ */
public abstract void endSession();
/**
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/SegmentedPaintSession.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/SegmentedPaintSession.java
index 18278779f6..15bdc3e2e2 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/SegmentedPaintSession.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/SegmentedPaintSession.java
@@ -63,7 +63,7 @@ public abstract class SegmentedPaintSession extends BasicPaintSession {
/**
* Deactivates the tool.
- */
+ */
@Override
public void endSession() {
getPaintSurface().clearRubberbandSelection();
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/TextTool.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/TextTool.java
index 1a510e0d60..45e2e0ab7a 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/TextTool.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/TextTool.java
@@ -76,7 +76,7 @@ public class TextTool extends BasicPaintSession implements PaintTool {
/**
* Deactivates the tool.
- */
+ */
@Override
public void endSession() {
getPaintSurface().clearRubberbandSelection();
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/TextEditor.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/TextEditor.java
index cf00d895c4..2177b48b88 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/TextEditor.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/TextEditor.java
@@ -244,14 +244,14 @@ public class TextEditor {
FileDialog dialog = new FileDialog(shell, SWT.OPEN);
dialog.setFilterNames(new String [] {getResourceString("Text_Documents")}); //$NON-NLS-1$
dialog.setFilterExtensions (new String [] {"*.txt"}); //$NON-NLS-1$
- String name = dialog.open();
- if (name == null) return;
- fileName = name;
- try (FileInputStream file = new FileInputStream(name);){
- styledText.setText(openFile(file));
- } catch (IOException e) {
- showError(getResourceString("Error"), e.getMessage()); //$NON-NLS-1$
- }
+ String name = dialog.open();
+ if (name == null) return;
+ fileName = name;
+ try (FileInputStream file = new FileInputStream(name);){
+ styledText.setText(openFile(file));
+ } catch (IOException e) {
+ showError(getResourceString("Error"), e.getMessage()); //$NON-NLS-1$
+ }
}));
final MenuItem saveItem = new MenuItem(fileMenu, SWT.PUSH);
@@ -1251,10 +1251,10 @@ public class TextEditor {
void saveFile() {
if (fileName != null) {
try (FileWriter file = new FileWriter(fileName);) {
- file.write(styledText.getText());
+ file.write(styledText.getText());
} catch (IOException e) {
- showError(getResourceString("Error"), e.getMessage());
- }
+ showError(getResourceString("Error"), e.getMessage());
+ }
}
}
diff --git a/examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/FogTab.java b/examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/FogTab.java
index cc5a4cb7e3..051c5eedc6 100644
--- a/examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/FogTab.java
+++ b/examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/FogTab.java
@@ -121,7 +121,7 @@ class FogTab extends OpenGLTab {
/**
* Creates a cube at 0,0 in the viewport.
*/
- void createCube() {
+ void createCube() {
GL.glNewList(cubeListIndexBase, GL.GL_COMPILE);
GL.glBegin(GL.GL_QUADS);
// front
diff --git a/examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/LWJGLExample.java b/examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/LWJGLExample.java
index 0a966dc119..d2b0c7c68f 100644
--- a/examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/LWJGLExample.java
+++ b/examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/LWJGLExample.java
@@ -67,25 +67,25 @@ public class LWJGLExample {
canvas.setCurrent();
try {
- GLContext.useContext(canvas);
- } catch(LWJGLException e) { e.printStackTrace(); }
-
- canvas.addListener(SWT.Resize, new Listener() {
- public void handleEvent(Event event) {
- Rectangle bounds = canvas.getBounds();
- float fAspect = (float) bounds.width / (float) bounds.height;
+ GLContext.useContext(canvas);
+ } catch(LWJGLException e) { e.printStackTrace(); }
+
+ canvas.addListener(SWT.Resize, new Listener() {
+ public void handleEvent(Event event) {
+ Rectangle bounds = canvas.getBounds();
+ float fAspect = (float) bounds.width / (float) bounds.height;
canvas.setCurrent();
try {
GLContext.useContext(canvas);
- } catch(LWJGLException e) { e.printStackTrace(); }
- GL11.glViewport(0, 0, bounds.width, bounds.height);
- GL11.glMatrixMode(GL11.GL_PROJECTION);
- GL11.glLoadIdentity();
- GLU.gluPerspective(45.0f, fAspect, 0.5f, 400.0f);
- GL11.glMatrixMode(GL11.GL_MODELVIEW);
- GL11.glLoadIdentity();
- }
- });
+ } catch(LWJGLException e) { e.printStackTrace(); }
+ GL11.glViewport(0, 0, bounds.width, bounds.height);
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GLU.gluPerspective(45.0f, fAspect, 0.5f, 400.0f);
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ }
+ });
GL11.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
GL11.glColor3f(1.0f, 0.0f, 0.0f);
@@ -98,14 +98,14 @@ public class LWJGLExample {
shell.setSize(640, 480);
shell.open();
- display.asyncExec(new Runnable() {
- int rot = 0;
+ display.asyncExec(new Runnable() {
+ int rot = 0;
public void run() {
if (!canvas.isDisposed()) {
canvas.setCurrent();
try {
GLContext.useContext(canvas);
- } catch(LWJGLException e) { e.printStackTrace(); }
+ } catch(LWJGLException e) { e.printStackTrace(); }
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
GL11.glClearColor(.3f, .5f, .8f, 1.0f);
GL11.glLoadIdentity();
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet150.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet150.java
index ff5aec2417..c06f5eae8e 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet150.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet150.java
@@ -30,49 +30,49 @@ public class Snippet150 {
static int itemCount;
static CoolItem createItem(CoolBar coolBar, int count) {
- ToolBar toolBar = new ToolBar(coolBar, SWT.FLAT);
- for (int i = 0; i < count; i++) {
- ToolItem item = new ToolItem(toolBar, SWT.PUSH);
- item.setText(itemCount++ +"");
- }
- toolBar.pack();
- Point size = toolBar.getSize();
- CoolItem item = new CoolItem(coolBar, SWT.NONE);
- item.setControl(toolBar);
- Point preferred = item.computeSize(size.x, size.y);
- item.setPreferredSize(preferred);
- return item;
+ ToolBar toolBar = new ToolBar(coolBar, SWT.FLAT);
+ for (int i = 0; i < count; i++) {
+ ToolItem item = new ToolItem(toolBar, SWT.PUSH);
+ item.setText(itemCount++ +"");
+ }
+ toolBar.pack();
+ Point size = toolBar.getSize();
+ CoolItem item = new CoolItem(coolBar, SWT.NONE);
+ item.setControl(toolBar);
+ Point preferred = item.computeSize(size.x, size.y);
+ item.setPreferredSize(preferred);
+ return item;
}
public static void main(String[] args) {
- Display display = new Display();
- final Shell shell = new Shell(display);
+ Display display = new Display();
+ final Shell shell = new Shell(display);
shell.setText("Snippet 150");
- CoolBar coolBar = new CoolBar(shell, SWT.NONE);
- createItem(coolBar, 3);
- createItem(coolBar, 2);
- createItem(coolBar, 3);
- createItem(coolBar, 4);
- int style = SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL;
- Text text = new Text(shell, style);
- FormLayout layout = new FormLayout();
- shell.setLayout(layout);
- FormData coolData = new FormData();
- coolData.left = new FormAttachment(0);
- coolData.right = new FormAttachment(100);
- coolData.top = new FormAttachment(0);
- coolBar.setLayoutData(coolData);
- coolBar.addListener(SWT.Resize, event -> shell.layout());
- FormData textData = new FormData();
- textData.left = new FormAttachment(0);
- textData.right = new FormAttachment(100);
- textData.top = new FormAttachment(coolBar);
- textData.bottom = new FormAttachment(100);
- text.setLayoutData(textData);
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) display.sleep();
- }
- display.dispose();
+ CoolBar coolBar = new CoolBar(shell, SWT.NONE);
+ createItem(coolBar, 3);
+ createItem(coolBar, 2);
+ createItem(coolBar, 3);
+ createItem(coolBar, 4);
+ int style = SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL;
+ Text text = new Text(shell, style);
+ FormLayout layout = new FormLayout();
+ shell.setLayout(layout);
+ FormData coolData = new FormData();
+ coolData.left = new FormAttachment(0);
+ coolData.right = new FormAttachment(100);
+ coolData.top = new FormAttachment(0);
+ coolBar.setLayoutData(coolData);
+ coolBar.addListener(SWT.Resize, event -> shell.layout());
+ FormData textData = new FormData();
+ textData.left = new FormAttachment(0);
+ textData.right = new FormAttachment(100);
+ textData.top = new FormAttachment(coolBar);
+ textData.bottom = new FormAttachment(100);
+ text.setLayoutData(textData);
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) display.sleep();
+ }
+ display.dispose();
}
}
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet152.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet152.java
index 35b647c3af..8f4dac46cb 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet152.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet152.java
@@ -29,67 +29,67 @@ import org.eclipse.swt.widgets.*;
public class Snippet152 {
public static void main(String[] args) {
- Display display = new Display();
- Shell shell = new Shell(display);
+ Display display = new Display();
+ Shell shell = new Shell(display);
shell.setText("Snippet 152");
- FormLayout layout = new FormLayout();
- shell.setLayout(layout);
- final Label label = new Label(shell, SWT.BORDER);
- Listener armListener = event -> {
- MenuItem item = (MenuItem) event.widget;
- label.setText(item.getText());
- label.update();
+ FormLayout layout = new FormLayout();
+ shell.setLayout(layout);
+ final Label label = new Label(shell, SWT.BORDER);
+ Listener armListener = event -> {
+ MenuItem item = (MenuItem) event.widget;
+ label.setText(item.getText());
+ label.update();
};
- Listener showListener = event -> {
- Menu menu = (Menu) event.widget;
- MenuItem item = menu.getParentItem();
- if (item != null) {
- label.setText(item.getText());
- label.update();
- }
+ Listener showListener = event -> {
+ Menu menu = (Menu) event.widget;
+ MenuItem item = menu.getParentItem();
+ if (item != null) {
+ label.setText(item.getText());
+ label.update();
+ }
};
- Listener hideListener = event -> {
- label.setText("");
- label.update();
+ Listener hideListener = event -> {
+ label.setText("");
+ label.update();
};
- FormData labelData = new FormData();
- labelData.left = new FormAttachment(0);
- labelData.right = new FormAttachment(100);
- labelData.bottom = new FormAttachment(100);
- label.setLayoutData(labelData);
- Menu menuBar = new Menu(shell, SWT.BAR);
- shell.setMenuBar(menuBar);
- MenuItem fileItem = new MenuItem(menuBar, SWT.CASCADE);
- fileItem.setText("File");
- fileItem.addListener(SWT.Arm, armListener);
- MenuItem editItem = new MenuItem(menuBar, SWT.CASCADE);
- editItem.setText("Edit");
- editItem.addListener(SWT.Arm, armListener);
- Menu fileMenu = new Menu(shell, SWT.DROP_DOWN);
- fileMenu.addListener(SWT.Hide, hideListener);
- fileMenu.addListener(SWT.Show, showListener);
- fileItem.setMenu(fileMenu);
- String[] fileStrings = { "New", "Close", "Exit" };
- for (int i = 0; i < fileStrings.length; i++) {
- MenuItem item = new MenuItem(fileMenu, SWT.PUSH);
- item.setText(fileStrings[i]);
- item.addListener(SWT.Arm, armListener);
- }
- Menu editMenu = new Menu(shell, SWT.DROP_DOWN);
- editMenu.addListener(SWT.Hide, hideListener);
- editMenu.addListener(SWT.Show, showListener);
- String[] editStrings = { "Cut", "Copy", "Paste" };
- editItem.setMenu(editMenu);
- for (int i = 0; i < editStrings.length; i++) {
- MenuItem item = new MenuItem(editMenu, SWT.PUSH);
- item.setText(editStrings[i]);
- item.addListener(SWT.Arm, armListener);
- }
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) display.sleep();
- }
- display.dispose();
+ FormData labelData = new FormData();
+ labelData.left = new FormAttachment(0);
+ labelData.right = new FormAttachment(100);
+ labelData.bottom = new FormAttachment(100);
+ label.setLayoutData(labelData);
+ Menu menuBar = new Menu(shell, SWT.BAR);
+ shell.setMenuBar(menuBar);
+ MenuItem fileItem = new MenuItem(menuBar, SWT.CASCADE);
+ fileItem.setText("File");
+ fileItem.addListener(SWT.Arm, armListener);
+ MenuItem editItem = new MenuItem(menuBar, SWT.CASCADE);
+ editItem.setText("Edit");
+ editItem.addListener(SWT.Arm, armListener);
+ Menu fileMenu = new Menu(shell, SWT.DROP_DOWN);
+ fileMenu.addListener(SWT.Hide, hideListener);
+ fileMenu.addListener(SWT.Show, showListener);
+ fileItem.setMenu(fileMenu);
+ String[] fileStrings = { "New", "Close", "Exit" };
+ for (int i = 0; i < fileStrings.length; i++) {
+ MenuItem item = new MenuItem(fileMenu, SWT.PUSH);
+ item.setText(fileStrings[i]);
+ item.addListener(SWT.Arm, armListener);
+ }
+ Menu editMenu = new Menu(shell, SWT.DROP_DOWN);
+ editMenu.addListener(SWT.Hide, hideListener);
+ editMenu.addListener(SWT.Show, showListener);
+ String[] editStrings = { "Cut", "Copy", "Paste" };
+ editItem.setMenu(editMenu);
+ for (int i = 0; i < editStrings.length; i++) {
+ MenuItem item = new MenuItem(editMenu, SWT.PUSH);
+ item.setText(editStrings[i]);
+ item.addListener(SWT.Arm, armListener);
+ }
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) display.sleep();
+ }
+ display.dispose();
}
}
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet153.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet153.java
index 8e7f0a090f..af9c59720a 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet153.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet153.java
@@ -27,33 +27,33 @@ public class Snippet153 {
static String statusText = "";
public static void main(String[] args) {
- final Display display = new Display();
- Shell shell = new Shell(display);
+ final Display display = new Display();
+ Shell shell = new Shell(display);
shell.setText("Snippet 153");
- shell.setBounds(10, 10, 200, 200);
- final ToolBar bar = new ToolBar(shell, SWT.BORDER);
- bar.setBounds(10, 10, 150, 50);
- final Label statusLine = new Label(shell, SWT.BORDER);
- statusLine.setBounds(10, 90, 150, 30);
- new ToolItem(bar, SWT.NONE).setText("item 1");
- new ToolItem(bar, SWT.NONE).setText("item 2");
- new ToolItem(bar, SWT.NONE).setText("item 3");
- bar.addMouseMoveListener(e -> {
- ToolItem item = bar.getItem(new Point(e.x, e.y));
- String name = "";
- if (item != null) {
- name = item.getText();
- }
- if (!statusText.equals(name)) {
- statusLine.setText(name);
- statusText = name;
- }
+ shell.setBounds(10, 10, 200, 200);
+ final ToolBar bar = new ToolBar(shell, SWT.BORDER);
+ bar.setBounds(10, 10, 150, 50);
+ final Label statusLine = new Label(shell, SWT.BORDER);
+ statusLine.setBounds(10, 90, 150, 30);
+ new ToolItem(bar, SWT.NONE).setText("item 1");
+ new ToolItem(bar, SWT.NONE).setText("item 2");
+ new ToolItem(bar, SWT.NONE).setText("item 3");
+ bar.addMouseMoveListener(e -> {
+ ToolItem item = bar.getItem(new Point(e.x, e.y));
+ String name = "";
+ if (item != null) {
+ name = item.getText();
+ }
+ if (!statusText.equals(name)) {
+ statusLine.setText(name);
+ statusText = name;
+ }
});
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) display.sleep();
- }
- display.dispose();
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) display.sleep();
+ }
+ display.dispose();
}
}
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet157.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet157.java
index 7292affd9a..e1c48f8f0c 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet157.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet157.java
@@ -23,7 +23,7 @@ package org.eclipse.swt.snippets;
*/
import java.applet.*;
-
+
public class Snippet157 extends Applet {
org.eclipse.swt.widgets.Display display;
@@ -63,15 +63,15 @@ public void init () {
}
@Override
public void stop (){
- if (display != null && !display.isDisposed ()){
- display.syncExec(() -> {
+ if (display != null && !display.isDisposed ()){
+ display.syncExec(() -> {
if (swtParent != null && !swtParent.isDisposed ()) swtParent.dispose ();
swtParent = null;
display.dispose ();
display = null;
});
- remove (awtParent);
- awtParent = null;
- }
+ remove (awtParent);
+ awtParent = null;
+ }
}
} \ No newline at end of file
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet174.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet174.java
index 9f526b0fbd..9777d7f4bb 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet174.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet174.java
@@ -45,66 +45,66 @@ import org.eclipse.swt.widgets.*;
public class Snippet174 {
public static void main(String[] args) {
- Display display = new Display();
- Shell shell = new Shell(display);
- shell.setText("OpenGL in SWT");
- shell.setLayout(new FillLayout());
- GLData data = new GLData();
- data.doubleBuffer = true;
- final GLCanvas canvas = new GLCanvas(shell, SWT.NO_BACKGROUND, data);
+ Display display = new Display();
+ Shell shell = new Shell(display);
+ shell.setText("OpenGL in SWT");
+ shell.setLayout(new FillLayout());
+ GLData data = new GLData();
+ data.doubleBuffer = true;
+ final GLCanvas canvas = new GLCanvas(shell, SWT.NO_BACKGROUND, data);
canvas.addControlListener(ControlListener.controlResizedAdapter(e -> {
resize(canvas);
}));
- init(canvas);
- new Runnable() {
- @Override
+ init(canvas);
+ new Runnable() {
+ @Override
public void run() {
- if (canvas.isDisposed()) return;
- render();
- canvas.swapBuffers();
- canvas.getDisplay().timerExec(50, this);
- }
- }.run();
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) display.sleep();
- }
- display.dispose();
+ if (canvas.isDisposed()) return;
+ render();
+ canvas.swapBuffers();
+ canvas.getDisplay().timerExec(50, this);
+ }
+ }.run();
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) display.sleep();
+ }
+ display.dispose();
}
static void init(GLCanvas canvas) {
- canvas.setCurrent();
- resize(canvas);
- GL.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
- GL.glColor3f(0.0f, 0.0f, 0.0f);
- GL.glClearDepth(1.0f);
- GL.glEnable(GL.GL_DEPTH_TEST);
- GL.glHint(GL.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST);
+ canvas.setCurrent();
+ resize(canvas);
+ GL.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
+ GL.glColor3f(0.0f, 0.0f, 0.0f);
+ GL.glClearDepth(1.0f);
+ GL.glEnable(GL.GL_DEPTH_TEST);
+ GL.glHint(GL.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST);
}
static void render() {
- GL.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
- GL.glLoadIdentity();
- GL.glTranslatef(0.0f, 0.0f, -6.0f);
- GL.glBegin(GL.GL_QUADS);
- GL.glVertex3f(-1.0f, 1.0f, 0.0f);
- GL.glVertex3f(1.0f, 1.0f, 0.0f);
- GL.glVertex3f(1.0f, -1.0f, 0.0f);
- GL.glVertex3f(-1.0f, -1.0f, 0.0f);
- GL.glEnd();
+ GL.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
+ GL.glLoadIdentity();
+ GL.glTranslatef(0.0f, 0.0f, -6.0f);
+ GL.glBegin(GL.GL_QUADS);
+ GL.glVertex3f(-1.0f, 1.0f, 0.0f);
+ GL.glVertex3f(1.0f, 1.0f, 0.0f);
+ GL.glVertex3f(1.0f, -1.0f, 0.0f);
+ GL.glVertex3f(-1.0f, -1.0f, 0.0f);
+ GL.glEnd();
}
static void resize(GLCanvas canvas) {
- canvas.setCurrent();
- Rectangle rect = canvas.getClientArea();
- int width = rect.width;
- int height = Math.max(rect.height, 1);
- GL.glViewport(0, 0, width, height);
- GL.glMatrixMode(GL.GL_PROJECTION);
- GL.glLoadIdentity();
- float aspect = (float) width / (float) height;
- GLU.gluPerspective(45.0f, aspect, 0.5f, 400.0f);
- GL.glMatrixMode(GL.GL_MODELVIEW);
- GL.glLoadIdentity();
+ canvas.setCurrent();
+ Rectangle rect = canvas.getClientArea();
+ int width = rect.width;
+ int height = Math.max(rect.height, 1);
+ GL.glViewport(0, 0, width, height);
+ GL.glMatrixMode(GL.GL_PROJECTION);
+ GL.glLoadIdentity();
+ float aspect = (float) width / (float) height;
+ GLU.gluPerspective(45.0f, aspect, 0.5f, 400.0f);
+ GL.glMatrixMode(GL.GL_MODELVIEW);
+ GL.glLoadIdentity();
}
}
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet186.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet186.java
index 7253cb7c56..c9af85c36a 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet186.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet186.java
@@ -133,30 +133,30 @@ static String readSafeArray(Variant variantByRef) {
// Read a safearray that contains data of
// type VT_UI1 (unsigned shorts) which contains
// a text stream.
- long /*int*/ pPostData = variantByRef.getByRef();
- short[] vt_type = new short[1];
- OS.MoveMemory(vt_type, pPostData, 2);
- String result = null;
- if (vt_type[0] == (short)(OLE.VT_BYREF | OLE.VT_VARIANT)) {
- int[] pVariant = new int[1];
- OS.MoveMemory(pVariant, pPostData + 8, 4);
- vt_type = new short[1];
- OS.MoveMemory(vt_type, pVariant[0], 2);
- if (vt_type[0] == (short)(OLE.VT_ARRAY | OLE.VT_UI1)) {
- long /*int*/ [] pSafearray = new long /*int*/[1];
- OS.MoveMemory(pSafearray, pVariant[0] + 8, OS.PTR_SIZEOF);
- SAFEARRAY safeArray = new SAFEARRAY();
- OS.MoveMemory(safeArray, pSafearray[0], SAFEARRAY.sizeof);
- for (int i = 0; i < safeArray.cDims; i++) {
- int cchWideChar = OS.MultiByteToWideChar (CodePage, OS.MB_PRECOMPOSED, safeArray.pvData, -1, null, 0);
+ long /*int*/ pPostData = variantByRef.getByRef();
+ short[] vt_type = new short[1];
+ OS.MoveMemory(vt_type, pPostData, 2);
+ String result = null;
+ if (vt_type[0] == (short)(OLE.VT_BYREF | OLE.VT_VARIANT)) {
+ int[] pVariant = new int[1];
+ OS.MoveMemory(pVariant, pPostData + 8, 4);
+ vt_type = new short[1];
+ OS.MoveMemory(vt_type, pVariant[0], 2);
+ if (vt_type[0] == (short)(OLE.VT_ARRAY | OLE.VT_UI1)) {
+ long /*int*/ [] pSafearray = new long /*int*/[1];
+ OS.MoveMemory(pSafearray, pVariant[0] + 8, OS.PTR_SIZEOF);
+ SAFEARRAY safeArray = new SAFEARRAY();
+ OS.MoveMemory(safeArray, pSafearray[0], SAFEARRAY.sizeof);
+ for (int i = 0; i < safeArray.cDims; i++) {
+ int cchWideChar = OS.MultiByteToWideChar (CodePage, OS.MB_PRECOMPOSED, safeArray.pvData, -1, null, 0);
if (cchWideChar == 0) return null;
char[] lpWideCharStr = new char [cchWideChar - 1];
OS.MultiByteToWideChar (CodePage, OS.MB_PRECOMPOSED, safeArray.pvData, -1, lpWideCharStr, lpWideCharStr.length);
result = new String(lpWideCharStr);
- }
- }
- }
- return result;
+ }
+ }
+ }
+ return result;
}
static Variant writeSafeArray (String string) {
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet2.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet2.java
index 3b76456d49..300d8ffee4 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet2.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet2.java
@@ -31,55 +31,55 @@ import org.eclipse.swt.widgets.*;
public class Snippet2 {
public static void main (String [] args) {
- Display display = new Display ();
- Shell shell = new Shell (display);
+ Display display = new Display ();
+ Shell shell = new Shell (display);
shell.setText("Snippet 2");
- shell.setLayout(new FillLayout());
- final Table table = new Table(shell, SWT.BORDER);
- table.setHeaderVisible(true);
- final TableColumn column1 = new TableColumn(table, SWT.NONE);
- column1.setText("Column 1");
- final TableColumn column2 = new TableColumn(table, SWT.NONE);
- column2.setText("Column 2");
- TableItem item = new TableItem(table, SWT.NONE);
- item.setText(new String[] {"a", "3"});
- item = new TableItem(table, SWT.NONE);
- item.setText(new String[] {"b", "2"});
- item = new TableItem(table, SWT.NONE);
- item.setText(new String[] {"c", "1"});
- column1.setWidth(100);
- column2.setWidth(100);
- Listener sortListener = e -> {
- TableItem[] items = table.getItems();
- Collator collator = Collator.getInstance(Locale.getDefault());
- TableColumn column = (TableColumn)e.widget;
- int index = column == column1 ? 0 : 1;
- for (int i = 1; i < items.length; i++) {
- String value1 = items[i].getText(index);
- for (int j = 0; j < i; j++){
- String value2 = items[j].getText(index);
- if (collator.compare(value1, value2) < 0) {
- String[] values = {items[i].getText(0), items[i].getText(1)};
- items[i].dispose();
- TableItem item1 = new TableItem(table, SWT.NONE, j);
- item1.setText(values);
- items = table.getItems();
- break;
- }
- }
- }
- table.setSortColumn(column);
+ shell.setLayout(new FillLayout());
+ final Table table = new Table(shell, SWT.BORDER);
+ table.setHeaderVisible(true);
+ final TableColumn column1 = new TableColumn(table, SWT.NONE);
+ column1.setText("Column 1");
+ final TableColumn column2 = new TableColumn(table, SWT.NONE);
+ column2.setText("Column 2");
+ TableItem item = new TableItem(table, SWT.NONE);
+ item.setText(new String[] {"a", "3"});
+ item = new TableItem(table, SWT.NONE);
+ item.setText(new String[] {"b", "2"});
+ item = new TableItem(table, SWT.NONE);
+ item.setText(new String[] {"c", "1"});
+ column1.setWidth(100);
+ column2.setWidth(100);
+ Listener sortListener = e -> {
+ TableItem[] items = table.getItems();
+ Collator collator = Collator.getInstance(Locale.getDefault());
+ TableColumn column = (TableColumn)e.widget;
+ int index = column == column1 ? 0 : 1;
+ for (int i = 1; i < items.length; i++) {
+ String value1 = items[i].getText(index);
+ for (int j = 0; j < i; j++){
+ String value2 = items[j].getText(index);
+ if (collator.compare(value1, value2) < 0) {
+ String[] values = {items[i].getText(0), items[i].getText(1)};
+ items[i].dispose();
+ TableItem item1 = new TableItem(table, SWT.NONE, j);
+ item1.setText(values);
+ items = table.getItems();
+ break;
+ }
+ }
+ }
+ table.setSortColumn(column);
};
- column1.addListener(SWT.Selection, sortListener);
- column2.addListener(SWT.Selection, sortListener);
- table.setSortColumn(column1);
- table.setSortDirection(SWT.UP);
- shell.setSize(shell.computeSize(SWT.DEFAULT, SWT.DEFAULT).x, 300);
- shell.open();
- while (!shell.isDisposed ()) {
- if (!display.readAndDispatch ()) display.sleep ();
- }
- display.dispose ();
+ column1.addListener(SWT.Selection, sortListener);
+ column2.addListener(SWT.Selection, sortListener);
+ table.setSortColumn(column1);
+ table.setSortDirection(SWT.UP);
+ shell.setSize(shell.computeSize(SWT.DEFAULT, SWT.DEFAULT).x, 300);
+ shell.open();
+ while (!shell.isDisposed ()) {
+ if (!display.readAndDispatch ()) display.sleep ();
+ }
+ display.dispose ();
}
}
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet210.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet210.java
index 8a0c277d0c..777a584b53 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet210.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet210.java
@@ -30,17 +30,17 @@ import org.eclipse.swt.widgets.*;
public class Snippet210 {
static String string1 = "A drag source is the provider of data in a Drag and Drop data transfer as well as "+
- "the originator of the Drag and Drop operation. The data provided by the drag source "+
- "may be transferred to another location in the same widget, to a different widget "+
- "within the same application, or to a different application altogether. For example, "+
- "you can drag text from your application and drop it on an email application, or you "+
- "could drag an item in a tree and drop it below a different node in the same tree.";
+ "the originator of the Drag and Drop operation. The data provided by the drag source "+
+ "may be transferred to another location in the same widget, to a different widget "+
+ "within the same application, or to a different application altogether. For example, "+
+ "you can drag text from your application and drop it on an email application, or you "+
+ "could drag an item in a tree and drop it below a different node in the same tree.";
static String string2 = "A drop target receives data in a Drag and Drop operation. The data received by "+
- "the drop target may have come from the same widget, from a different widget within "+
- "the same application, or from a different application altogether. For example, you "+
- "can drag text from an email application and drop it on your application, or you could "+
- "drag an item in a tree and drop it below a different node in the same tree.";
+ "the drop target may have come from the same widget, from a different widget within "+
+ "the same application, or from a different application altogether. For example, you "+
+ "can drag text from an email application and drop it on your application, or you could "+
+ "drag an item in a tree and drop it below a different node in the same tree.";
public static void main (String [] args) {
final Display display = new Display ();
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet228.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet228.java
index 30ced9a4fd..afa9d91ffa 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet228.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet228.java
@@ -48,8 +48,8 @@ public static void main(String [] args) {
column2.setWidth(200);
String[] labels = new String[]{"Resolved", "New", "Won't Fix", "Invalid"};
for (int i=0; i<labels.length; i++) {
- TableItem item = new TableItem(table, SWT.NONE);
- item.setText(labels[i]);
+ TableItem item = new TableItem(table, SWT.NONE);
+ item.setText(labels[i]);
}
/*
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet244.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet244.java
index 7f48a275c3..83bd297598 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet244.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet244.java
@@ -26,28 +26,28 @@ import org.eclipse.swt.widgets.*;
public class Snippet244 {
static String SEARCH_STRING = "box";
- public static void main(String[] args) {
- final Display display = new Display();
- Shell shell = new Shell(display);
- shell.setText("Snippet 244");
- shell.setLayout(new FillLayout());
- final StyledText text = new StyledText(shell, SWT.NONE);
- StyleRange style = new StyleRange();
- style.borderColor = display.getSystemColor(SWT.COLOR_RED);
- style.borderStyle = SWT.BORDER_SOLID;
- StyleRange[] styles = {style};
- String contents = "This demonstrates drawing a box\naround every occurrence of the word\nbox in the StyledText";
- text.setText(contents);
+ public static void main(String[] args) {
+ final Display display = new Display();
+ Shell shell = new Shell(display);
+ shell.setText("Snippet 244");
+ shell.setLayout(new FillLayout());
+ final StyledText text = new StyledText(shell, SWT.NONE);
+ StyleRange style = new StyleRange();
+ style.borderColor = display.getSystemColor(SWT.COLOR_RED);
+ style.borderStyle = SWT.BORDER_SOLID;
+ StyleRange[] styles = {style};
+ String contents = "This demonstrates drawing a box\naround every occurrence of the word\nbox in the StyledText";
+ text.setText(contents);
int index = contents.indexOf(SEARCH_STRING);
while (index != -1) {
text.setStyleRanges(0, 0, new int[] {index, SEARCH_STRING.length()}, styles);
index = contents.indexOf(SEARCH_STRING, index + 1);
}
- shell.pack();
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) display.sleep();
- }
- display.dispose();
- }
+ shell.pack();
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) display.sleep();
+ }
+ display.dispose();
+ }
}
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet257.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet257.java
index d4ea9e1a8a..e0a019c4f9 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet257.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet257.java
@@ -31,11 +31,11 @@ import org.eclipse.swt.widgets.*;
public class Snippet257 {
static String string1 = "A drag source is the provider of data in a Drag and Drop data transfer as well as "+
- "the originator of the Drag and Drop operation. The data provided by the drag source "+
- "may be transferred to another location in the same widget, to a different widget "+
- "within the same application, or to a different application altogether. For example, "+
- "you can drag text from your application and drop it on an email application, or you "+
- "could drag an item in a tree and drop it below a different node in the same tree.";
+ "the originator of the Drag and Drop operation. The data provided by the drag source "+
+ "may be transferred to another location in the same widget, to a different widget "+
+ "within the same application, or to a different application altogether. For example, "+
+ "you can drag text from your application and drop it on an email application, or you "+
+ "could drag an item in a tree and drop it below a different node in the same tree.";
static String DRAG_START_DATA = "DRAG_START_DATA";
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet274.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet274.java
index 30ba24f3fc..3287361d27 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet274.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet274.java
@@ -28,68 +28,68 @@ import org.eclipse.swt.widgets.*;
public class Snippet274 {
static void checkPath(TreeItem item, boolean checked, boolean grayed) {
- if (item == null) return;
- if (grayed) {
- checked = true;
- } else {
- int index = 0;
- TreeItem[] items = item.getItems();
- while (index < items.length) {
- TreeItem child = items[index];
- if (child.getGrayed() || checked != child.getChecked()) {
- checked = grayed = true;
- break;
- }
- index++;
- }
- }
- item.setChecked(checked);
- item.setGrayed(grayed);
- checkPath(item.getParentItem(), checked, grayed);
+ if (item == null) return;
+ if (grayed) {
+ checked = true;
+ } else {
+ int index = 0;
+ TreeItem[] items = item.getItems();
+ while (index < items.length) {
+ TreeItem child = items[index];
+ if (child.getGrayed() || checked != child.getChecked()) {
+ checked = grayed = true;
+ break;
+ }
+ index++;
+ }
+ }
+ item.setChecked(checked);
+ item.setGrayed(grayed);
+ checkPath(item.getParentItem(), checked, grayed);
}
static void checkItems(TreeItem item, boolean checked) {
- item.setGrayed(false);
- item.setChecked(checked);
- TreeItem[] items = item.getItems();
- for (int i = 0; i < items.length; i++) {
- checkItems(items[i], checked);
- }
+ item.setGrayed(false);
+ item.setChecked(checked);
+ TreeItem[] items = item.getItems();
+ for (int i = 0; i < items.length; i++) {
+ checkItems(items[i], checked);
+ }
}
public static void main(String[] args) {
- Display display = new Display();
- Shell shell = new Shell(display);
+ Display display = new Display();
+ Shell shell = new Shell(display);
shell.setText("Snippet 274");
- Tree tree = new Tree(shell, SWT.BORDER | SWT.CHECK);
- tree.addListener(SWT.Selection, event -> {
- if (event.detail == SWT.CHECK) {
- TreeItem item = (TreeItem) event.item;
- boolean checked = item.getChecked();
- checkItems(item, checked);
- checkPath(item.getParentItem(), checked, false);
- }
+ Tree tree = new Tree(shell, SWT.BORDER | SWT.CHECK);
+ tree.addListener(SWT.Selection, event -> {
+ if (event.detail == SWT.CHECK) {
+ TreeItem item = (TreeItem) event.item;
+ boolean checked = item.getChecked();
+ checkItems(item, checked);
+ checkPath(item.getParentItem(), checked, false);
+ }
});
- for (int i = 0; i < 4; i++) {
- TreeItem itemI = new TreeItem(tree, SWT.NONE);
- itemI.setText("Item " + i);
- for (int j = 0; j < 4; j++) {
- TreeItem itemJ = new TreeItem(itemI, SWT.NONE);
- itemJ.setText("Item " + i + " " + j);
- for (int k = 0; k < 4; k++) {
- TreeItem itemK = new TreeItem(itemJ, SWT.NONE);
- itemK.setText("Item " + i + " " + j + " " + k);
- }
- }
- }
+ for (int i = 0; i < 4; i++) {
+ TreeItem itemI = new TreeItem(tree, SWT.NONE);
+ itemI.setText("Item " + i);
+ for (int j = 0; j < 4; j++) {
+ TreeItem itemJ = new TreeItem(itemI, SWT.NONE);
+ itemJ.setText("Item " + i + " " + j);
+ for (int k = 0; k < 4; k++) {
+ TreeItem itemK = new TreeItem(itemJ, SWT.NONE);
+ itemK.setText("Item " + i + " " + j + " " + k);
+ }
+ }
+ }
Rectangle clientArea = shell.getClientArea();
- tree.setBounds(clientArea.x, clientArea.y, 200, 200);
- shell.pack();
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) display.sleep();
- }
- display.dispose();
+ tree.setBounds(clientArea.x, clientArea.y, 200, 200);
+ shell.pack();
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) display.sleep();
+ }
+ display.dispose();
}
}
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet282.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet282.java
index 78d352bd4f..014eaaecba 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet282.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet282.java
@@ -36,14 +36,14 @@ public class Snippet282 {
shell.setLayout(new GridLayout());
shell.setText("Clipboard ImageTransfer");
- final Button imageButton = new Button(shell, SWT.NONE );
- GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
- gd.minimumHeight = 400;
- gd.minimumWidth = 600;
- imageButton.setLayoutData(gd);
+ final Button imageButton = new Button(shell, SWT.NONE );
+ GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gd.minimumHeight = 400;
+ gd.minimumWidth = 600;
+ imageButton.setLayoutData(gd);
- final Text imageText = new Text(shell, SWT.BORDER);
- imageText.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
+ final Text imageText = new Text(shell, SWT.BORDER);
+ imageText.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
Composite buttons = new Composite(shell, SWT.NONE);
buttons.setLayout(new GridLayout(4, true));
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet304.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet304.java
index 77713048d7..ed9ccc9568 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet304.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet304.java
@@ -26,62 +26,62 @@ import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
public class Snippet304 {
- static Display display = null;
+ static Display display = null;
- public static void main(String[] args) {
- display = new Display();
- Shell shell = new Shell(display);
- shell.setText("Snippet 304");
+ public static void main(String[] args) {
+ display = new Display();
+ Shell shell = new Shell(display);
+ shell.setText("Snippet 304");
- shell.setLayout(new GridLayout());
- Text text = new Text(shell, SWT.MULTI | SWT.BORDER);
- text.setText("< cursor was there\na\nmulti\nline\ntext\nnow it's here >");
+ shell.setLayout(new GridLayout());
+ Text text = new Text(shell, SWT.MULTI | SWT.BORDER);
+ text.setText("< cursor was there\na\nmulti\nline\ntext\nnow it's here >");
- text.addKeyListener(new KeyListener() {
- @Override
+ text.addKeyListener(new KeyListener() {
+ @Override
public void keyPressed(KeyEvent e) {
- System.out.println("KeyDown " + e);
- }
- @Override
+ System.out.println("KeyDown " + e);
+ }
+ @Override
public void keyReleased(KeyEvent e) {
- System.out.println("KeyUp " + e);
- }
- });
+ System.out.println("KeyUp " + e);
+ }
+ });
- shell.pack();
- shell.open();
+ shell.pack();
+ shell.open();
- /*
- * Simulate the (platform specific) key sequence
- * to move the I-beam to the end of a text control.
- */
- new Thread(){
- @Override
+ /*
+ * Simulate the (platform specific) key sequence
+ * to move the I-beam to the end of a text control.
+ */
+ new Thread(){
+ @Override
public void run(){
- int key = SWT.END;
- String platform = SWT.getPlatform();
- if (platform.equals("cocoa") ) {
- key = SWT.ARROW_DOWN;
- }
- postEvent(SWT.MOD1, SWT.KeyDown);
- postEvent(key, SWT.KeyDown);
- postEvent(key, SWT.KeyUp);
- postEvent(SWT.MOD1, SWT.KeyUp);
- }
- }.start();
+ int key = SWT.END;
+ String platform = SWT.getPlatform();
+ if (platform.equals("cocoa") ) {
+ key = SWT.ARROW_DOWN;
+ }
+ postEvent(SWT.MOD1, SWT.KeyDown);
+ postEvent(key, SWT.KeyDown);
+ postEvent(key, SWT.KeyUp);
+ postEvent(SWT.MOD1, SWT.KeyUp);
+ }
+ }.start();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) {
- display.sleep();
- }
- }
- display.dispose();
- }
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) {
+ display.sleep();
+ }
+ }
+ display.dispose();
+ }
- public static void postEvent(int keyCode, int type) {
- Event event = new Event();
- event.type = type;
- event.keyCode = keyCode;
- display.post(event);
- }
+ public static void postEvent(int keyCode, int type) {
+ Event event = new Event();
+ event.type = type;
+ event.keyCode = keyCode;
+ display.post(event);
+ }
} \ No newline at end of file
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet333.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet333.java
index 95897df322..40006ba62a 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet333.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet333.java
@@ -104,9 +104,9 @@ public class Snippet333 {
}
protected static void setBackground(Display display, Control control) {
- Random randomGenerator = new Random();
- int nextColor = randomGenerator.nextInt(100) + randomGenerator.nextInt(100);
- control.setBackground(display.getSystemColor(colors[nextColor % colors.length]));
+ Random randomGenerator = new Random();
+ int nextColor = randomGenerator.nextInt(100) + randomGenerator.nextInt(100);
+ control.setBackground(display.getSystemColor(colors[nextColor % colors.length]));
}
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet334.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet334.java
index dc23b0dbf9..da1adae455 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet334.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet334.java
@@ -156,7 +156,7 @@ public static void main(String[] arg) {
if (index != -1) index++;
}
e.count = e.count < 0 ? Math.max(e.count, -lineCount) : Math.min(e.count, lineCount);
- index = 0;
+ index = 0;
int lastIndex = 0;
String[] lines = new String[lineCount];
for (int i = 0; i < lines.length; i++) {
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet336.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet336.java
index 5bf180c552..0797b0acaa 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet336.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet336.java
@@ -147,7 +147,7 @@ public static void main(String[] args) {
button.setText(images[i]);
button.addListener(SWT.Selection, listener3);
}
- shell.pack();
+ shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) display.sleep();
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet359.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet359.java
index 32025fdeae..4d80707b19 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet359.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet359.java
@@ -32,9 +32,9 @@ public class Snippet359 {
combo.addKeyListener(new KeyListener() {
@Override
public void keyReleased(KeyEvent e) {
- if (e.keyCode == SWT.CR) {
- combo.add(combo.getText());
- }
+ if (e.keyCode == SWT.CR) {
+ combo.add(combo.getText());
+ }
}
@Override
public void keyPressed(KeyEvent e) {
@@ -42,11 +42,11 @@ public class Snippet359 {
System.out.println("caret location: " + combo.getCaretLocation());
}
});
- shell.pack();
- shell.open ();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch ()) display.sleep ();
- }
- display.dispose ();
+ shell.pack();
+ shell.open ();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch ()) display.sleep ();
+ }
+ display.dispose ();
}
}
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet363.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet363.java
index ed14dc4436..23431a48cf 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet363.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet363.java
@@ -28,86 +28,86 @@ import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
public class Snippet363 {
- static final String errorMessage = "Error: Number expected.";
- static Label icon;
- static Image errorIcon;
- static Text liveLabel;
+ static final String errorMessage = "Error: Number expected.";
+ static Label icon;
+ static Image errorIcon;
+ static Text liveLabel;
public static void main(String [] args) {
- Display display = new Display();
- errorIcon = display.getSystemImage(SWT.ICON_ERROR);
- Shell shell = new Shell(display);
+ Display display = new Display();
+ errorIcon = display.getSystemImage(SWT.ICON_ERROR);
+ Shell shell = new Shell(display);
shell.setText("Snippet 363");
- shell.setLayout(new GridLayout(2, false));
- shell.setText("LiveRegion Test");
+ shell.setLayout(new GridLayout(2, false));
+ shell.setText("LiveRegion Test");
- icon = new Label(shell, SWT.NONE);
- icon.setLayoutData(new GridData(32, 32));
+ icon = new Label(shell, SWT.NONE);
+ icon.setLayoutData(new GridData(32, 32));
- liveLabel = new Text(shell, SWT.READ_ONLY);
- GC gc = new GC(liveLabel);
- Point pt = gc.textExtent(errorMessage);
- GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false);
- data.minimumWidth = (int) (pt.x + gc.getFontMetrics().getAverageCharacterWidth() * 2);
- gc.dispose();
- liveLabel.setLayoutData(data);
- liveLabel.setText("");
- liveLabel.getAccessible().addAccessibleAttributeListener(new AccessibleAttributeAdapter() {
- @Override
+ liveLabel = new Text(shell, SWT.READ_ONLY);
+ GC gc = new GC(liveLabel);
+ Point pt = gc.textExtent(errorMessage);
+ GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ data.minimumWidth = (int) (pt.x + gc.getFontMetrics().getAverageCharacterWidth() * 2);
+ gc.dispose();
+ liveLabel.setLayoutData(data);
+ liveLabel.setText("");
+ liveLabel.getAccessible().addAccessibleAttributeListener(new AccessibleAttributeAdapter() {
+ @Override
public void getAttributes(AccessibleAttributeEvent e) {
- e.attributes = new String[] {
- "container-live", "polite",
- "live", "polite",
- "container-live-role", "status",
- };
- }
- });
+ e.attributes = new String[] {
+ "container-live", "polite",
+ "live", "polite",
+ "container-live-role", "status",
+ };
+ }
+ });
- final Label textFieldLabel = new Label(shell, SWT.NONE);
- textFieldLabel.setText("Type a number:");
- textFieldLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+ final Label textFieldLabel = new Label(shell, SWT.NONE);
+ textFieldLabel.setText("Type a number:");
+ textFieldLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
- final Text textField = new Text(shell, SWT.SINGLE | SWT.BORDER);
- textField.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+ final Text textField = new Text(shell, SWT.SINGLE | SWT.BORDER);
+ textField.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
- final Button okButton = new Button(shell, SWT.PUSH);
- okButton.setText("OK");
- okButton.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false, 2, 1));
- okButton.setEnabled(false);
+ final Button okButton = new Button(shell, SWT.PUSH);
+ okButton.setText("OK");
+ okButton.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false, 2, 1));
+ okButton.setEnabled(false);
- textField.addModifyListener(e -> {
- boolean isNumber = false;
- String textValue = textField.getText();
- try {
- Integer.parseInt(textValue);
- isNumber = true;
- setMessageText(false, "Thank-you");
- } catch (NumberFormatException ex) {
- if (textValue.isEmpty()) {
- setMessageText(false, "");
- } else {
- setMessageText(true, "Error: Number expected.");
- }
- }
- okButton.setEnabled(isNumber);
+ textField.addModifyListener(e -> {
+ boolean isNumber = false;
+ String textValue = textField.getText();
+ try {
+ Integer.parseInt(textValue);
+ isNumber = true;
+ setMessageText(false, "Thank-you");
+ } catch (NumberFormatException ex) {
+ if (textValue.isEmpty()) {
+ setMessageText(false, "");
+ } else {
+ setMessageText(true, "Error: Number expected.");
+ }
+ }
+ okButton.setEnabled(isNumber);
});
- textField.setFocus();
- shell.pack();
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) display.sleep();
- }
- display.dispose();
+ textField.setFocus();
+ shell.pack();
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) display.sleep();
+ }
+ display.dispose();
}
static void setMessageText(boolean error, String newMessage) {
- String oldMessage = liveLabel.getText();
- icon.setImage(error ? errorIcon : null);
- liveLabel.setText(newMessage);
- liveLabel.getAccessible().sendEvent(ACC.EVENT_ATTRIBUTE_CHANGED, null);
- liveLabel.getAccessible().sendEvent(ACC.EVENT_TEXT_CHANGED, new Object[] {ACC.TEXT_DELETE, 0, oldMessage.length(), oldMessage});
- liveLabel.getAccessible().sendEvent(ACC.EVENT_TEXT_CHANGED, new Object[] {ACC.TEXT_INSERT, 0, newMessage.length(), newMessage});
+ String oldMessage = liveLabel.getText();
+ icon.setImage(error ? errorIcon : null);
+ liveLabel.setText(newMessage);
+ liveLabel.getAccessible().sendEvent(ACC.EVENT_ATTRIBUTE_CHANGED, null);
+ liveLabel.getAccessible().sendEvent(ACC.EVENT_TEXT_CHANGED, new Object[] {ACC.TEXT_DELETE, 0, oldMessage.length(), oldMessage});
+ liveLabel.getAccessible().sendEvent(ACC.EVENT_TEXT_CHANGED, new Object[] {ACC.TEXT_INSERT, 0, newMessage.length(), newMessage});
}
}
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet366.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet366.java
index becfd5c631..a4e0934a5d 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet366.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet366.java
@@ -26,8 +26,8 @@ import org.eclipse.swt.widgets.*;
* http://www.eclipse.org/swt/snippets/
*/
public class Snippet366 {
- static Display display;
- static Shell shell;
+ static Display display;
+ static Shell shell;
public static void main (String [] args) {
display = new Display();
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet5.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet5.java
index 7bfa3bd333..675028db06 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet5.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet5.java
@@ -28,36 +28,36 @@ public class Snippet5 {
public static void main (String [] args)
{
- Display display = new Display ();
- Shell shell = new Shell (display);
+ Display display = new Display ();
+ Shell shell = new Shell (display);
shell.setText("Snippet 5");
- shell.setLayout(new FillLayout());
+ shell.setLayout(new FillLayout());
- // this button is always 400 x 400. Scrollbars appear if the window is resized to be
- // too small to show part of the button
- ScrolledComposite c1 = new ScrolledComposite(shell, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
- Button b1 = new Button(c1, SWT.PUSH);
- b1.setText("fixed size button");
- b1.setSize(400, 400);
- c1.setContent(b1);
+ // this button is always 400 x 400. Scrollbars appear if the window is resized to be
+ // too small to show part of the button
+ ScrolledComposite c1 = new ScrolledComposite(shell, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
+ Button b1 = new Button(c1, SWT.PUSH);
+ b1.setText("fixed size button");
+ b1.setSize(400, 400);
+ c1.setContent(b1);
- // this button has a minimum size of 400 x 400. If the window is resized to be big
- // enough to show more than 400 x 400, the button will grow in size. If the window
- // is made too small to show 400 x 400, scrollbars will appear.
- ScrolledComposite c2 = new ScrolledComposite(shell, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
- Button b2 = new Button(c2, SWT.PUSH);
- b2.setText("expanding button");
- c2.setContent(b2);
- c2.setExpandHorizontal(true);
- c2.setExpandVertical(true);
- c2.setMinSize(400, 400);
+ // this button has a minimum size of 400 x 400. If the window is resized to be big
+ // enough to show more than 400 x 400, the button will grow in size. If the window
+ // is made too small to show 400 x 400, scrollbars will appear.
+ ScrolledComposite c2 = new ScrolledComposite(shell, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
+ Button b2 = new Button(c2, SWT.PUSH);
+ b2.setText("expanding button");
+ c2.setContent(b2);
+ c2.setExpandHorizontal(true);
+ c2.setExpandVertical(true);
+ c2.setMinSize(400, 400);
- shell.setSize(600, 300);
- shell.open ();
- while (!shell.isDisposed ()) {
- if (!display.readAndDispatch ()) display.sleep ();
- }
- display.dispose ();
+ shell.setSize(600, 300);
+ shell.open ();
+ while (!shell.isDisposed ()) {
+ if (!display.readAndDispatch ()) display.sleep ();
+ }
+ display.dispose ();
}
}
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet6.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet6.java
index 8bd72bad0a..96e13d8de4 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet6.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet6.java
@@ -28,36 +28,36 @@ import org.eclipse.swt.widgets.*;
public class Snippet6 {
public static void main (String [] args) {
- Display display = new Display ();
- final Shell shell = new Shell (display);
+ Display display = new Display ();
+ final Shell shell = new Shell (display);
shell.setText("Snippet 6");
- shell.setLayout(new GridLayout());
- final Composite c = new Composite(shell, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 3;
- c.setLayout(layout);
- for (int i = 0; i < 10; i++) {
- Button b = new Button(c, SWT.PUSH);
- b.setText("Button "+i);
- }
+ shell.setLayout(new GridLayout());
+ final Composite c = new Composite(shell, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 3;
+ c.setLayout(layout);
+ for (int i = 0; i < 10; i++) {
+ Button b = new Button(c, SWT.PUSH);
+ b.setText("Button "+i);
+ }
- Button b = new Button(shell, SWT.PUSH);
- b.setText("add a new button at row 2 column 1");
- final int[] index = new int[1];
- b.addListener(SWT.Selection, e -> {
- Button s = new Button(c, SWT.PUSH);
- s.setText("Special "+index[0]);
- index[0]++;
- Control[] children = c.getChildren();
- s.moveAbove(children[3]);
- shell.layout(new Control[] {s});
+ Button b = new Button(shell, SWT.PUSH);
+ b.setText("add a new button at row 2 column 1");
+ final int[] index = new int[1];
+ b.addListener(SWT.Selection, e -> {
+ Button s = new Button(c, SWT.PUSH);
+ s.setText("Special "+index[0]);
+ index[0]++;
+ Control[] children = c.getChildren();
+ s.moveAbove(children[3]);
+ shell.layout(new Control[] {s});
});
- shell.open ();
- while (!shell.isDisposed ()) {
- if (!display.readAndDispatch ()) display.sleep ();
- }
- display.dispose ();
+ shell.open ();
+ while (!shell.isDisposed ()) {
+ if (!display.readAndDispatch ()) display.sleep ();
+ }
+ display.dispose ();
}
}
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet81.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet81.java
index 5286557c8a..8f177d9008 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet81.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet81.java
@@ -76,17 +76,17 @@ private static void printTypeInfo(OleAutomation auto) {
if ( j < data.args.length - 1) argList += ", ";
}
System.out.println(getInvokeKind(data.invokeKind)+" (id = "+data.id+") : "
- +"\n\tSignature : "+getTypeName(data.returnType)+" "+data.name+"("+argList+")"
- +"\n\tDescription : "+data.documentation
- +"\n\tHelp File : "+data.helpFile+"\n");
+ +"\n\tSignature : "+getTypeName(data.returnType)+" "+data.name+"("+argList+")"
+ +"\n\tDescription : "+data.documentation
+ +"\n\tHelp File : "+data.helpFile+"\n");
}
if (typeattr.cVars > 0) System.out.println("\n\nVariables :\n");
for (int i = 0; i < typeattr.cVars; i++) {
OlePropertyDescription data = auto.getPropertyDescription(i);
System.out.println("PROPERTY (id = "+data.id+") :"
- +"\n\tName : "+data.name
- +"\n\tType : "+getTypeName(data.type)+"\n");
+ +"\n\tName : "+data.name
+ +"\n\tType : "+getTypeName(data.type)+"\n");
}
}
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug119157_ShellWithoutFocus.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug119157_ShellWithoutFocus.java
index b1603cbbca..01428899fe 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug119157_ShellWithoutFocus.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug119157_ShellWithoutFocus.java
@@ -30,41 +30,41 @@ import org.eclipse.swt.widgets.Text;
public class Bug119157_ShellWithoutFocus {
static Shell dialog = null;
public static void main(String[] args) {
- final Display display = new Display();
- final Shell main = new Shell(display);
- main.setLayout(new FillLayout());
- Button button = new Button(main, SWT.PUSH);
- button.setText("Press me");
- button.addListener(SWT.Selection, new Listener() {
- @Override
+ final Display display = new Display();
+ final Shell main = new Shell(display);
+ main.setLayout(new FillLayout());
+ Button button = new Button(main, SWT.PUSH);
+ button.setText("Press me");
+ button.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
- if (dialog == null) {
- dialog = new Shell(main);
- dialog.setLayout(new FillLayout());
- Text text = new Text(dialog, SWT.MULTI);
- text.setText("No focus");
- List list = new List(dialog, SWT.MULTI);
- list.add("Multi-select will");
- list.add("not work");
- list.add("the second time.");
- Button button = new Button(dialog, SWT.PUSH);
- button.setText("OK");
- button.addListener(SWT.Selection, new Listener() {
- @Override
+ if (dialog == null) {
+ dialog = new Shell(main);
+ dialog.setLayout(new FillLayout());
+ Text text = new Text(dialog, SWT.MULTI);
+ text.setText("No focus");
+ List list = new List(dialog, SWT.MULTI);
+ list.add("Multi-select will");
+ list.add("not work");
+ list.add("the second time.");
+ Button button = new Button(dialog, SWT.PUSH);
+ button.setText("OK");
+ button.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
- dialog.setVisible(false);
- }
- });
- dialog.setSize(400, 200);
- }
- dialog.setVisible(true);
- }
- });
- main.setSize(200, 200);
- main.open();
- while (!main.isDisposed()) {
- if (!display.readAndDispatch()) display.sleep();
- }
- display.dispose();
+ dialog.setVisible(false);
+ }
+ });
+ dialog.setSize(400, 200);
+ }
+ dialog.setVisible(true);
+ }
+ });
+ main.setSize(200, 200);
+ main.open();
+ while (!main.isDisposed()) {
+ if (!display.readAndDispatch()) display.sleep();
+ }
+ display.dispose();
}
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug123091_TableEditorRefresh.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug123091_TableEditorRefresh.java
index 6bb93c36c4..fc6323c3f6 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug123091_TableEditorRefresh.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug123091_TableEditorRefresh.java
@@ -23,44 +23,44 @@ import org.eclipse.swt.widgets.*;
* Displays a widget.table
*/
public class Bug123091_TableEditorRefresh {
- public static void main(String[] args) {
- new Bug123091_TableEditorRefresh().run();
- }
+ public static void main(String[] args) {
+ new Bug123091_TableEditorRefresh().run();
+ }
- public void run() {
- Display display = new Display();
- Shell shell = new Shell(display);
- shell.setLayout(new FillLayout());
- Table table = new Table(shell, SWT.MULTI | SWT.FULL_SELECTION);
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
- for (int i = 0; i < 6; i++) {
- TableColumn column = new TableColumn(table, SWT.NONE);
- column.setMoveable(true);
- column.setResizable(true);
- column.setWidth(100);
- }
+ public void run() {
+ Display display = new Display();
+ Shell shell = new Shell(display);
+ shell.setLayout(new FillLayout());
+ Table table = new Table(shell, SWT.MULTI | SWT.FULL_SELECTION);
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+ for (int i = 0; i < 6; i++) {
+ TableColumn column = new TableColumn(table, SWT.NONE);
+ column.setMoveable(true);
+ column.setResizable(true);
+ column.setWidth(100);
+ }
- for (int i = 0; i < 10; i++) {
- TableItem item = new TableItem(table, SWT.NONE);
- for (int j = 0; j < 5; j++) {
- item.setText(j, "Row " + i + ", Column " + j);
- }
- ProgressBar pbar = new ProgressBar(table, SWT.SMOOTH|SWT.RESIZE);
- pbar.setMinimum(0);
- pbar.setSelection(60);
- TableEditor editor = new TableEditor(table);
- editor.grabHorizontal = editor.grabVertical = true;
- editor.setEditor(pbar,item,5);
+ for (int i = 0; i < 10; i++) {
+ TableItem item = new TableItem(table, SWT.NONE);
+ for (int j = 0; j < 5; j++) {
+ item.setText(j, "Row " + i + ", Column " + j);
+ }
+ ProgressBar pbar = new ProgressBar(table, SWT.SMOOTH|SWT.RESIZE);
+ pbar.setMinimum(0);
+ pbar.setSelection(60);
+ TableEditor editor = new TableEditor(table);
+ editor.grabHorizontal = editor.grabVertical = true;
+ editor.setEditor(pbar,item,5);
- }
- shell.pack();
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) {
- display.sleep();
- }
- }
- display.dispose();
- }
+ }
+ shell.pack();
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) {
+ display.sleep();
+ }
+ }
+ display.dispose();
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug138265_SystemMemoryUsage.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug138265_SystemMemoryUsage.java
index 39532100a5..8d244b5d13 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug138265_SystemMemoryUsage.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug138265_SystemMemoryUsage.java
@@ -109,7 +109,7 @@ gridData.grabExcessVerticalSpace = true;
gridData.horizontalAlignment = SWT.FILL;
gridData.verticalAlignment = SWT.FILL;
return gridData;
- }
+ }
public static void main(String[] args) {
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug147320_ShellSetBounds.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug147320_ShellSetBounds.java
index 9876912ed4..340fbe974e 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug147320_ShellSetBounds.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug147320_ShellSetBounds.java
@@ -32,12 +32,12 @@ public class Bug147320_ShellSetBounds {
new Rectangle (240, 212, 800, 600)};
static int counter = 0;
public static void main(String[] args) {
- Display display = new Display();
- final Shell shell = new Shell(display, SWT.NONE);
- Button button = new Button(shell, SWT.PUSH);
- button.setBounds(10,10,50,30);
- button.setText("Push");
- button.addListener(SWT.Selection, new Listener() {
+ Display display = new Display();
+ final Shell shell = new Shell(display, SWT.NONE);
+ Button button = new Button(shell, SWT.PUSH);
+ button.setBounds(10,10,50,30);
+ button.setText("Push");
+ button.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event event) {
Rectangle bounds = DIMENSIONS[counter++];
@@ -46,11 +46,11 @@ public class Bug147320_ShellSetBounds {
shell.setBounds(bounds);
}
});
- shell.setBounds(DIMENSIONS[counter++]);
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) display.sleep();
- }
- display.dispose();
+ shell.setBounds(DIMENSIONS[counter++]);
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) display.sleep();
+ }
+ display.dispose();
}
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug150921_TextCaretPosition.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug150921_TextCaretPosition.java
index d29085748b..977ed64ffa 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug150921_TextCaretPosition.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug150921_TextCaretPosition.java
@@ -24,40 +24,40 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
public class Bug150921_TextCaretPosition {
-
- public static void main(String [] args) {
-
- Display display = new Display();
- Shell shell = new Shell(display);
- shell.setLayout(new GridLayout());
- Text single = new Text(shell, SWT.SINGLE | SWT.BORDER);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.heightHint = 20;
- gd.widthHint = 300;
- single.setLayoutData(gd);
- single.addModifyListener(new TestListener());
- Text multi = new Text(shell, SWT.MULTI | SWT.BORDER);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.heightHint = 100;
- gd.widthHint = 300;
- multi.setLayoutData(gd);
- multi.addModifyListener(new TestListener());
- shell.open();
- while (!shell.isDisposed ()) {
- if (!display.readAndDispatch ()) display.sleep ();
- }
- display.dispose ();
- }
-
- private static class TestListener implements ModifyListener {
+
+ public static void main(String [] args) {
+
+ Display display = new Display();
+ Shell shell = new Shell(display);
+ shell.setLayout(new GridLayout());
+ Text single = new Text(shell, SWT.SINGLE | SWT.BORDER);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.heightHint = 20;
+ gd.widthHint = 300;
+ single.setLayoutData(gd);
+ single.addModifyListener(new TestListener());
+ Text multi = new Text(shell, SWT.MULTI | SWT.BORDER);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.heightHint = 100;
+ gd.widthHint = 300;
+ multi.setLayoutData(gd);
+ multi.addModifyListener(new TestListener());
+ shell.open();
+ while (!shell.isDisposed ()) {
+ if (!display.readAndDispatch ()) display.sleep ();
+ }
+ display.dispose ();
+ }
+
+ private static class TestListener implements ModifyListener {
- @Override
+ @Override
public void modifyText(ModifyEvent e) {
- Text text = (Text) e.widget;
- System.out.println("Text: \"" + text.getText() +"\"");
- System.out.println("Caret Position:" + text.getCaretPosition());
- }
-
- }
+ Text text = (Text) e.widget;
+ System.out.println("Text: \"" + text.getText() +"\"");
+ System.out.println("Caret Position:" + text.getCaretPosition());
+ }
+
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug152916_ShellSetVisibleBounds.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug152916_ShellSetVisibleBounds.java
index a653a988cb..f1676b517a 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug152916_ShellSetVisibleBounds.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug152916_ShellSetVisibleBounds.java
@@ -19,17 +19,17 @@ import org.eclipse.swt.widgets.Shell;
public class Bug152916_ShellSetVisibleBounds {
public static void main(String[] args) {
- Display display = new Display();
-
- Shell shell = new Shell(display);
- shell.open();
- shell.setBounds(200, 200, 200, 200);
- System.out.println("1=" + shell.getBounds());
- shell.setVisible(false);
- System.out.println("2=" + shell.getBounds());
- shell.setVisible(true);
- System.out.println("3=" + shell.getBounds());
-
- display.dispose();
- }
+ Display display = new Display();
+
+ Shell shell = new Shell(display);
+ shell.open();
+ shell.setBounds(200, 200, 200, 200);
+ System.out.println("1=" + shell.getBounds());
+ shell.setVisible(false);
+ System.out.println("2=" + shell.getBounds());
+ shell.setVisible(true);
+ System.out.println("3=" + shell.getBounds());
+
+ display.dispose();
+ }
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug160691_SWTAWTShell.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug160691_SWTAWTShell.java
index 1dc4223169..d2c53ef4a4 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug160691_SWTAWTShell.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug160691_SWTAWTShell.java
@@ -31,26 +31,26 @@ import org.eclipse.swt.widgets.Shell;
public class Bug160691_SWTAWTShell {
public static void main(String[] args) {
- java.awt.Frame frame = new java.awt.Frame("AWT Frame");
- java.awt.Button button = new java.awt.Button("AWT Button");
- frame.add(button, java.awt.BorderLayout.NORTH);
- java.awt.Canvas canvas = new java.awt.Canvas();
- frame.add(canvas, java.awt.BorderLayout.CENTER);
+ java.awt.Frame frame = new java.awt.Frame("AWT Frame");
+ java.awt.Button button = new java.awt.Button("AWT Button");
+ frame.add(button, java.awt.BorderLayout.NORTH);
+ java.awt.Canvas canvas = new java.awt.Canvas();
+ frame.add(canvas, java.awt.BorderLayout.CENTER);
- frame.addNotify();
+ frame.addNotify();
- Display display = new Display();
- Shell shell = SWT_AWT.new_Shell(display, canvas);
- shell.setLayout(new FillLayout());
- Button swtButton = new Button(shell, SWT.PUSH);
- swtButton.setText("SWT Button");
+ Display display = new Display();
+ Shell shell = SWT_AWT.new_Shell(display, canvas);
+ shell.setLayout(new FillLayout());
+ Button swtButton = new Button(shell, SWT.PUSH);
+ swtButton.setText("SWT Button");
- frame.setBounds(20, 20, 300, 300);
- shell.layout();
- frame.setVisible(true);
+ frame.setBounds(20, 20, 300, 300);
+ shell.layout();
+ frame.setVisible(true);
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) display.sleep();
- }
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) display.sleep();
+ }
}
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug166720_TableEditorFlicker.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug166720_TableEditorFlicker.java
index 2b5eb1da57..ed39784b76 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug166720_TableEditorFlicker.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug166720_TableEditorFlicker.java
@@ -34,35 +34,35 @@ import org.eclipse.swt.widgets.Text;
*/
public class Bug166720_TableEditorFlicker {
public static void main(String[] args) {
- Display display = new Display ();
- Shell shell = new Shell (display);
- shell.setLayout (new GridLayout ());
- Table table = new Table (shell, SWT.BORDER | SWT.MULTI);
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.heightHint = 200;
- gd.widthHint = 200;
- table.setLayoutData(gd);
+ Display display = new Display ();
+ Shell shell = new Shell (display);
+ shell.setLayout (new GridLayout ());
+ Table table = new Table (shell, SWT.BORDER | SWT.MULTI);
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ gd.heightHint = 200;
+ gd.widthHint = 200;
+ table.setLayoutData(gd);
- TableColumn column = new TableColumn(table, SWT.NONE);
- column.setWidth (100);
- for (int i=0; i<100; i++) {
- new TableItem (table, SWT.NONE);
- }
- TableItem [] items = table.getItems ();
- for (int i=0; i<items.length; i++) {
- TableEditor editor = new TableEditor (table);
- editor = new TableEditor (table);
- Text text = new Text (table, SWT.NONE);
- text.setText("Text" + i);
- editor.grabHorizontal = true;
- editor.setEditor(text, items[i], 0);
- editor = new TableEditor (table);
- }
- shell.pack ();
- shell.open ();
- while (!shell.isDisposed ()) {
- if (!display.readAndDispatch ()) display.sleep ();
- }
- display.dispose ();
+ TableColumn column = new TableColumn(table, SWT.NONE);
+ column.setWidth (100);
+ for (int i=0; i<100; i++) {
+ new TableItem (table, SWT.NONE);
+ }
+ TableItem [] items = table.getItems ();
+ for (int i=0; i<items.length; i++) {
+ TableEditor editor = new TableEditor (table);
+ editor = new TableEditor (table);
+ Text text = new Text (table, SWT.NONE);
+ text.setText("Text" + i);
+ editor.grabHorizontal = true;
+ editor.setEditor(text, items[i], 0);
+ editor = new TableEditor (table);
+ }
+ shell.pack ();
+ shell.open ();
+ while (!shell.isDisposed ()) {
+ if (!display.readAndDispatch ()) display.sleep ();
+ }
+ display.dispose ();
}
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug185817_MouseListener.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug185817_MouseListener.java
index 6fbf199c5c..d082bcc924 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug185817_MouseListener.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug185817_MouseListener.java
@@ -40,31 +40,31 @@ import org.eclipse.swt.widgets.Text;
public class Bug185817_MouseListener {
public static void main(String[] args) {
- Display display = new Display();
- Shell shell = new Shell(display);
- shell.setLayout(new FillLayout());
- final Table table = new Table(shell, SWT.FULL_SELECTION | SWT.HIDE_SELECTION);
- TableColumn column1 = new TableColumn(table, SWT.NONE);
- TableColumn column2 = new TableColumn(table, SWT.NONE);
- for (int i = 0; i < 10; i++) {
- TableItem item = new TableItem(table, SWT.NONE);
- item.setText(new String[] {"item " + i, "edit this value"});
- }
- column1.pack();
- column2.pack();
-
- final TableEditor editor = new TableEditor(table);
- //The editor must have the same size as the cell and must
- //not be any smaller than 50 pixels.
- editor.horizontalAlignment = SWT.LEFT;
- editor.grabHorizontal = true;
- editor.minimumWidth = 50;
- // editing the second column
- final int EDITABLECOLUMN = 1;
-
- table.addMouseListener(new MouseListener() {
-
- @Override
+ Display display = new Display();
+ Shell shell = new Shell(display);
+ shell.setLayout(new FillLayout());
+ final Table table = new Table(shell, SWT.FULL_SELECTION | SWT.HIDE_SELECTION);
+ TableColumn column1 = new TableColumn(table, SWT.NONE);
+ TableColumn column2 = new TableColumn(table, SWT.NONE);
+ for (int i = 0; i < 10; i++) {
+ TableItem item = new TableItem(table, SWT.NONE);
+ item.setText(new String[] {"item " + i, "edit this value"});
+ }
+ column1.pack();
+ column2.pack();
+
+ final TableEditor editor = new TableEditor(table);
+ //The editor must have the same size as the cell and must
+ //not be any smaller than 50 pixels.
+ editor.horizontalAlignment = SWT.LEFT;
+ editor.grabHorizontal = true;
+ editor.minimumWidth = 50;
+ // editing the second column
+ final int EDITABLECOLUMN = 1;
+
+ table.addMouseListener(new MouseListener() {
+
+ @Override
public void mouseDoubleClick(MouseEvent e) {
// // Clean up any previous editor control
// Control oldEditor = editor.getEditor();
@@ -94,59 +94,59 @@ public static void main(String[] args) {
// }
//
// });
- }
+ }
- @Override
+ @Override
public void mouseDown(MouseEvent e) {
- if( e.count == 2 ) {
- System.err.println("STARTING UP THE EDITOR");
- // Clean up any previous editor control
- Control oldEditor = editor.getEditor();
- if (oldEditor != null) oldEditor.dispose();
-
- // Identify the selected row
- TableItem item = table.getItem(new Point(e.x,e.y));
- if (item == null) return;
-
- // The control that will be the editor must be a child of the Table
- Text newEditor = new Text(table, SWT.NONE);
- newEditor.setText(item.getText(EDITABLECOLUMN));
- newEditor.addModifyListener(me -> {
- Text text = (Text)editor.getEditor();
- editor.getItem().setText(EDITABLECOLUMN,text.getText());
+ if( e.count == 2 ) {
+ System.err.println("STARTING UP THE EDITOR");
+ // Clean up any previous editor control
+ Control oldEditor = editor.getEditor();
+ if (oldEditor != null) oldEditor.dispose();
+
+ // Identify the selected row
+ TableItem item = table.getItem(new Point(e.x,e.y));
+ if (item == null) return;
+
+ // The control that will be the editor must be a child of the Table
+ Text newEditor = new Text(table, SWT.NONE);
+ newEditor.setText(item.getText(EDITABLECOLUMN));
+ newEditor.addModifyListener(me -> {
+ Text text = (Text)editor.getEditor();
+ editor.getItem().setText(EDITABLECOLUMN,text.getText());
});
- newEditor.selectAll();
- newEditor.setFocus();
- editor.setEditor(newEditor, item, EDITABLECOLUMN);
- newEditor.addFocusListener(new FocusAdapter() {
+ newEditor.selectAll();
+ newEditor.setFocus();
+ editor.setEditor(newEditor, item, EDITABLECOLUMN);
+ newEditor.addFocusListener(new FocusAdapter() {
- @Override
+ @Override
public void focusLost(FocusEvent e) {
- System.err.println("LOOSING FOCUS");
- Control oldEditor = editor.getEditor();
- if (oldEditor != null) oldEditor.dispose();
- }
+ System.err.println("LOOSING FOCUS");
+ Control oldEditor = editor.getEditor();
+ if (oldEditor != null) oldEditor.dispose();
+ }
- });
- }
- }
+ });
+ }
+ }
- @Override
+ @Override
public void mouseUp(MouseEvent e) {
- // TODO Auto-generated method stub
+ // TODO Auto-generated method stub
- }
+ }
- });
+ });
- shell.setSize(300, 300);
- shell.open();
+ shell.setSize(300, 300);
+ shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- display.dispose();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ display.dispose();
}
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug186268_TableItemSetTextBottom.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug186268_TableItemSetTextBottom.java
index 8923f29498..2d1be91cfc 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug186268_TableItemSetTextBottom.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug186268_TableItemSetTextBottom.java
@@ -28,46 +28,46 @@ import org.eclipse.swt.widgets.TableItem;
public class Bug186268_TableItemSetTextBottom {
- static final int COUNT = 1000000;
+ static final int COUNT = 1000000;
- public static void main(String[] args) {
- Display display = new Display ();
- final Shell shell = new Shell (display);
- shell.setLayout (new RowLayout (SWT.VERTICAL));
- final Table table = new Table (shell, SWT.VIRTUAL | SWT.BORDER);
+ public static void main(String[] args) {
+ Display display = new Display ();
+ final Shell shell = new Shell (display);
+ shell.setLayout (new RowLayout (SWT.VERTICAL));
+ final Table table = new Table (shell, SWT.VIRTUAL | SWT.BORDER);
- table.addListener (SWT.SetData, new Listener () {
- @Override
+ table.addListener (SWT.SetData, new Listener () {
+ @Override
public void handleEvent (Event event) {
- TableItem item = (TableItem) event.item;
- int index = table.indexOf (item);
- long startTime = System.currentTimeMillis();
- item.setText ("Item " + index);
- long timeTaken = System.currentTimeMillis() - startTime;
- System.out.println ("row " + index + " took " + timeTaken +
+ TableItem item = (TableItem) event.item;
+ int index = table.indexOf (item);
+ long startTime = System.currentTimeMillis();
+ item.setText ("Item " + index);
+ long timeTaken = System.currentTimeMillis() - startTime;
+ System.out.println ("row " + index + " took " + timeTaken +
"ms");
- }
- });
- table.setLayoutData (new RowData (200, 200));
- Button button = new Button (shell, SWT.PUSH);
- button.setText ("Add Items");
- final Label label = new Label(shell, SWT.NONE);
- button.addListener (SWT.Selection, new Listener () {
- @Override
+ }
+ });
+ table.setLayoutData (new RowData (200, 200));
+ Button button = new Button (shell, SWT.PUSH);
+ button.setText ("Add Items");
+ final Label label = new Label(shell, SWT.NONE);
+ button.addListener (SWT.Selection, new Listener () {
+ @Override
public void handleEvent (Event event) {
- long t1 = System.currentTimeMillis ();
- table.setItemCount (COUNT);
- long t2 = System.currentTimeMillis ();
- label.setText ("Items: " + COUNT + ", Time: " + (t2 - t1) +
+ long t1 = System.currentTimeMillis ();
+ table.setItemCount (COUNT);
+ long t2 = System.currentTimeMillis ();
+ label.setText ("Items: " + COUNT + ", Time: " + (t2 - t1) +
" (ms)");
- shell.layout ();
- }
- });
- shell.pack ();
- shell.open ();
- while (!shell.isDisposed ()) {
- if (!display.readAndDispatch ()) display.sleep ();
- }
- display.dispose ();
- }
+ shell.layout ();
+ }
+ });
+ shell.pack ();
+ shell.open ();
+ while (!shell.isDisposed ()) {
+ if (!display.readAndDispatch ()) display.sleep ();
+ }
+ display.dispose ();
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug191137_ActiveSelectionLost.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug191137_ActiveSelectionLost.java
index ca2f148b0a..945842e181 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug191137_ActiveSelectionLost.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug191137_ActiveSelectionLost.java
@@ -26,10 +26,10 @@ import org.eclipse.swt.widgets.TableItem;
public class Bug191137_ActiveSelectionLost {
public static void main(String[] args) {
- Display display = new Display();
- Shell shell = new Shell(display);
- Table table = new Table(shell, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
-
+ Display display = new Display();
+ Shell shell = new Shell(display);
+ Table table = new Table(shell, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+
TableItem item1 = new TableItem(table, SWT.NONE);
item1.setText("First select this Item (click me first)");
TableItem item2 = new TableItem(table, SWT.NONE);
@@ -41,25 +41,25 @@ public class Bug191137_ActiveSelectionLost {
dItem.setText("Second select this item (notice first selection is gray)");
Button button = new Button(dTable, SWT.NONE);
button.setText("Third click me to dispose this widget.table.");
- button.setBounds(10,40,350,60);
- button.addMouseListener( new MouseListener(){
+ button.setBounds(10,40,350,60);
+ button.addMouseListener( new MouseListener(){
@Override
public void mouseDoubleClick(MouseEvent arg0) {}
@Override
public void mouseDown(MouseEvent arg0) {
- dTable.dispose();
+ dTable.dispose();
}
@Override
public void mouseUp(MouseEvent arg0) {}
- });
+ });
- table.setBounds(0,0,400,200);
+ table.setBounds(0,0,400,200);
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- display.dispose();
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ display.dispose();
}
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug197690_CVSWizard.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug197690_CVSWizard.java
index bf106ba246..bd363b0e3a 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug197690_CVSWizard.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug197690_CVSWizard.java
@@ -24,23 +24,23 @@ import org.eclipse.swt.widgets.Shell;
public class Bug197690_CVSWizard {
public static void main(String[] args) {
- final Display display = new Display();
- final Shell shell1 = new Shell(display);
- shell1.setLayout(new FillLayout());
- shell1.setBounds(10, 10, 300, 300);
- final DateTime dt = new DateTime(shell1, SWT.DATE);
- dt.addSelectionListener(new SelectionAdapter(){
- @Override
+ final Display display = new Display();
+ final Shell shell1 = new Shell(display);
+ shell1.setLayout(new FillLayout());
+ shell1.setBounds(10, 10, 300, 300);
+ final DateTime dt = new DateTime(shell1, SWT.DATE);
+ dt.addSelectionListener(new SelectionAdapter(){
+ @Override
public void widgetSelected(SelectionEvent e) {
- System.out.println(dt.getMonth());
- System.out.println(dt.getDay());
- System.out.println(dt.getYear());
- }
- });
- shell1.open();
- while (!shell1.isDisposed()) {
- if (!display.readAndDispatch()) display.sleep();
- }
- display.dispose();
+ System.out.println(dt.getMonth());
+ System.out.println(dt.getDay());
+ System.out.println(dt.getYear());
+ }
+ });
+ shell1.open();
+ while (!shell1.isDisposed()) {
+ if (!display.readAndDispatch()) display.sleep();
+ }
+ display.dispose();
}
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug197785_TextSelectionBehavior.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug197785_TextSelectionBehavior.java
index 727774c7e3..9efbf950c4 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug197785_TextSelectionBehavior.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug197785_TextSelectionBehavior.java
@@ -18,46 +18,46 @@ import org.eclipse.swt.widgets.*;
public class Bug197785_TextSelectionBehavior
{
- public static void main(String[] args)
- {
-
- final Display display = new Display();
- final Shell shell = new Shell(display);
- final Text text = new Text(shell, SWT.V_SCROLL | SWT.MULTI);
- text.setText("1\n2\n3\n4\n5\n6\n7\n8\n9\n10");
- text.setBounds(5, 5, 50, 50);
- Text text1 = new Text(shell, SWT.None);
- text1.setBounds(5, 100, 50, 50);
-
- Button b = new Button(shell, SWT.PUSH);
- b.setText("Push me");
- b.setBounds(5, 200, 50, 20);
- b.addListener(SWT.Selection, new Listener(){
- @Override
+ public static void main(String[] args)
+ {
+
+ final Display display = new Display();
+ final Shell shell = new Shell(display);
+ final Text text = new Text(shell, SWT.V_SCROLL | SWT.MULTI);
+ text.setText("1\n2\n3\n4\n5\n6\n7\n8\n9\n10");
+ text.setBounds(5, 5, 50, 50);
+ Text text1 = new Text(shell, SWT.None);
+ text1.setBounds(5, 100, 50, 50);
+
+ Button b = new Button(shell, SWT.PUSH);
+ b.setText("Push me");
+ b.setBounds(5, 200, 50, 20);
+ b.addListener(SWT.Selection, new Listener(){
+ @Override
public void handleEvent(Event e)
- {
-
- text.setSelection(10, 20);
- String test = "11\n12\n13\n14\n15";
- System.out.println(test);
- text.insert(test);
- // Alternative to try:
+ {
+
+ text.setSelection(10, 20);
+ String test = "11\n12\n13\n14\n15";
+ System.out.println(test);
+ text.insert(test);
+ // Alternative to try:
// widget.text.setSelection(0, text1.getCharCount());
- System.out.println("Caret line number " + text.getCaretLineNumber());
- System.out.println("Caret position " + text.getCaretPosition());
-
- }
- });
-
- shell.pack();
- shell.open();
- while (!shell.isDisposed())
- {
- if (!display.readAndDispatch())
- display.sleep();
- }
- display.dispose();
-
- }
+ System.out.println("Caret line number " + text.getCaretLineNumber());
+ System.out.println("Caret position " + text.getCaretPosition());
+
+ }
+ });
+
+ shell.pack();
+ shell.open();
+ while (!shell.isDisposed())
+ {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ display.dispose();
+
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug205199_LabelSetImageNull.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug205199_LabelSetImageNull.java
index c263b0d036..ac231374df 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug205199_LabelSetImageNull.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug205199_LabelSetImageNull.java
@@ -83,6 +83,6 @@ public class Bug205199_LabelSetImageNull
shell.open();
while (!shell.isDisposed())
if (!display.readAndDispatch())
- display.sleep();
- }
+ display.sleep();
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug210915_InvisibleShellLocation.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug210915_InvisibleShellLocation.java
index 30283e4515..8572ed3b32 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug210915_InvisibleShellLocation.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug210915_InvisibleShellLocation.java
@@ -27,59 +27,59 @@ import org.eclipse.swt.widgets.Shell;
public class Bug210915_InvisibleShellLocation {
public static void main(String[] args) {
- Display display = new Display();
- final Shell shell = new Shell(display);
- shell.setText("Main");
- shell.setLayout(new RowLayout());
+ Display display = new Display();
+ final Shell shell = new Shell(display);
+ shell.setText("Main");
+ shell.setLayout(new RowLayout());
- final Button button = new Button(shell, SWT.PUSH);
- button.setText("Show");
- button.addSelectionListener(new SelectionAdapter() {
- @Override
+ final Button button = new Button(shell, SWT.PUSH);
+ button.setText("Show");
+ button.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
- showHover(shell, button);
- }
- });
- shell.setBounds(100, 100, 300, 200);
+ showHover(shell, button);
+ }
+ });
+ shell.setBounds(100, 100, 300, 200);
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- display.dispose();
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ display.dispose();
}
static void showHover(final Shell shell, final Button button) {
- final Display display = shell.getDisplay();
- Rectangle bb = button.getBounds();
- final Point pos = button.toDisplay(bb.x, bb.y + bb.height + 5);
+ final Display display = shell.getDisplay();
+ Rectangle bb = button.getBounds();
+ final Point pos = button.toDisplay(bb.x, bb.y + bb.height + 5);
- final Shell hover = new Shell(shell, SWT.ON_TOP | SWT.NO_TRIM);
- hover.setBackground(display.getSystemColor(SWT.COLOR_YELLOW));
- hover.setBounds(-30000, 0, 100, 50);
- hover.setVisible(true);
+ final Shell hover = new Shell(shell, SWT.ON_TOP | SWT.NO_TRIM);
+ hover.setBackground(display.getSystemColor(SWT.COLOR_YELLOW));
+ hover.setBounds(-30000, 0, 100, 50);
+ hover.setVisible(true);
- display.asyncExec(() -> {
- System.out.println("before setLocation:" + hover.getLocation());
- hover.setLocation(pos);
- System.out.println("after setLocation:" + hover.getLocation());
+ display.asyncExec(() -> {
+ System.out.println("before setLocation:" + hover.getLocation());
+ hover.setLocation(pos);
+ System.out.println("after setLocation:" + hover.getLocation());
});
- display.timerExec(2000, () -> {
- Point loc = hover.getLocation();
- System.out.println("before setVisible(false): " + loc);
- hover.setVisible(false);
- Point loc2 = hover.getLocation();
- System.out.println("after setVisible(false): " + loc2);
+ display.timerExec(2000, () -> {
+ Point loc = hover.getLocation();
+ System.out.println("before setVisible(false): " + loc);
+ hover.setVisible(false);
+ Point loc2 = hover.getLocation();
+ System.out.println("after setVisible(false): " + loc2);
});
- display.timerExec(4000, () -> {
- Point loc = hover.getLocation();
- System.out.println("before setVisible(true): " + loc);
- hover.setVisible(true);
- Point loc2 = hover.getLocation();
- System.out.println("after setVisible(true): " + loc2);
+ display.timerExec(4000, () -> {
+ Point loc = hover.getLocation();
+ System.out.println("before setVisible(true): " + loc);
+ hover.setVisible(true);
+ Point loc2 = hover.getLocation();
+ System.out.println("after setVisible(true): " + loc2);
});
}
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug217324_ActivateEventDialog.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug217324_ActivateEventDialog.java
index a5bc424108..4abf7ad139 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug217324_ActivateEventDialog.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug217324_ActivateEventDialog.java
@@ -20,52 +20,52 @@ import org.eclipse.swt.widgets.*;
public class Bug217324_ActivateEventDialog
{
- public static void main(String[] args)
- {
- Display display = new Display();
- display.addFilter(SWT.Activate, new Listener()
- {
- @Override
+ public static void main(String[] args)
+ {
+ Display display = new Display();
+ display.addFilter(SWT.Activate, new Listener()
+ {
+ @Override
public void handleEvent(Event event)
- {
- System.out.println("activate: " + event);
- }
- });
+ {
+ System.out.println("activate: " + event);
+ }
+ });
- display.addFilter(SWT.Deactivate, new Listener()
- {
- @Override
+ display.addFilter(SWT.Deactivate, new Listener()
+ {
+ @Override
public void handleEvent(Event event)
- {
- System.out.println("deactivate: " + event);
- }
- });
+ {
+ System.out.println("deactivate: " + event);
+ }
+ });
- Shell shell = new Shell(display);
- shell.setText("Shell");
- shell.setSize(200, 200);
- System.out.println("before widget.shell open");
- shell.open();
- System.out.println("after widget.shell open");
+ Shell shell = new Shell(display);
+ shell.setText("Shell");
+ shell.setSize(200, 200);
+ System.out.println("before widget.shell open");
+ shell.open();
+ System.out.println("after widget.shell open");
- System.out.println("set visible false before");
- shell.setVisible(false);
- System.out.println("set visible false after");
+ System.out.println("set visible false before");
+ shell.setVisible(false);
+ System.out.println("set visible false after");
- Shell dialog = new Shell(shell);
- dialog.setText("Dialog");
- dialog.setSize(200, 200);
- System.out.println("before dialog open");
- dialog.open();
- System.out.println("after dialog open");
+ Shell dialog = new Shell(shell);
+ dialog.setText("Dialog");
+ dialog.setSize(200, 200);
+ System.out.println("before dialog open");
+ dialog.open();
+ System.out.println("after dialog open");
- // When dialog is closed no activate event
+ // When dialog is closed no activate event
- while (!shell.isDisposed())
- {
- if (!display.readAndDispatch())
- display.sleep();
- }
- display.dispose();
- }
+ while (!shell.isDisposed())
+ {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ display.dispose();
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug221240_AWTJVMCrash.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug221240_AWTJVMCrash.java
index dfa1d40876..0a5ef7ce73 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug221240_AWTJVMCrash.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug221240_AWTJVMCrash.java
@@ -45,81 +45,81 @@ public class Bug221240_AWTJVMCrash extends JFrame {
protected static final String LS = System.getProperty("line.separator");
- public Bug221240_AWTJVMCrash() {
- setDefaultCloseOperation(EXIT_ON_CLOSE);
- Canvas canvas = new Canvas() {
+ public Bug221240_AWTJVMCrash() {
+ setDefaultCloseOperation(EXIT_ON_CLOSE);
+ Canvas canvas = new Canvas() {
- private static final long serialVersionUID = -4380477744500979114L;
+ private static final long serialVersionUID = -4380477744500979114L;
@Override
- public void addNotify() {
- super.addNotify();
- final Canvas canvas_ = this;
- display.asyncExec(() -> {
- final Shell shell = SWT_AWT.new_Shell(display, canvas_);
- shell.setLayout(new FillLayout());
- Browser browser = new Browser(shell, SWT.NONE);
- browser.setText(
- "<html>" + LS +
- " <head>" + LS +
- " <script language=\"JavaScript\" type=\"widget.text/javascript\">" + LS +
- " <!--" + LS +
- " function getEmbeddedObject() {" + LS +
- " var movieName = \"myEmbeddedObject\";" + LS +
- " if(window.document[movieName]) {" + LS +
- " return window.document[movieName];" + LS +
- " }" + LS +
- " if(navigator.appName.indexOf(\"Microsoft Internet\") == -1) {" + LS +
- " if(document.embeds && document.embeds[movieName]) {" + LS +
- " return document.embeds[movieName];" + LS +
- " }" + LS +
- " } else {" + LS +
- " return document.getElementById(movieName);" + LS +
- " }" + LS +
- " }" + LS +
- " //-->" + LS +
- " </script>" + LS +
- " <style type=\"widget.text/css\">" + LS +
- " html, object, embed, div, body, widget.table { width: 100%; height: 100%; min-height: 100%; margin: 0; padding: 0; overflow: hidden; background-graphics.color: #FFFFFF; widget.text-align: center; }" + LS +
- " object, embed, div { position: absolute; left:0; top:0;}" + LS +
- " td { vertical-align: middle; }" + LS +
- " </style>" + LS +
- " </head>" + LS +
- " <body height=\"*\">" + LS +
- " <script language=\"JavaScript\" type=\"widget.text/javascript\">" + LS +
- " <!--" + LS +
- getVLCPlayer() +
- " var embeddedObject = getEmbeddedObject();" + LS +
- " embeddedObject.style.width = '100%';" + LS +
- " embeddedObject.style.height = '100%';" + LS +
- " //-->" + LS +
- " </script>" + LS +
- " </body>" + LS +
- "</html>" + LS);
- // The initial size is wrong so we have to force it
- shell.setSize(canvas_.getWidth(), canvas_.getHeight());
- });
- }
- };
- Container contentPane = getContentPane();
- JButton swingButton = new JButton("Open a file chooser!");
- swingButton.addActionListener(e -> new JFileChooser().showOpenDialog(Bug221240_AWTJVMCrash.this));
- contentPane.add(swingButton, BorderLayout.NORTH);
- contentPane.add(canvas, BorderLayout.CENTER);
- setSize(800, 600);
- }
+ public void addNotify() {
+ super.addNotify();
+ final Canvas canvas_ = this;
+ display.asyncExec(() -> {
+ final Shell shell = SWT_AWT.new_Shell(display, canvas_);
+ shell.setLayout(new FillLayout());
+ Browser browser = new Browser(shell, SWT.NONE);
+ browser.setText(
+ "<html>" + LS +
+ " <head>" + LS +
+ " <script language=\"JavaScript\" type=\"widget.text/javascript\">" + LS +
+ " <!--" + LS +
+ " function getEmbeddedObject() {" + LS +
+ " var movieName = \"myEmbeddedObject\";" + LS +
+ " if(window.document[movieName]) {" + LS +
+ " return window.document[movieName];" + LS +
+ " }" + LS +
+ " if(navigator.appName.indexOf(\"Microsoft Internet\") == -1) {" + LS +
+ " if(document.embeds && document.embeds[movieName]) {" + LS +
+ " return document.embeds[movieName];" + LS +
+ " }" + LS +
+ " } else {" + LS +
+ " return document.getElementById(movieName);" + LS +
+ " }" + LS +
+ " }" + LS +
+ " //-->" + LS +
+ " </script>" + LS +
+ " <style type=\"widget.text/css\">" + LS +
+ " html, object, embed, div, body, widget.table { width: 100%; height: 100%; min-height: 100%; margin: 0; padding: 0; overflow: hidden; background-graphics.color: #FFFFFF; widget.text-align: center; }" + LS +
+ " object, embed, div { position: absolute; left:0; top:0;}" + LS +
+ " td { vertical-align: middle; }" + LS +
+ " </style>" + LS +
+ " </head>" + LS +
+ " <body height=\"*\">" + LS +
+ " <script language=\"JavaScript\" type=\"widget.text/javascript\">" + LS +
+ " <!--" + LS +
+ getVLCPlayer() +
+ " var embeddedObject = getEmbeddedObject();" + LS +
+ " embeddedObject.style.width = '100%';" + LS +
+ " embeddedObject.style.height = '100%';" + LS +
+ " //-->" + LS +
+ " </script>" + LS +
+ " </body>" + LS +
+ "</html>" + LS);
+ // The initial size is wrong so we have to force it
+ shell.setSize(canvas_.getWidth(), canvas_.getHeight());
+ });
+ }
+ };
+ Container contentPane = getContentPane();
+ JButton swingButton = new JButton("Open a file chooser!");
+ swingButton.addActionListener(e -> new JFileChooser().showOpenDialog(Bug221240_AWTJVMCrash.this));
+ contentPane.add(swingButton, BorderLayout.NORTH);
+ contentPane.add(canvas, BorderLayout.CENTER);
+ setSize(800, 600);
+ }
- private String getVLCPlayer() {
+ private String getVLCPlayer() {
// String escapedURL = "http://80.118.196.219/webtv-asx.cgi?channel=nrj_hits";
// String escapedURL = "http://media.xored.com/eclipsecon2007/dltk-javascript-jdt.mov";
- String escapedURL = url != null ? url: "http://flv.thruhere.net/presentations/java-comes-home-customer-haase.flv";
- return
- "window.document.write('<object classid=\"clsid:E23FE9C6-778E-49D4-B537-38FCDE4887D8\" id=\"myEmbeddedObject\" codebase=\"http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab\" events=\"true\">');" + LS +
- "window.document.write(' <param name=\"Src\" value=\"' + decodeURIComponent('" + escapedURL + "') + '\";\"/>');" + LS +
- "window.document.write(' <embed name=\"myEmbeddedObject\" target=\"" + escapedURL + "\" type=\"application/x-vlc-plugin\" pluginspage=\"http://www.videolan.org\">');" + LS +
- "window.document.write(' </embed>');" + LS +
- "window.document.write('</object>');" + LS;
- }
+ String escapedURL = url != null ? url: "http://flv.thruhere.net/presentations/java-comes-home-customer-haase.flv";
+ return
+ "window.document.write('<object classid=\"clsid:E23FE9C6-778E-49D4-B537-38FCDE4887D8\" id=\"myEmbeddedObject\" codebase=\"http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab\" events=\"true\">');" + LS +
+ "window.document.write(' <param name=\"Src\" value=\"' + decodeURIComponent('" + escapedURL + "') + '\";\"/>');" + LS +
+ "window.document.write(' <embed name=\"myEmbeddedObject\" target=\"" + escapedURL + "\" type=\"application/x-vlc-plugin\" pluginspage=\"http://www.videolan.org\">');" + LS +
+ "window.document.write(' </embed>');" + LS +
+ "window.document.write('</object>');" + LS;
+ }
// private String getFlashPlayer() {
// String escapedURL = "http://www.freedominteractivedesign.com/swf/main.swf";
@@ -131,25 +131,25 @@ protected static final String LS = System.getProperty("line.separator");
// "window.document.write('</object>');" + LS;
// }
- private static Display display;
+ private static Display display;
- private static String url;
+ private static String url;
- public static void main(String[] args) {
- DeviceData data = new DeviceData();
- data.debug = true;
- display = new Display(data);
- Device.DEBUG = true;
- if(args.length > 0) {
- url = args[0];
- }
- System.setProperty("sun.awt.xembedserver", "true");
- SwingUtilities.invokeLater(() -> new Bug221240_AWTJVMCrash().setVisible(true));
- while(true) {
- if(!display.readAndDispatch()) {
- display.sleep();
- }
- }
- }
+ public static void main(String[] args) {
+ DeviceData data = new DeviceData();
+ data.debug = true;
+ display = new Display(data);
+ Device.DEBUG = true;
+ if(args.length > 0) {
+ url = args[0];
+ }
+ System.setProperty("sun.awt.xembedserver", "true");
+ SwingUtilities.invokeLater(() -> new Bug221240_AWTJVMCrash().setVisible(true));
+ while(true) {
+ if(!display.readAndDispatch()) {
+ display.sleep();
+ }
+ }
+ }
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug221955_BackgroundModeQT.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug221955_BackgroundModeQT.java
index fb03667a89..3fcbe085e6 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug221955_BackgroundModeQT.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug221955_BackgroundModeQT.java
@@ -29,58 +29,58 @@ import org.eclipse.swt.widgets.Shell;
public class Bug221955_BackgroundModeQT {
- public static void main( final String[] args ) {
- Display display = new Display();
- Shell shell = new Shell( display );
- shell.setText( "BackgroundMode" );
- createContent( shell );
- shell.pack();
- shell.open();
- while( !shell.isDisposed() ) {
- if( !display.readAndDispatch() )
- display.sleep();
- }
- display.dispose();
- }
+ public static void main( final String[] args ) {
+ Display display = new Display();
+ Shell shell = new Shell( display );
+ shell.setText( "BackgroundMode" );
+ createContent( shell );
+ shell.pack();
+ shell.open();
+ while( !shell.isDisposed() ) {
+ if( !display.readAndDispatch() )
+ display.sleep();
+ }
+ display.dispose();
+ }
- private static void createContent( final Composite parent ) {
- parent.setLayout( new GridLayout( 4, false ) );
- Color bgColor = parent.getDisplay().getSystemColor( SWT.COLOR_RED );
-
- Group group1 = new Group( parent, SWT.NONE );
- group1.setBackground( bgColor );
- group1.setBackgroundMode( SWT.INHERIT_NONE );
- group1.setText( "INHERIT_NONE" );
- createControls( group1 );
-
- Group group2 = new Group( parent, SWT.NONE );
- group2.setBackground( bgColor );
- group2.setBackgroundMode( SWT.INHERIT_DEFAULT );
- group2.setText( "INHERIT_DEFAULT" );
- createControls( group2 );
-
- Group group3 = new Group( parent, SWT.NONE );
- group3.setBackground( bgColor );
- group3.setBackgroundMode( SWT.INHERIT_FORCE );
- group3.setText( "INHERIT_FORCE" );
- createControls( group3 );
- }
+ private static void createContent( final Composite parent ) {
+ parent.setLayout( new GridLayout( 4, false ) );
+ Color bgColor = parent.getDisplay().getSystemColor( SWT.COLOR_RED );
+
+ Group group1 = new Group( parent, SWT.NONE );
+ group1.setBackground( bgColor );
+ group1.setBackgroundMode( SWT.INHERIT_NONE );
+ group1.setText( "INHERIT_NONE" );
+ createControls( group1 );
+
+ Group group2 = new Group( parent, SWT.NONE );
+ group2.setBackground( bgColor );
+ group2.setBackgroundMode( SWT.INHERIT_DEFAULT );
+ group2.setText( "INHERIT_DEFAULT" );
+ createControls( group2 );
+
+ Group group3 = new Group( parent, SWT.NONE );
+ group3.setBackground( bgColor );
+ group3.setBackgroundMode( SWT.INHERIT_FORCE );
+ group3.setText( "INHERIT_FORCE" );
+ createControls( group3 );
+ }
- private static void createControls( final Composite parent ) {
- parent.setLayout( new GridLayout() );
- Label label = new Label( parent, SWT.NONE );
- label.setText( "Test Label" );
- Label blueLabel = new Label( parent, SWT.NONE );
- blueLabel.setText( "Blue Label" );
- blueLabel.setBackground( parent.getDisplay().getSystemColor( SWT.COLOR_BLUE ) );
- CLabel clabel = new CLabel( parent, SWT.NONE );
- clabel.setText( "Test CLabel" );
- Button button = new Button( parent, SWT.PUSH );
- button.setText( "Test Button" );
- Button checkbox = new Button( parent, SWT.CHECK );
- checkbox.setText( "Test Checkbox" );
- List list = new List( parent, SWT.BORDER );
- list.add( "Test List" );
- list.add( "" );
- }
+ private static void createControls( final Composite parent ) {
+ parent.setLayout( new GridLayout() );
+ Label label = new Label( parent, SWT.NONE );
+ label.setText( "Test Label" );
+ Label blueLabel = new Label( parent, SWT.NONE );
+ blueLabel.setText( "Blue Label" );
+ blueLabel.setBackground( parent.getDisplay().getSystemColor( SWT.COLOR_BLUE ) );
+ CLabel clabel = new CLabel( parent, SWT.NONE );
+ clabel.setText( "Test CLabel" );
+ Button button = new Button( parent, SWT.PUSH );
+ button.setText( "Test Button" );
+ Button checkbox = new Button( parent, SWT.CHECK );
+ checkbox.setText( "Test Checkbox" );
+ List list = new List( parent, SWT.BORDER );
+ list.add( "Test List" );
+ list.add( "" );
+ }
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug221962_CTabFolderCorrupted.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug221962_CTabFolderCorrupted.java
index 5c036f2a12..6f18a8a512 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug221962_CTabFolderCorrupted.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug221962_CTabFolderCorrupted.java
@@ -40,9 +40,9 @@ public class Bug221962_CTabFolderCorrupted {
shell.pack();
shell.open();
while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) {
- display.sleep();
- }
+ if (!display.readAndDispatch()) {
+ display.sleep();
+ }
}
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug223864_ToolTipToolbarButton.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug223864_ToolTipToolbarButton.java
index 894368c462..f42a60f52d 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug223864_ToolTipToolbarButton.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug223864_ToolTipToolbarButton.java
@@ -23,33 +23,33 @@ import org.eclipse.swt.widgets.ToolItem;
public class Bug223864_ToolTipToolbarButton {
- public static void main(String[] args) {
- Display display= new Display();
- Shell parent= new Shell(display);
- parent.setText("Parent");
-
- Shell child= new Shell(parent, SWT.ON_TOP | SWT.SHELL_TRIM);
- GridLayout gridLayout= new GridLayout(1, false);
- child.setLayout(gridLayout);
- ToolBar bar= new ToolBar(child, SWT.NONE);
- ToolItem button= new ToolItem(bar, SWT.PUSH);
- button.setImage(display.getSystemImage(SWT.ICON_QUESTION));
- button.setToolTipText("Do you see me?");
+ public static void main(String[] args) {
+ Display display= new Display();
+ Shell parent= new Shell(display);
+ parent.setText("Parent");
+
+ Shell child= new Shell(parent, SWT.ON_TOP | SWT.SHELL_TRIM);
+ GridLayout gridLayout= new GridLayout(1, false);
+ child.setLayout(gridLayout);
+ ToolBar bar= new ToolBar(child, SWT.NONE);
+ ToolItem button= new ToolItem(bar, SWT.PUSH);
+ button.setImage(display.getSystemImage(SWT.ICON_QUESTION));
+ button.setToolTipText("Do you see me?");
- parent.setBounds(100, 100, 160, 100);
- child.setBounds(150, 150, 160, 100);
-
- parent.open();
-
- child.setVisible(true);
- child.setActive(); // comment this out and widget.tooltip appears...
- parent.setActive();
-
- while (!parent.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- display.dispose();
- }
+ parent.setBounds(100, 100, 160, 100);
+ child.setBounds(150, 150, 160, 100);
+
+ parent.open();
+
+ child.setVisible(true);
+ child.setActive(); // comment this out and widget.tooltip appears...
+ parent.setActive();
+
+ while (!parent.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ display.dispose();
+ }
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug225725_GCDrawing.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug225725_GCDrawing.java
index be9e4aa4d3..18bfaaa378 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug225725_GCDrawing.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug225725_GCDrawing.java
@@ -61,9 +61,9 @@ public class Bug225725_GCDrawing {
menuBarItem.setMenu(menu1);
shell.setMenuBar( menuBar );
-
+
ToolBar toolBar = new ToolBar(shell, SWT.FLAT | SWT.WRAP | SWT.RIGHT);
-
+
ToolItem item1 = new ToolItem(toolBar, SWT.PUSH);
item1.setText("Item1");
@@ -82,33 +82,33 @@ public class Bug225725_GCDrawing {
}
});
- final ScrollBar hBar = composite.getHorizontalBar();
- hBar.addListener(SWT.Selection, new Listener() {
- @Override
+ final ScrollBar hBar = composite.getHorizontalBar();
+ hBar.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event e) {
- composite.redraw();
- }
- });
-
- final ScrollBar vBar = composite.getVerticalBar();
- vBar.addListener(SWT.Selection, new Listener() {
- @Override
+ composite.redraw();
+ }
+ });
+
+ final ScrollBar vBar = composite.getVerticalBar();
+ vBar.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event e) {
- composite.redraw();
- }
- });
+ composite.redraw();
+ }
+ });
- composite.addControlListener(new ControlAdapter() {
- @Override
+ composite.addControlListener(new ControlAdapter() {
+ @Override
public void controlResized(ControlEvent arg0) {
- Rectangle bounds = composite.getBounds();
- Rectangle client = composite.getClientArea();
- ScrollBar hBar = composite.getHorizontalBar();
- ScrollBar vBar = composite.getVerticalBar();
- hBar.setMaximum(500);
- vBar.setMaximum(500);
- hBar.setThumb(Math.min(bounds.width, client.width));
- vBar.setThumb(Math.min(bounds.height, client.height));
+ Rectangle bounds = composite.getBounds();
+ Rectangle client = composite.getClientArea();
+ ScrollBar hBar = composite.getHorizontalBar();
+ ScrollBar vBar = composite.getVerticalBar();
+ hBar.setMaximum(500);
+ vBar.setMaximum(500);
+ hBar.setThumb(Math.min(bounds.width, client.width));
+ vBar.setThumb(Math.min(bounds.height, client.height));
}
});
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug230385_ControlSetGetSizeDiscrepancy.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug230385_ControlSetGetSizeDiscrepancy.java
index 6510dc90e4..3ef1f5c5a5 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug230385_ControlSetGetSizeDiscrepancy.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug230385_ControlSetGetSizeDiscrepancy.java
@@ -24,24 +24,24 @@ public class Bug230385_ControlSetGetSizeDiscrepancy {
public static void main(String[] args) {
- final Display display = new Display();
- final Shell shell = new Shell();
-
- shell.setSize(SIZE_X, SIZE_Y);
- shell.open();
-
- System.out.println("Size should be : " + SIZE_X + "x" + SIZE_Y);
- System.out.println("Size actually is: " + shell.getSize().x + "x" +
- shell.getSize().y + " [as returned by Control.getSize()]");
-
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) {
- display.sleep();
- }
- }
-
- display.dispose();
-
- }
+ final Display display = new Display();
+ final Shell shell = new Shell();
+
+ shell.setSize(SIZE_X, SIZE_Y);
+ shell.open();
+
+ System.out.println("Size should be : " + SIZE_X + "x" + SIZE_Y);
+ System.out.println("Size actually is: " + shell.getSize().x + "x" +
+ shell.getSize().y + " [as returned by Control.getSize()]");
+
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) {
+ display.sleep();
+ }
+ }
+
+ display.dispose();
+
+ }
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug249689_MeasureEventWrongBounds.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug249689_MeasureEventWrongBounds.java
index 5777c4d585..ee17041984 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug249689_MeasureEventWrongBounds.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug249689_MeasureEventWrongBounds.java
@@ -27,26 +27,26 @@ import org.eclipse.swt.widgets.TableItem;
public class Bug249689_MeasureEventWrongBounds {
public static void main(String[] args) {
- final Display display = new Display();
- Image image = new Image(display, "/home/ericwill/downloads/yrv9.png");
- Shell shell = new Shell(display);
- shell.setBounds(10,10,800,200);
- shell.setLayout(new FillLayout());
- final Table table = new Table(shell, SWT.CHECK);
- TableItem item = new TableItem(table, SWT.NONE);
- item.setText(new String[] {"a","a2"});
- table.addListener(SWT.MeasureItem, new Listener() {
- @Override
+ final Display display = new Display();
+ Image image = new Image(display, "/home/ericwill/downloads/yrv9.png");
+ Shell shell = new Shell(display);
+ shell.setBounds(10,10,800,200);
+ shell.setLayout(new FillLayout());
+ final Table table = new Table(shell, SWT.CHECK);
+ TableItem item = new TableItem(table, SWT.NONE);
+ item.setText(new String[] {"a","a2"});
+ table.addListener(SWT.MeasureItem, new Listener() {
+ @Override
public void handleEvent(Event event) {
- event.gc.setForeground(display.getSystemColor(SWT.COLOR_RED));
- event.gc.drawRectangle(event.x, event.y, event.width, event.height);
- }
- });
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) display.sleep();
- }
- image.dispose();
- display.dispose();
+ event.gc.setForeground(display.getSystemColor(SWT.COLOR_RED));
+ event.gc.drawRectangle(event.x, event.y, event.width, event.height);
+ }
+ });
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) display.sleep();
+ }
+ image.dispose();
+ display.dispose();
}
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug251354_TabItemToolTip.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug251354_TabItemToolTip.java
index b74b09f045..4f83ba6466 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug251354_TabItemToolTip.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug251354_TabItemToolTip.java
@@ -19,54 +19,54 @@ import org.eclipse.swt.widgets.*;
import org.eclipse.swt.layout.*;
public class Bug251354_TabItemToolTip {
- public void run() {
- Display display = new Display();
- Shell shell = new Shell(display);
- shell.setLayout(new GridLayout());
- shell.setText("Show ToolTips");
- shell.setToolTipText("Shell");
- create(shell);
- shell.pack();
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) {
- display.sleep();
- }
- }
- display.dispose();
- }
- private void create(Shell shell) {
- final TabFolder tabFolder1 = new TabFolder(shell, SWT.NONE);
- tabFolder1.setToolTipText("Tabfolder1");
- Text text = new Text(tabFolder1, SWT.BORDER);
- text.setToolTipText("Text");
- for (int i = 0; i < 4; i++)
- {
- TabItem item = new TabItem(tabFolder1, SWT.CLOSE);
- item.setText("Item "+i);
- item.setControl(text);
- item.setToolTipText("Item "+i);
- }
+ public void run() {
+ Display display = new Display();
+ Shell shell = new Shell(display);
+ shell.setLayout(new GridLayout());
+ shell.setText("Show ToolTips");
+ shell.setToolTipText("Shell");
+ create(shell);
+ shell.pack();
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) {
+ display.sleep();
+ }
+ }
+ display.dispose();
+ }
+ private void create(Shell shell) {
+ final TabFolder tabFolder1 = new TabFolder(shell, SWT.NONE);
+ tabFolder1.setToolTipText("Tabfolder1");
+ Text text = new Text(tabFolder1, SWT.BORDER);
+ text.setToolTipText("Text");
+ for (int i = 0; i < 4; i++)
+ {
+ TabItem item = new TabItem(tabFolder1, SWT.CLOSE);
+ item.setText("Item "+i);
+ item.setControl(text);
+ item.setToolTipText("Item "+i);
+ }
- final TabFolder tabFolder = new TabFolder(shell, SWT.NONE);
- TabItem one = new TabItem(tabFolder, SWT.NONE);
- one.setText("Tab 1");
+ final TabFolder tabFolder = new TabFolder(shell, SWT.NONE);
+ TabItem one = new TabItem(tabFolder, SWT.NONE);
+ one.setText("Tab 1");
// one.setToolTipText("This is Tab 1.");
-
- TabItem two = new TabItem(tabFolder, SWT.NONE);
- two.setText("Tab 2");
+
+ TabItem two = new TabItem(tabFolder, SWT.NONE);
+ two.setText("Tab 2");
// two.setToolTipText("This is Tab 2.");
-
- TabItem three = new TabItem(tabFolder, SWT.NONE);
- three.setText("Tab 3");
- three.setToolTipText("This is Tab 3.");
-
- TabItem four = new TabItem(tabFolder, SWT.NONE);
- four.setText("Tab 4");
- four.setToolTipText("This is Tab 4.");
-
- }
- public static void main(String[] args) {
- new Bug251354_TabItemToolTip().run();
- }
+
+ TabItem three = new TabItem(tabFolder, SWT.NONE);
+ three.setText("Tab 3");
+ three.setToolTipText("This is Tab 3.");
+
+ TabItem four = new TabItem(tabFolder, SWT.NONE);
+ four.setText("Tab 4");
+ four.setToolTipText("This is Tab 4.");
+
+ }
+ public static void main(String[] args) {
+ new Bug251354_TabItemToolTip().run();
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug258196_VirtualTreeResizing.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug258196_VirtualTreeResizing.java
index 5eea49ce4c..955375513f 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug258196_VirtualTreeResizing.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug258196_VirtualTreeResizing.java
@@ -22,33 +22,33 @@ import org.eclipse.swt.widgets.TreeItem;
public class Bug258196_VirtualTreeResizing {
public static void main(String[] args) {
- final Display display = new Display();
- final Shell shell = new Shell(display);
- shell.setLayout (new FillLayout());
- final Tree tree = new Tree(shell, SWT.VIRTUAL | SWT.BORDER);
- tree.addListener(SWT.SetData, event -> {
- final TreeItem item = (TreeItem)event.item;
- TreeItem parentItem = item.getParentItem();
- String text = null;
- if (parentItem == null) {
- text = "node "+tree.indexOf(item);
- } else {
- text = parentItem.getText()+" - "+parentItem.indexOf(item);
- }
- item.setData(text);
- item.setItemCount(10);
- display.asyncExec(() -> {
- if (!item.isDisposed()) {
- item.setText(item.getData().toString());
- }
+ final Display display = new Display();
+ final Shell shell = new Shell(display);
+ shell.setLayout (new FillLayout());
+ final Tree tree = new Tree(shell, SWT.VIRTUAL | SWT.BORDER);
+ tree.addListener(SWT.SetData, event -> {
+ final TreeItem item = (TreeItem)event.item;
+ TreeItem parentItem = item.getParentItem();
+ String text = null;
+ if (parentItem == null) {
+ text = "node "+tree.indexOf(item);
+ } else {
+ text = parentItem.getText()+" - "+parentItem.indexOf(item);
+ }
+ item.setData(text);
+ item.setItemCount(10);
+ display.asyncExec(() -> {
+ if (!item.isDisposed()) {
+ item.setText(item.getData().toString());
+ }
});
});
- tree.setItemCount(20);
- shell.setSize(400, 300);
- shell.open();
- while (!shell.isDisposed ()) {
- if (!display.readAndDispatch ()) display.sleep ();
- }
- display.dispose ();
- }
+ tree.setItemCount(20);
+ shell.setSize(400, 300);
+ shell.open();
+ while (!shell.isDisposed ()) {
+ if (!display.readAndDispatch ()) display.sleep ();
+ }
+ display.dispose ();
+ }
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug261288_TreeBGColor.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug261288_TreeBGColor.java
index 6a185c5c51..e72cd9bd75 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug261288_TreeBGColor.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug261288_TreeBGColor.java
@@ -20,26 +20,26 @@ import org.eclipse.swt.widgets.*;
public class Bug261288_TreeBGColor {
- public static void main( final String[] args ) {
- Display display = new Display();
- Shell shell = new Shell( display );
- shell.setLayout( new FillLayout() );
+ public static void main( final String[] args ) {
+ Display display = new Display();
+ Shell shell = new Shell( display );
+ shell.setLayout( new FillLayout() );
- Tree tree = new Tree( shell, SWT.BORDER | SWT.SINGLE );
- TreeItem rootItem = new TreeItem( tree, SWT.NONE );
- rootItem.setText( "Root" );
- for( int i = 0; i < 5; i++ ) {
- TreeItem item = new TreeItem( rootItem, SWT.NONE );
- item.setText( "Node " + ( i + 1 ) );
- }
- tree.setBackground( display.getSystemColor( SWT.COLOR_RED ) );
+ Tree tree = new Tree( shell, SWT.BORDER | SWT.SINGLE );
+ TreeItem rootItem = new TreeItem( tree, SWT.NONE );
+ rootItem.setText( "Root" );
+ for( int i = 0; i < 5; i++ ) {
+ TreeItem item = new TreeItem( rootItem, SWT.NONE );
+ item.setText( "Node " + ( i + 1 ) );
+ }
+ tree.setBackground( display.getSystemColor( SWT.COLOR_RED ) );
- shell.setSize( 400, 300 );
- shell.open();
- while( !shell.isDisposed() ) {
- if( !display.readAndDispatch() )
- display.sleep();
- }
- display.dispose();
- }
+ shell.setSize( 400, 300 );
+ shell.open();
+ while( !shell.isDisposed() ) {
+ if( !display.readAndDispatch() )
+ display.sleep();
+ }
+ display.dispose();
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug262974_ModalBrowserDialog.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug262974_ModalBrowserDialog.java
index 67598c9c59..92201b1f76 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug262974_ModalBrowserDialog.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug262974_ModalBrowserDialog.java
@@ -43,46 +43,46 @@ public class Bug262974_ModalBrowserDialog extends JFrame {
public Bug262974_ModalBrowserDialog() {
- setDefaultCloseOperation(EXIT_ON_CLOSE);
- Canvas canvas = new Canvas() {
+ setDefaultCloseOperation(EXIT_ON_CLOSE);
+ Canvas canvas = new Canvas() {
private static final long serialVersionUID = -8128631529339936684L;
@Override
- public void addNotify() {
- super.addNotify();
- final Canvas canvas_ = this;
- display.asyncExec(() -> {
- final Shell shell = SWT_AWT.new_Shell(display, canvas_);
- shell.setLayout(new FillLayout());
- final Browser browser = new Browser(shell, SWT.NONE);
- browser.setUrl("http://www.google.com");
- browser.addLocationListener(LocationListener.changedAdapter(e ->
- display.asyncExec(() -> browser.execute("alert('some dialog');")))
- );
- // The initial size is wrong on Windows so we have to force it
- shell.setSize(canvas_.getWidth(), canvas_.getHeight());
- });
- }
- };
- Container contentPane = getContentPane();
- contentPane.add(canvas, BorderLayout.CENTER);
- contentPane.add(new JButton("Some Swing Button"), BorderLayout.SOUTH);
- setSize(400, 300);
- }
+ public void addNotify() {
+ super.addNotify();
+ final Canvas canvas_ = this;
+ display.asyncExec(() -> {
+ final Shell shell = SWT_AWT.new_Shell(display, canvas_);
+ shell.setLayout(new FillLayout());
+ final Browser browser = new Browser(shell, SWT.NONE);
+ browser.setUrl("http://www.google.com");
+ browser.addLocationListener(LocationListener.changedAdapter(e ->
+ display.asyncExec(() -> browser.execute("alert('some dialog');")))
+ );
+ // The initial size is wrong on Windows so we have to force it
+ shell.setSize(canvas_.getWidth(), canvas_.getHeight());
+ });
+ }
+ };
+ Container contentPane = getContentPane();
+ contentPane.add(canvas, BorderLayout.CENTER);
+ contentPane.add(new JButton("Some Swing Button"), BorderLayout.SOUTH);
+ setSize(400, 300);
+ }
- private static Display display;
+ private static Display display;
- public static void main(String[] args) {
- System.setProperty("sun.awt.noerasebackground", "true");
- System.setProperty("sun.awt.xembedserver", "true");
- display = new Display();
- SwingUtilities.invokeLater(() -> new Bug262974_ModalBrowserDialog().setVisible(true));
- while(true) {
- if(!display.readAndDispatch()) {
- display.sleep();
- }
- }
- }
+ public static void main(String[] args) {
+ System.setProperty("sun.awt.noerasebackground", "true");
+ System.setProperty("sun.awt.xembedserver", "true");
+ display = new Display();
+ SwingUtilities.invokeLater(() -> new Bug262974_ModalBrowserDialog().setVisible(true));
+ while(true) {
+ if(!display.readAndDispatch()) {
+ display.sleep();
+ }
+ }
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug278882_ToolBarBackgroundImageTest.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug278882_ToolBarBackgroundImageTest.java
index 034ddbc37d..6d015ca050 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug278882_ToolBarBackgroundImageTest.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug278882_ToolBarBackgroundImageTest.java
@@ -51,15 +51,15 @@ public class Bug278882_ToolBarBackgroundImageTest {
if (originalImage != null) {
originalImage.dispose();
}
- }
+ }
});
shell.setSize( 400, 300 );
shell.open();
while( !shell.isDisposed() ) {
- if( !display.readAndDispatch() )
- display.sleep();
- }
- display.dispose();
+ if( !display.readAndDispatch() )
+ display.sleep();
+ }
+ display.dispose();
}
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug286244_ShellActivateLoop.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug286244_ShellActivateLoop.java
index b33413c383..52d9bbf367 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug286244_ShellActivateLoop.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug286244_ShellActivateLoop.java
@@ -19,42 +19,42 @@ import org.eclipse.swt.widgets.*;
public class Bug286244_ShellActivateLoop {
- public static void main(String[] args) {
- final Display display= new Display();
- final Shell shell= new Shell(display);
- shell.addShellListener(new ShellAdapter() {
- @Override
+ public static void main(String[] args) {
+ final Display display= new Display();
+ final Shell shell= new Shell(display);
+ shell.addShellListener(new ShellAdapter() {
+ @Override
public void shellDeactivated(ShellEvent e) {
- System.out.println("shellDeactivated()");
- display.timerExec(2000, new Runnable() {
- @Override
+ System.out.println("shellDeactivated()");
+ display.timerExec(2000, new Runnable() {
+ @Override
public void run() {
- System.out.println("forcing active");
- shell.forceActive();
- System.out.println("widget.shell is active: "
- + (display.getActiveShell() == shell));
- System.out.println("forced active");
- try {
- Thread.sleep(5000);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- });
- }
+ System.out.println("forcing active");
+ shell.forceActive();
+ System.out.println("widget.shell is active: "
+ + (display.getActiveShell() == shell));
+ System.out.println("forced active");
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ });
+ }
- @Override
+ @Override
public void shellActivated(ShellEvent e) {
- System.out.println("shellActivated()");
- }
- });
+ System.out.println("shellActivated()");
+ }
+ });
- shell.setSize(160, 100);
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- display.dispose();
- }
+ shell.setSize(160, 100);
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ display.dispose();
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug287038_TableKeyEvent.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug287038_TableKeyEvent.java
index ca99307a32..25c7966897 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug287038_TableKeyEvent.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug287038_TableKeyEvent.java
@@ -32,43 +32,43 @@ import org.eclipse.swt.widgets.TableItem;
* GTK Version(s): GTK2.x, GTK3.x
*/
public class Bug287038_TableKeyEvent {
- public static void main(String[] args) {
- Display display = new Display();
- Shell shell = new Shell(display);
- shell.setLayout(new FillLayout());
- final Table table = new Table(shell, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
- table.setLinesVisible(true);
- for (int i = 0; i < 2; i++) {
- TableColumn column = new TableColumn(table, SWT.NONE);
- column.setWidth(100);
- }
- String[] itemsToAdd = new String[] {
- "Cheese", "Potatoes", "Rocks", "Bacon", "Tree", "Forest", "Chocolate", "Broccoli", "Turnip",
- "Squash", "Carrot"
- };
- int i = 0;
- for (String s : itemsToAdd) {
- TableItem item = new TableItem(table, SWT.NONE);
- item.setText(new String[] {
- s, "" + i++
- });
- }
- table.addKeyListener(new KeyListener() {
- @Override
+ public static void main(String[] args) {
+ Display display = new Display();
+ Shell shell = new Shell(display);
+ shell.setLayout(new FillLayout());
+ final Table table = new Table(shell, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
+ table.setLinesVisible(true);
+ for (int i = 0; i < 2; i++) {
+ TableColumn column = new TableColumn(table, SWT.NONE);
+ column.setWidth(100);
+ }
+ String[] itemsToAdd = new String[] {
+ "Cheese", "Potatoes", "Rocks", "Bacon", "Tree", "Forest", "Chocolate", "Broccoli", "Turnip",
+ "Squash", "Carrot"
+ };
+ int i = 0;
+ for (String s : itemsToAdd) {
+ TableItem item = new TableItem(table, SWT.NONE);
+ item.setText(new String[] {
+ s, "" + i++
+ });
+ }
+ table.addKeyListener(new KeyListener() {
+ @Override
public void keyPressed(KeyEvent e) {
- System.out.println(e.character);
- }
+ System.out.println(e.character);
+ }
- @Override
+ @Override
public void keyReleased(KeyEvent e) {
- System.out.println(e.character);
- }
- });
- shell.pack();
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) display.sleep();
- }
- display.dispose();
- }
+ System.out.println(e.character);
+ }
+ });
+ shell.pack();
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) display.sleep();
+ }
+ display.dispose();
+ }
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug290650_FillLayoutComputeSize.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug290650_FillLayoutComputeSize.java
index a1cc03e8be..00c0d975ba 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug290650_FillLayoutComputeSize.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug290650_FillLayoutComputeSize.java
@@ -32,48 +32,48 @@ import org.eclipse.swt.widgets.Text;
* GTK Version(s): GTK2.x, GTK3.x
*/
public class Bug290650_FillLayoutComputeSize {
- private static int margin = 100;
- private static String msg = "This is a message with 2 lines and some text";
+ private static int margin = 100;
+ private static String msg = "This is a message with 2 lines and some text";
- private static void init(Shell shell) {
- Composite container1 = new Composite(shell, SWT.NONE);
- FillLayout fillLayout1 = new FillLayout();
- fillLayout1.marginWidth = margin;
- container1.setLayout(fillLayout1);
- container1.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
+ private static void init(Shell shell) {
+ Composite container1 = new Composite(shell, SWT.NONE);
+ FillLayout fillLayout1 = new FillLayout();
+ fillLayout1.marginWidth = margin;
+ container1.setLayout(fillLayout1);
+ container1.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
- Text text1 = new Text(container1, SWT.WRAP);
- text1.setText(msg);
+ Text text1 = new Text(container1, SWT.WRAP);
+ text1.setText(msg);
- Point containerSize1 = container1.computeSize(shell.getClientArea().width, SWT.DEFAULT);
- container1.setSize(containerSize1);
+ Point containerSize1 = container1.computeSize(shell.getClientArea().width, SWT.DEFAULT);
+ container1.setSize(containerSize1);
- Composite container2 = new Composite(shell, SWT.NONE);
- container2.setLocation(margin, 50);
- FillLayout fillLayout2 = new FillLayout();
- container2.setLayout(fillLayout2);
- container2.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
+ Composite container2 = new Composite(shell, SWT.NONE);
+ container2.setLocation(margin, 50);
+ FillLayout fillLayout2 = new FillLayout();
+ container2.setLayout(fillLayout2);
+ container2.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
- Text text2 = new Text(container2, SWT.WRAP);
- text2.setText(msg);
+ Text text2 = new Text(container2, SWT.WRAP);
+ text2.setText(msg);
- Point containerSize2 = container2.computeSize(shell.getClientArea().width-2*margin, SWT.DEFAULT);
- container2.setSize(containerSize2);
+ Point containerSize2 = container2.computeSize(shell.getClientArea().width-2*margin, SWT.DEFAULT);
+ container2.setSize(containerSize2);
- }
+ }
- public static void main(String[] args) {
- final Display display = new Display();
- Shell shell = new Shell(display);
- shell.setText("Fill Layout with Text-Widget Test");
- shell.setSize(190 + 2 * margin, 400);
- init(shell);
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- display.dispose();
- }
+ public static void main(String[] args) {
+ final Display display = new Display();
+ Shell shell = new Shell(display);
+ shell.setText("Fill Layout with Text-Widget Test");
+ shell.setSize(190 + 2 * margin, 400);
+ init(shell);
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ display.dispose();
+ }
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug291073_CrashWhenPrintingToConsole.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug291073_CrashWhenPrintingToConsole.java
index 8f867aaaf1..01fa1df058 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug291073_CrashWhenPrintingToConsole.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug291073_CrashWhenPrintingToConsole.java
@@ -35,12 +35,12 @@ public class Bug291073_CrashWhenPrintingToConsole {
final TextLayout layout = new TextLayout(display);
TextStyle style1 = new TextStyle(font1, yellow, blue);
- BitSet bs = new BitSet();
- bs.set(2894298, true);
- bs.set(324832893, true);
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- ObjectOutputStream oos = new ObjectOutputStream(out);
- oos.writeObject(bs);
+ BitSet bs = new BitSet();
+ bs.set(2894298, true);
+ bs.set(324832893, true);
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new ObjectOutputStream(out);
+ oos.writeObject(bs);
layout.setText(out.toString());
System.out.println("length:"+out.toString());
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug292413_MissingSWTFocused.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug292413_MissingSWTFocused.java
index 006dd287e3..c7dae4bbad 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug292413_MissingSWTFocused.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug292413_MissingSWTFocused.java
@@ -26,36 +26,36 @@ import org.eclipse.swt.widgets.TreeItem;
public class Bug292413_MissingSWTFocused {
public static void main(String[] args) {
- final Display display = new Display();
- final Shell shell = new Shell(display);
- shell.setBounds(10,10,200,200);
- shell.setLayout(new FillLayout());
- final Tree tree = new Tree(shell, SWT.MULTI);
- for (int i = 0; i < 9; i++) {
- new TreeItem(tree, SWT.NONE).setText("item " + i);
- }
- tree.addListener(SWT.EraseItem, new Listener() {
- @Override
+ final Display display = new Display();
+ final Shell shell = new Shell(display);
+ shell.setBounds(10,10,200,200);
+ shell.setLayout(new FillLayout());
+ final Tree tree = new Tree(shell, SWT.MULTI);
+ for (int i = 0; i < 9; i++) {
+ new TreeItem(tree, SWT.NONE).setText("item " + i);
+ }
+ tree.addListener(SWT.EraseItem, new Listener() {
+ @Override
public void handleEvent(Event event) {
- System.out.println("EraseItem event");
- if ((event.detail & SWT.FOCUSED) != 0) {
- System.out.println("item has focus: " + ((TreeItem)event.item).getText());
- }
- }
- });
- tree.addListener(SWT.PaintItem, new Listener() {
- @Override
+ System.out.println("EraseItem event");
+ if ((event.detail & SWT.FOCUSED) != 0) {
+ System.out.println("item has focus: " + ((TreeItem)event.item).getText());
+ }
+ }
+ });
+ tree.addListener(SWT.PaintItem, new Listener() {
+ @Override
public void handleEvent(Event event) {
- System.out.println("PaintItem event");
- if ((event.detail & SWT.FOCUSED) != 0) {
- System.out.println("item has focus: " + ((TreeItem)event.item).getText());
- }
- }
- });
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) display.sleep();
- }
- display.dispose();
+ System.out.println("PaintItem event");
+ if ((event.detail & SWT.FOCUSED) != 0) {
+ System.out.println("item has focus: " + ((TreeItem)event.item).getText());
+ }
+ }
+ });
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) display.sleep();
+ }
+ display.dispose();
}
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug292459_ToolTipFlicker.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug292459_ToolTipFlicker.java
index cfec49488b..c8f70cbeeb 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug292459_ToolTipFlicker.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug292459_ToolTipFlicker.java
@@ -27,45 +27,45 @@ import org.eclipse.swt.widgets.Shell;
public class Bug292459_ToolTipFlicker {
public static void main(String[] args) {
- final Display display = new Display();
- Shell shell = new Shell(display, SWT.SHELL_TRIM);
- shell.setLayout(new FillLayout());
+ final Display display = new Display();
+ Shell shell = new Shell(display, SWT.SHELL_TRIM);
+ shell.setLayout(new FillLayout());
- Label test1 = new Label(shell, SWT.BORDER);
- test1.setText("Test 1");
- test1.setToolTipText("This is test1\nTest is this is\nwhee");
+ Label test1 = new Label(shell, SWT.BORDER);
+ test1.setText("Test 1");
+ test1.setToolTipText("This is test1\nTest is this is\nwhee");
- final Label test2 = new Label(shell, SWT.BORDER);
- test2.setText("Test 2");
- test2.setToolTipText("This is test2\nTest is this is\nwhee");
+ final Label test2 = new Label(shell, SWT.BORDER);
+ test2.setText("Test 2");
+ test2.setToolTipText("This is test2\nTest is this is\nwhee");
- final CLabel test3 = new CLabel(shell, SWT.BORDER);
- test3.setText("Test 3");
- test3.setToolTipText("This is test3\nTest is this is\nwhee");
+ final CLabel test3 = new CLabel(shell, SWT.BORDER);
+ test3.setText("Test 3");
+ test3.setToolTipText("This is test3\nTest is this is\nwhee");
- shell.open();
+ shell.open();
- Timer timer = new Timer(true);
- timer.schedule(new TimerTask() {
- @Override
+ Timer timer = new Timer(true);
+ timer.schedule(new TimerTask() {
+ @Override
public void run() {
- display.asyncExec(new Runnable() {
- @Override
+ display.asyncExec(new Runnable() {
+ @Override
public void run() {
- // make Label's widget.tooltip flicker by setting it to the same widget.text
- test2.setToolTipText(test2.getToolTipText());
+ // make Label's widget.tooltip flicker by setting it to the same widget.text
+ test2.setToolTipText(test2.getToolTipText());
- // make CLabel's widget.tooltip flicker just by invoking doPaint
- test3.redraw();
- }
- });
- }
- }, 1000, 1000);
+ // make CLabel's widget.tooltip flicker just by invoking doPaint
+ test3.redraw();
+ }
+ });
+ }
+ }, 1000, 1000);
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) {
- display.sleep();
- }
- }
- }
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) {
+ display.sleep();
+ }
+ }
+ }
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug293581_NO_REDRAW_RESIZE_noeffect.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug293581_NO_REDRAW_RESIZE_noeffect.java
index 19df14a1b1..c52a187104 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug293581_NO_REDRAW_RESIZE_noeffect.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug293581_NO_REDRAW_RESIZE_noeffect.java
@@ -27,27 +27,27 @@ public class Bug293581_NO_REDRAW_RESIZE_noeffect {
static int counter = 0;
public static void main(String[] args) {
- final String IMAGE_FILENAME = "/home/ipun/Desktop/0ba.jpg";
- final Display display = new Display();
- Image image = new Image(display, IMAGE_FILENAME);
- Shell shell = new Shell(display);
- shell.setLayout(new FillLayout());
- shell.setBackgroundMode(SWT.INHERIT_DEFAULT);
- shell.setBackgroundImage(image);
- Canvas canvas = new Canvas(shell, SWT.NO_REDRAW_RESIZE);
- canvas.addListener(SWT.Paint, new Listener() {
- @Override
+ final String IMAGE_FILENAME = "/home/ipun/Desktop/0ba.jpg";
+ final Display display = new Display();
+ Image image = new Image(display, IMAGE_FILENAME);
+ Shell shell = new Shell(display);
+ shell.setLayout(new FillLayout());
+ shell.setBackgroundMode(SWT.INHERIT_DEFAULT);
+ shell.setBackgroundImage(image);
+ Canvas canvas = new Canvas(shell, SWT.NO_REDRAW_RESIZE);
+ canvas.addListener(SWT.Paint, new Listener() {
+ @Override
public void handleEvent(Event event) {
- event.gc.drawString(String.valueOf(counter++), 0, 0);
- }
- });
- shell.setBounds(10,10,200,200);
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) display.sleep();
- }
- image.dispose();
- display.dispose();
+ event.gc.drawString(String.valueOf(counter++), 0, 0);
+ }
+ });
+ shell.setBounds(10,10,200,200);
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) display.sleep();
+ }
+ image.dispose();
+ display.dispose();
}
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug299045_TableLines.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug299045_TableLines.java
index 1920b7520f..3d96c58a4f 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug299045_TableLines.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug299045_TableLines.java
@@ -21,83 +21,83 @@ import org.eclipse.swt.widgets.*;
public class Bug299045_TableLines {
- public static void main(String[] args) {
- final Display display = new Display();
- final Image image = display.getSystemImage(SWT.ICON_INFORMATION);
- Shell shell = new Shell(display);
- shell.setText("Images on the right side of the TableItem");
- shell.setLayout(new FillLayout());
- Table table = new Table(shell, SWT.MULTI | SWT.FULL_SELECTION);
- table.setHeaderVisible(true);
- table.setLinesVisible(false); // changing this to true makes the dotted lines thicker
- int columnCount = 3;
- for(int i = 0; i < columnCount; i++) {
- TableColumn column = new TableColumn(table, SWT.NONE);
- column.setText("Column " + i);
- }
- final int itemCount = 10;
- for(int i = 0; i < itemCount; i++) {
- TableItem item = new TableItem(table, SWT.NONE);
- item.setText(new String[] {"item " + i + " a", "item " + i + " Bug510183_javadocHang", "item " + i + " c"});
- }
- Listener paintListener = new Listener() {
- @Override
+ public static void main(String[] args) {
+ final Display display = new Display();
+ final Image image = display.getSystemImage(SWT.ICON_INFORMATION);
+ Shell shell = new Shell(display);
+ shell.setText("Images on the right side of the TableItem");
+ shell.setLayout(new FillLayout());
+ Table table = new Table(shell, SWT.MULTI | SWT.FULL_SELECTION);
+ table.setHeaderVisible(true);
+ table.setLinesVisible(false); // changing this to true makes the dotted lines thicker
+ int columnCount = 3;
+ for(int i = 0; i < columnCount; i++) {
+ TableColumn column = new TableColumn(table, SWT.NONE);
+ column.setText("Column " + i);
+ }
+ final int itemCount = 10;
+ for(int i = 0; i < itemCount; i++) {
+ TableItem item = new TableItem(table, SWT.NONE);
+ item.setText(new String[] {"item " + i + " a", "item " + i + " Bug510183_javadocHang", "item " + i + " c"});
+ }
+ Listener paintListener = new Listener() {
+ @Override
public void handleEvent(Event event) {
- switch(event.type) {
- case SWT.MeasureItem: {
- Rectangle rect = image.getBounds();
- event.width += rect.width;
- event.height = Math.max(event.height, rect.height + 2);
- break;
- }
- case SWT.EraseItem: {
- event.detail &= ~SWT.FOREGROUND;
- event.detail &= ~SWT.BACKGROUND;
- event.detail &= ~SWT.SELECTED;
- event.detail &= ~SWT.FOCUSED;
- event.detail &= ~SWT.HOT;
- event.doit = false;
- break;
- }
- case SWT.PaintItem: {
- Rectangle rect = image.getBounds();
-
- // shouldn't we subtract rect.width?
- // it looks like the event.width value set in the SWT.MeasureItem wasn't retained...
- int x = event.x + event.width /*- rect.width*/;
- int offset = Math.max(0, (event.height - rect.height) / 2);
- event.gc.drawImage(image, x, event.y + offset);
-
- // draws only a blue background filling up the entire cell
+ switch(event.type) {
+ case SWT.MeasureItem: {
+ Rectangle rect = image.getBounds();
+ event.width += rect.width;
+ event.height = Math.max(event.height, rect.height + 2);
+ break;
+ }
+ case SWT.EraseItem: {
+ event.detail &= ~SWT.FOREGROUND;
+ event.detail &= ~SWT.BACKGROUND;
+ event.detail &= ~SWT.SELECTED;
+ event.detail &= ~SWT.FOCUSED;
+ event.detail &= ~SWT.HOT;
+ event.doit = false;
+ break;
+ }
+ case SWT.PaintItem: {
+ Rectangle rect = image.getBounds();
+
+ // shouldn't we subtract rect.width?
+ // it looks like the event.width value set in the SWT.MeasureItem wasn't retained...
+ int x = event.x + event.width /*- rect.width*/;
+ int offset = Math.max(0, (event.height - rect.height) / 2);
+ event.gc.drawImage(image, x, event.y + offset);
+
+ // draws only a blue background filling up the entire cell
// Color blue = display.getSystemColor(SWT.COLOR_BLUE);
// event.gc.setBackground(blue);
// int adhocOffset = 2;
// event.gc.fillRectangle(event.x - adhocOffset, event.y,
// event.width + rect.width + adhocOffset, event.height);
-
- break;
- }
- }
- }
- };
- table.addListener(SWT.MeasureItem, paintListener);
- table.addListener(SWT.EraseItem, paintListener);
- table.addListener(SWT.PaintItem, paintListener);
+
+ break;
+ }
+ }
+ }
+ };
+ table.addListener(SWT.MeasureItem, paintListener);
+ table.addListener(SWT.EraseItem, paintListener);
+ table.addListener(SWT.PaintItem, paintListener);
- for(int i = 0; i < columnCount; i++) {
- table.getColumn(i).pack();
- }
- shell.setSize(500, 500);
- shell.open();
- while(!shell.isDisposed()) {
- if(!display.readAndDispatch())
- display.sleep();
- }
-
- // this is incorrect, the graphics.image wasn't allocated by the user!
+ for(int i = 0; i < columnCount; i++) {
+ table.getColumn(i).pack();
+ }
+ shell.setSize(500, 500);
+ shell.open();
+ while(!shell.isDisposed()) {
+ if(!display.readAndDispatch())
+ display.sleep();
+ }
+
+ // this is incorrect, the graphics.image wasn't allocated by the user!
// if(graphics.image != null)
// graphics.image.dispose();
-
- display.dispose();
- }
+
+ display.dispose();
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug299492_LabelCenterWrap.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug299492_LabelCenterWrap.java
index 56945a86ee..16690ac2f5 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug299492_LabelCenterWrap.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug299492_LabelCenterWrap.java
@@ -25,62 +25,62 @@ import org.eclipse.swt.widgets.Shell;
public class Bug299492_LabelCenterWrap {
- public static void main(String[] args) {
- Display display = new Display();
- Shell shell = new Shell(display);
+ public static void main(String[] args) {
+ Display display = new Display();
+ Shell shell = new Shell(display);
- createLabel1(shell);
+ createLabel1(shell);
// createLabel2(widget.shell);
- shell.pack();
- shell.open();
- while(!shell.isDisposed()) {
- if(!display.readAndDispatch())
- display.sleep();
- }
- display.dispose();
- }
+ shell.pack();
+ shell.open();
+ while(!shell.isDisposed()) {
+ if(!display.readAndDispatch())
+ display.sleep();
+ }
+ display.dispose();
+ }
- // this is inspired from my real-world application code
- private static void createLabel1(Shell shell) {
- shell.setLayout(new GridLayout(1, true));
- Label label = new Label(shell, SWT.HORIZONTAL | SWT.CENTER | SWT.WRAP);
- label.setText("Very Very Very Long String");
- label.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false));
+ // this is inspired from my real-world application code
+ private static void createLabel1(Shell shell) {
+ shell.setLayout(new GridLayout(1, true));
+ Label label = new Label(shell, SWT.HORIZONTAL | SWT.CENTER | SWT.WRAP);
+ label.setText("Very Very Very Long String");
+ label.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false));
// createLabelInsideComposite(widget.shell);
- }
+ }
- // this doesn't work either
- @SuppressWarnings("unused")
+ // this doesn't work either
+ @SuppressWarnings("unused")
private static void createLabel2(Shell shell) {
- shell.setLayout(new FillLayout());
+ shell.setLayout(new FillLayout());
- Label label = new Label(shell, SWT.HORIZONTAL | SWT.CENTER | SWT.WRAP);
- label.setText("Very Very Very Long String");
+ Label label = new Label(shell, SWT.HORIZONTAL | SWT.CENTER | SWT.WRAP);
+ label.setText("Very Very Very Long String");
// createLabelInsideComposite(widget.shell);
- }
+ }
- // this attempt to workaround the problem by creating two composites
- // to grab the extra horizontal space doesn't work
- @SuppressWarnings("unused")
+ // this attempt to workaround the problem by creating two composites
+ // to grab the extra horizontal space doesn't work
+ @SuppressWarnings("unused")
private static void createLabelInsideComposite(Shell shell) {
- Composite parent = new Composite(shell, SWT.NONE);
- GridLayout gridLayout = new GridLayout(3, false);
- gridLayout.marginWidth = 0;
- gridLayout.marginHeight = 0;
- gridLayout.horizontalSpacing = 0;
- gridLayout.verticalSpacing = 0;
- parent.setLayout(gridLayout);
+ Composite parent = new Composite(shell, SWT.NONE);
+ GridLayout gridLayout = new GridLayout(3, false);
+ gridLayout.marginWidth = 0;
+ gridLayout.marginHeight = 0;
+ gridLayout.horizontalSpacing = 0;
+ gridLayout.verticalSpacing = 0;
+ parent.setLayout(gridLayout);
- Composite leftPanel = new Composite(parent, SWT.NONE);
- leftPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ Composite leftPanel = new Composite(parent, SWT.NONE);
+ leftPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
- Label label = new Label(parent, SWT.HORIZONTAL | SWT.CENTER | SWT.WRAP);
- label.setText("Very Very Very Long String");
- label.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false));
+ Label label = new Label(parent, SWT.HORIZONTAL | SWT.CENTER | SWT.WRAP);
+ label.setText("Very Very Very Long String");
+ label.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false));
- Composite rightPanel = new Composite(parent, SWT.NONE);
- rightPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
- }
+ Composite rightPanel = new Composite(parent, SWT.NONE);
+ rightPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug302956_ControlFailedMouseEvent.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug302956_ControlFailedMouseEvent.java
index d19146a28e..0bcacf5658 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug302956_ControlFailedMouseEvent.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug302956_ControlFailedMouseEvent.java
@@ -24,28 +24,28 @@ import org.eclipse.swt.widgets.Shell;
public class Bug302956_ControlFailedMouseEvent {
public static void main(String[] args) {
- final Display display = new Display();
- Shell shell = new Shell(display);
- shell.setBounds(10, 10, 800, 500);
- Shell shell2 = new Shell(shell, SWT.APPLICATION_MODAL | SWT.SHELL_TRIM);
- shell2.setBounds(200, 200, 125, 125);
- Button button = new Button(shell2, SWT.PUSH);
- button.setBounds(50, 50, 50, 50);
- button.addMouseTrackListener(new MouseTrackAdapter() {
- @Override
+ final Display display = new Display();
+ Shell shell = new Shell(display);
+ shell.setBounds(10, 10, 800, 500);
+ Shell shell2 = new Shell(shell, SWT.APPLICATION_MODAL | SWT.SHELL_TRIM);
+ shell2.setBounds(200, 200, 125, 125);
+ Button button = new Button(shell2, SWT.PUSH);
+ button.setBounds(50, 50, 50, 50);
+ button.addMouseTrackListener(new MouseTrackAdapter() {
+ @Override
public void mouseEnter(MouseEvent e) {
- System.out.println("ENTER");
- }
- @Override
+ System.out.println("ENTER");
+ }
+ @Override
public void mouseExit(MouseEvent e) {
- System.out.println("EXIT");
- }
- });
- shell.open();
- shell2.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) display.sleep();
- }
- display.dispose();
+ System.out.println("EXIT");
+ }
+ });
+ shell.open();
+ shell2.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) display.sleep();
+ }
+ display.dispose();
}
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug302961_TableItemTrackerUpdating.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug302961_TableItemTrackerUpdating.java
index 0746c6381f..6ad85f0532 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug302961_TableItemTrackerUpdating.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug302961_TableItemTrackerUpdating.java
@@ -28,38 +28,38 @@ import org.eclipse.swt.widgets.Tracker;
public class Bug302961_TableItemTrackerUpdating {
public static void main (String [] args) {
- Display display = new Display ();
- final Shell shell = new Shell (display);
- final Label label = new Label(shell, SWT.NONE);
- label.setBounds(10,10,100,30);
- label.setText("widget.label");
- Table table = new Table(shell, SWT.NONE);
- table.setBounds(10,50,100,50);
- final TableItem item = new TableItem(table, SWT.NONE);
- shell.open ();
- shell.addListener (SWT.MouseDown, new Listener () {
- @Override
+ Display display = new Display ();
+ final Shell shell = new Shell (display);
+ final Label label = new Label(shell, SWT.NONE);
+ label.setBounds(10,10,100,30);
+ label.setText("widget.label");
+ Table table = new Table(shell, SWT.NONE);
+ table.setBounds(10,50,100,50);
+ final TableItem item = new TableItem(table, SWT.NONE);
+ shell.open ();
+ shell.addListener (SWT.MouseDown, new Listener () {
+ @Override
public void handleEvent (Event e) {
- Tracker tracker = new Tracker (shell, SWT.NONE);
- tracker.setRectangles (new Rectangle [] {
- new Rectangle (e.x, e.y, 100, 100),
- });
- tracker.addListener(SWT.Move, new Listener() {
- @Override
+ Tracker tracker = new Tracker (shell, SWT.NONE);
+ tracker.setRectangles (new Rectangle [] {
+ new Rectangle (e.x, e.y, 100, 100),
+ });
+ tracker.addListener(SWT.Move, new Listener() {
+ @Override
public void handleEvent(Event event) {
- System.out.println(event.x);
- String string = String.valueOf(event.x);
- label.setText(string);
- item.setText(string);
- }
- });
- tracker.open ();
- }
- });
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch ()) display.sleep ();
- }
- display.dispose ();
+ System.out.println(event.x);
+ String string = String.valueOf(event.x);
+ label.setText(string);
+ item.setText(string);
+ }
+ });
+ tracker.open ();
+ }
+ });
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch ()) display.sleep ();
+ }
+ display.dispose ();
}
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug303710_ForceActive.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug303710_ForceActive.java
index c5498b4a1e..98f0bea68e 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug303710_ForceActive.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug303710_ForceActive.java
@@ -22,31 +22,31 @@ import org.eclipse.swt.widgets.Shell;
public class Bug303710_ForceActive {
- public static void main(String[] args) {
- final Display display = new Display();
- final Shell shell = new Shell(display);
- final int time = 500;
- Runnable timer = new Runnable() {
- @Override
+ public static void main(String[] args) {
+ final Display display = new Display();
+ final Shell shell = new Shell(display);
+ final int time = 500;
+ Runnable timer = new Runnable() {
+ @Override
public void run() {
- Point point = display.getCursorLocation();
- Rectangle rect = shell.getBounds();
- if (rect.contains(point)) {
- System.out.println("In");
- } else {
- System.out.println("Out");
- }
- shell.forceActive();
- display.timerExec(time, this);
- }
- };
- display.timerExec(time, timer);
- shell.setSize(200, 200);
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- display.dispose();
- }
+ Point point = display.getCursorLocation();
+ Rectangle rect = shell.getBounds();
+ if (rect.contains(point)) {
+ System.out.println("In");
+ } else {
+ System.out.println("Out");
+ }
+ shell.forceActive();
+ display.timerExec(time, this);
+ }
+ };
+ display.timerExec(time, timer);
+ shell.setSize(200, 200);
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ display.dispose();
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug306490_SwingDisposeError.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug306490_SwingDisposeError.java
index eabeba98ab..5d9c5469b8 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug306490_SwingDisposeError.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug306490_SwingDisposeError.java
@@ -64,7 +64,7 @@ public class Bug306490_SwingDisposeError {
}
public static void main(String[] args) throws Exception {
- //remark 2: change order of following two instantiations and all works fine
+ //remark 2: change order of following two instantiations and all works fine
createSwing();
Thread.sleep(1000);
new Thread() { @Override
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug319612_getSizeResizeOnTop.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug319612_getSizeResizeOnTop.java
index b3e5cff195..ae5a2cb76d 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug319612_getSizeResizeOnTop.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug319612_getSizeResizeOnTop.java
@@ -23,37 +23,37 @@ import org.eclipse.swt.widgets.Shell;
public class Bug319612_getSizeResizeOnTop {
public static void main (String [] args) {
- Display display = new Display ();
- Shell shell = new Shell (display, SWT.RESIZE | SWT.ON_TOP);
+ Display display = new Display ();
+ Shell shell = new Shell (display, SWT.RESIZE | SWT.ON_TOP);
- GridLayout layout= new GridLayout(1, false);
- layout.marginHeight= 0;
- layout.marginWidth= 0;
- shell.setLayout(layout);
+ GridLayout layout= new GridLayout(1, false);
+ layout.marginHeight= 0;
+ layout.marginWidth= 0;
+ shell.setLayout(layout);
- shell.setSize (200, 200);
- shell.open ();
+ shell.setSize (200, 200);
+ shell.open ();
- for (int i = 0; i < 50; i++) {
- while (display.readAndDispatch ()) {
+ for (int i = 0; i < 50; i++) {
+ while (display.readAndDispatch ()) {
- }
- Point p = shell.getSize();
- shell.setSize(p.x, p.y);
+ }
+ Point p = shell.getSize();
+ shell.setSize(p.x, p.y);
- try {
- Thread.currentThread();
+ try {
+ Thread.currentThread();
Thread.sleep(100);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch ()) display.sleep ();
- }
- display.dispose ();
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch ()) display.sleep ();
+ }
+ display.dispose ();
}
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug323044_ReadAndDispatchTrue.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug323044_ReadAndDispatchTrue.java
index d913625498..19468fe8ba 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug323044_ReadAndDispatchTrue.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug323044_ReadAndDispatchTrue.java
@@ -29,46 +29,46 @@ import org.eclipse.swt.widgets.*;
public class Bug323044_ReadAndDispatchTrue {
public static void main(String[] args) {
- final Display display = new Display();
- final Shell shell = new Shell(display);
- final Text text = new Text(shell, SWT.BORDER);
- text.setSize(text.computeSize(150, SWT.DEFAULT));
- shell.pack();
- shell.open();
- new Thread(){
- @Override
+ final Display display = new Display();
+ final Shell shell = new Shell(display);
+ final Text text = new Text(shell, SWT.BORDER);
+ text.setSize(text.computeSize(150, SWT.DEFAULT));
+ shell.pack();
+ shell.open();
+ new Thread(){
+ @Override
public void run(){
- Event keyEvent = new Event();
- Event charEvent = new Event();
- System.out.println("STARTING");
- for (int i = 0; i < 5000; i++) {
- System.out.println(i);
- keyEvent.type = SWT.KeyDown;
- keyEvent.keyCode = SWT.MOD3;
- display.post(keyEvent);
+ Event keyEvent = new Event();
+ Event charEvent = new Event();
+ System.out.println("STARTING");
+ for (int i = 0; i < 5000; i++) {
+ System.out.println(i);
+ keyEvent.type = SWT.KeyDown;
+ keyEvent.keyCode = SWT.MOD3;
+ display.post(keyEvent);
- charEvent.type = SWT.KeyDown;
- charEvent.character = 'a';
- display.post(charEvent);
+ charEvent.type = SWT.KeyDown;
+ charEvent.character = 'a';
+ display.post(charEvent);
- charEvent.type = SWT.KeyUp;
- charEvent.character = 'a';
- display.post(charEvent);
+ charEvent.type = SWT.KeyUp;
+ charEvent.character = 'a';
+ display.post(charEvent);
- keyEvent.type = SWT.KeyUp;
- keyEvent.keyCode=SWT.MOD3;
- display.post(keyEvent);
- }
- }
- }.start();
- while (!shell.isDisposed()) {
- boolean readAndDispatch = display.readAndDispatch();
- System.out.println("readAndDispatch: "+ readAndDispatch);
- if (!readAndDispatch) display.sleep();
- }
+ keyEvent.type = SWT.KeyUp;
+ keyEvent.keyCode=SWT.MOD3;
+ display.post(keyEvent);
+ }
+ }
+ }.start();
+ while (!shell.isDisposed()) {
+ boolean readAndDispatch = display.readAndDispatch();
+ System.out.println("readAndDispatch: "+ readAndDispatch);
+ if (!readAndDispatch) display.sleep();
+ }
- display.dispose();
+ display.dispose();
}
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug326117_EmbeddedBrowser.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug326117_EmbeddedBrowser.java
index 24f62743a1..f3b23359c2 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug326117_EmbeddedBrowser.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug326117_EmbeddedBrowser.java
@@ -40,46 +40,46 @@ import org.eclipse.swt.widgets.Shell;
*/
public class Bug326117_EmbeddedBrowser{
- public static void main(String[] args)
- {
- final Display display = Display.getDefault();
+ public static void main(String[] args)
+ {
+ final Display display = Display.getDefault();
- Frame frm = new Frame("MyBrowser");
- Canvas embedded = new Canvas();
- frm.add(embedded, BorderLayout.CENTER);
+ Frame frm = new Frame("MyBrowser");
+ Canvas embedded = new Canvas();
+ frm.add(embedded, BorderLayout.CENTER);
- frm.pack();
+ frm.pack();
- final Shell composite = SWT_AWT.new_Shell(display, embedded);
- composite.setLayout(new FillLayout(SWT.VERTICAL));
- final Browser browser = installBrowser(composite, "http://www.baidu.com");
- frm.addWindowListener(new WindowAdapter()
- {
- @Override
- public void windowClosing(WindowEvent e)
- {
- e.getWindow().dispose();
- //composite.dispose();
+ final Shell composite = SWT_AWT.new_Shell(display, embedded);
+ composite.setLayout(new FillLayout(SWT.VERTICAL));
+ final Browser browser = installBrowser(composite, "http://www.baidu.com");
+ frm.addWindowListener(new WindowAdapter()
+ {
+ @Override
+ public void windowClosing(WindowEvent e)
+ {
+ e.getWindow().dispose();
+ //composite.dispose();
// display.dispose();
- }
- });
+ }
+ });
- JTextField addr = new JTextField(80);
- addr.addActionListener(e -> display.syncExec(() -> browser.setUrl(((JTextComponent) e.getSource()).getText())));
- frm.add(addr, BorderLayout.NORTH);
+ JTextField addr = new JTextField(80);
+ addr.addActionListener(e -> display.syncExec(() -> browser.setUrl(((JTextComponent) e.getSource()).getText())));
+ frm.add(addr, BorderLayout.NORTH);
- frm.setSize(800, 600);
- frm.setVisible(true);
- while (frm.isDisplayable())
- if (!display.readAndDispatch())
- display.sleep();
+ frm.setSize(800, 600);
+ frm.setVisible(true);
+ while (frm.isDisplayable())
+ if (!display.readAndDispatch())
+ display.sleep();
// display.dispose();
- }
+ }
- public static Browser installBrowser(Composite parent, String homeURL)
- {
- Browser browser = new Browser(parent, SWT.EMBEDDED);
- browser.setUrl(homeURL);
- return browser;
- }
- } \ No newline at end of file
+ public static Browser installBrowser(Composite parent, String homeURL)
+ {
+ Browser browser = new Browser(parent, SWT.EMBEDDED);
+ browser.setUrl(homeURL);
+ return browser;
+ }
+ } \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug336238_ShellBoundsTest.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug336238_ShellBoundsTest.java
index 80dc0f4fe6..e79247be44 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug336238_ShellBoundsTest.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug336238_ShellBoundsTest.java
@@ -21,29 +21,29 @@ import org.eclipse.swt.widgets.Shell;
public class Bug336238_ShellBoundsTest {
- static int cycles = 5;
+ static int cycles = 5;
// @Test
- public void testSetBounds() {
+ public void testSetBounds() {
- int x;
- int y;
- int width = 100;
- int height = 100;
+ int x;
+ int y;
+ int width = 100;
+ int height = 100;
- for (int i=0; i < cycles; i++) {
+ for (int i=0; i < cycles; i++) {
- x = (Double.valueOf(Math.random()*1000)).intValue();
- y = (Double.valueOf(Math.random()*1000)).intValue();
+ x = (Double.valueOf(Math.random()*1000)).intValue();
+ y = (Double.valueOf(Math.random()*1000)).intValue();
- Shell testShell = new Shell();
- testShell.open();
+ Shell testShell = new Shell();
+ testShell.open();
- testShell.setBounds(x, y, width, height);
+ testShell.setBounds(x, y, width, height);
// assertEquals(x, testShell.getLocation().x);
// assertEquals(y, testShell.getLocation().y);
- testShell.close();
- }
- }
+ testShell.close();
+ }
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug375385_ShellFullScreen.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug375385_ShellFullScreen.java
index ac310c4db5..dfed6201f9 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug375385_ShellFullScreen.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug375385_ShellFullScreen.java
@@ -21,54 +21,54 @@ import org.eclipse.swt.widgets.Shell;
public class Bug375385_ShellFullScreen
{
- public static void main(String[] args)
- {
- Display display = new Display();
-
- Shell parentShell = new Shell(display);
- parentShell.setText("Parent widget.shell");
- parentShell.setSize(400, 300);
-
- final Shell childShell = new Shell(parentShell, SWT.APPLICATION_MODAL | SWT.RESIZE | SWT.CLOSE);
- childShell.setSize(300, 200);
- childShell.setText("Child widget.shell");
-
- childShell.addMouseListener(new MouseListener()
- {
- @Override
- public void mouseUp(MouseEvent event)
- {
-
- }
-
- @Override
- public void mouseDown(MouseEvent event)
- {
-
- }
-
- @Override
- public void mouseDoubleClick(MouseEvent event)
- {
- // Toggle full screen mode: works on Mac and Windows, won't work on Linux
- System.out.println("Full screen: " + childShell.getFullScreen());
-
- childShell.setFullScreen(! childShell.getFullScreen());
-
- System.out.println("Full screen: " + childShell.getFullScreen());
- }
- });
-
- parentShell.open();
- childShell.open();
-
- while (! parentShell.isDisposed())
- {
- if (! display.readAndDispatch())
- {
- display.sleep();
- }
- }
- display.dispose();
- }
+ public static void main(String[] args)
+ {
+ Display display = new Display();
+
+ Shell parentShell = new Shell(display);
+ parentShell.setText("Parent widget.shell");
+ parentShell.setSize(400, 300);
+
+ final Shell childShell = new Shell(parentShell, SWT.APPLICATION_MODAL | SWT.RESIZE | SWT.CLOSE);
+ childShell.setSize(300, 200);
+ childShell.setText("Child widget.shell");
+
+ childShell.addMouseListener(new MouseListener()
+ {
+ @Override
+ public void mouseUp(MouseEvent event)
+ {
+
+ }
+
+ @Override
+ public void mouseDown(MouseEvent event)
+ {
+
+ }
+
+ @Override
+ public void mouseDoubleClick(MouseEvent event)
+ {
+ // Toggle full screen mode: works on Mac and Windows, won't work on Linux
+ System.out.println("Full screen: " + childShell.getFullScreen());
+
+ childShell.setFullScreen(! childShell.getFullScreen());
+
+ System.out.println("Full screen: " + childShell.getFullScreen());
+ }
+ });
+
+ parentShell.open();
+ childShell.open();
+
+ while (! parentShell.isDisposed())
+ {
+ if (! display.readAndDispatch())
+ {
+ display.sleep();
+ }
+ }
+ display.dispose();
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug386271_setMenuBar.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug386271_setMenuBar.java
index 5c91132922..cb115b0037 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug386271_setMenuBar.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug386271_setMenuBar.java
@@ -36,44 +36,44 @@ public class Bug386271_setMenuBar {
Label testLabel = new Label(shell, SWT.BORDER);
testLabel.setText("Some text");
- FormData fdata = new FormData();
- fdata.left = new FormAttachment(0);
- fdata.right = new FormAttachment(100);
- fdata.bottom = new FormAttachment(100);
- fdata.height = 15;
- testLabel.setLayoutData(fdata);
-
- /*When you uncomment the following line, the menu gets created
- * but the label is pushed back to the bottom and disappears from view.
- * To me, it seems that the 'bottom' is pushed further down outside the
- * bottom border shell.
- */
- shell.setMenuBar(returnMenu(shell));
-
- shell.open();
- while (!shell.isDisposed()) {
+ FormData fdata = new FormData();
+ fdata.left = new FormAttachment(0);
+ fdata.right = new FormAttachment(100);
+ fdata.bottom = new FormAttachment(100);
+ fdata.height = 15;
+ testLabel.setLayoutData(fdata);
+
+ /*When you uncomment the following line, the menu gets created
+ * but the label is pushed back to the bottom and disappears from view.
+ * To me, it seems that the 'bottom' is pushed further down outside the
+ * bottom border shell.
+ */
+ shell.setMenuBar(returnMenu(shell));
+
+ shell.open();
+ while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
- display.dispose();
+ display.dispose();
}
private static Menu returnMenu(Shell shell) {
- Menu menu = new Menu(shell, SWT.BAR);
+ Menu menu = new Menu(shell, SWT.BAR);
- MenuItem fileMenuHeader = new MenuItem(menu, SWT.CASCADE);
- fileMenuHeader.setText("&File");
+ MenuItem fileMenuHeader = new MenuItem(menu, SWT.CASCADE);
+ fileMenuHeader.setText("&File");
- Menu fileMenu = new Menu(shell, SWT.DROP_DOWN);
- fileMenuHeader.setMenu(fileMenu);
+ Menu fileMenu = new Menu(shell, SWT.DROP_DOWN);
+ fileMenuHeader.setMenu(fileMenu);
- MenuItem fileNewItem = new MenuItem(fileMenu, SWT.PUSH);
- fileNewItem.setText("&New\tCtrl+N");
- fileNewItem.setAccelerator(SWT.CTRL + 'N');
+ MenuItem fileNewItem = new MenuItem(fileMenu, SWT.PUSH);
+ fileNewItem.setText("&New\tCtrl+N");
+ fileNewItem.setAccelerator(SWT.CTRL + 'N');
- return menu;
+ return menu;
}
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug393723_checkForegroundBug.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug393723_checkForegroundBug.java
index 38dc2d5004..586ff4e035 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug393723_checkForegroundBug.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug393723_checkForegroundBug.java
@@ -21,28 +21,28 @@ import org.eclipse.swt.widgets.*;
public class Bug393723_checkForegroundBug {
public static void main(String[] args) {
- final Display display = new Display();
- Shell shell = new Shell(display);
- shell.setBounds(10, 10, 200, 200);
+ final Display display = new Display();
+ Shell shell = new Shell(display);
+ shell.setBounds(10, 10, 200, 200);
- Composite comp = new Composite(shell, SWT.NONE);
- System.out.println("shell back=" + shell.getBackground());
- System.out.println("shell fore=" + shell.getForeground());
- System.out.println("back=" + comp.getBackground());
- System.out.println("fore=" + comp.getForeground());
- shell.setForeground(new Color(display, 240, 240, 240));
- comp.setBackground(display.getSystemColor(SWT.COLOR_WHITE));
- System.out.println("after");
- System.out.println("shell back=" + shell.getBackground());
- System.out.println("shell fore=" + shell.getForeground());
- System.out.println("back=" + comp.getBackground());
- System.out.println("fore=" + comp.getForeground());
-
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) display.sleep();
- }
- display.dispose();
+ Composite comp = new Composite(shell, SWT.NONE);
+ System.out.println("shell back=" + shell.getBackground());
+ System.out.println("shell fore=" + shell.getForeground());
+ System.out.println("back=" + comp.getBackground());
+ System.out.println("fore=" + comp.getForeground());
+ shell.setForeground(new Color(display, 240, 240, 240));
+ comp.setBackground(display.getSystemColor(SWT.COLOR_WHITE));
+ System.out.println("after");
+ System.out.println("shell back=" + shell.getBackground());
+ System.out.println("shell fore=" + shell.getForeground());
+ System.out.println("back=" + comp.getBackground());
+ System.out.println("fore=" + comp.getForeground());
+
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) display.sleep();
+ }
+ display.dispose();
}
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug430538_JS_Set_Background.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug430538_JS_Set_Background.java
index 92b12e049b..6fec053523 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug430538_JS_Set_Background.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug430538_JS_Set_Background.java
@@ -102,10 +102,10 @@ public class Bug430538_JS_Set_Background {
});
- shell.open();
- while (!shell.isDisposed ()) {
- if (!display.readAndDispatch ()) display.sleep ();
- }
- display.dispose ();
+ shell.open();
+ while (!shell.isDisposed ()) {
+ if (!display.readAndDispatch ()) display.sleep ();
+ }
+ display.dispose ();
}
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug436085_TextEntryTabs.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug436085_TextEntryTabs.java
index b75da0e6c6..68dfa9d97e 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug436085_TextEntryTabs.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug436085_TextEntryTabs.java
@@ -21,16 +21,16 @@ import org.eclipse.swt.widgets.Text;
public class Bug436085_TextEntryTabs {
public static void main (String [] args) {
- Display display = new Display ();
- Shell shell = new Shell(display);
- Text text = new Text(shell, SWT.SINGLE | SWT.BORDER);
- text.setBounds (10, 10, 1000, 60);
- text.setTabs(1);
- text.append("1\t12\t123\t1234\t12345\t123456\t1234567\t12345678\t12345678");
- shell.open ();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) display.sleep();
- }
- display.dispose();
+ Display display = new Display ();
+ Shell shell = new Shell(display);
+ Text text = new Text(shell, SWT.SINGLE | SWT.BORDER);
+ text.setBounds (10, 10, 1000, 60);
+ text.setTabs(1);
+ text.append("1\t12\t123\t1234\t12345\t123456\t1234567\t12345678\t12345678");
+ shell.open ();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) display.sleep();
+ }
+ display.dispose();
}
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug443185_ToolbarCroppingIssue.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug443185_ToolbarCroppingIssue.java
index f2c4dd4f25..54a95e1fc5 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug443185_ToolbarCroppingIssue.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug443185_ToolbarCroppingIssue.java
@@ -33,46 +33,46 @@ public class Bug443185_ToolbarCroppingIssue {
shell.setSize(200, 400);
shell.setLayout(new GridLayout());
- // Create the tabs
- CTabFolder tabFolder = new CTabFolder(shell, SWT.TOP|SWT.BORDER);
- tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true) );
- tabFolder.setMaximizeVisible(true);
- tabFolder.setMinimizeVisible(true);
-
- CTabItem item=new CTabItem(tabFolder, SWT.BORDER);
- item.setText("Tab (1)");
- item.setShowClose(true);
- Label content=new Label(tabFolder,SWT.NONE);
- content.setText("bla");
- item.setControl(content);
-
- //intermediate composite with possible different layouts
+ // Create the tabs
+ CTabFolder tabFolder = new CTabFolder(shell, SWT.TOP|SWT.BORDER);
+ tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true) );
+ tabFolder.setMaximizeVisible(true);
+ tabFolder.setMinimizeVisible(true);
+
+ CTabItem item=new CTabItem(tabFolder, SWT.BORDER);
+ item.setText("Tab (1)");
+ item.setShowClose(true);
+ Label content=new Label(tabFolder,SWT.NONE);
+ content.setText("bla");
+ item.setControl(content);
+
+ //intermediate composite with possible different layouts
// Composite composite = new Composite(tabFolder, SWT.NONE);
// composite.setLayout(new FillLayout(SWT.HORIZONTAL));
// composite.setLayout(new GridLayout());
// composite.setLayout(new RowLayout());
-
-
- ToolBar toolBar=new ToolBar(tabFolder, SWT.FLAT|SWT.RIGHT|SWT.WRAP);
+
+
+ ToolBar toolBar=new ToolBar(tabFolder, SWT.FLAT|SWT.RIGHT|SWT.WRAP);
// toolBar.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
// toolBar.setLayoutData(new RowData());
- for(int i=0;i<15;i++){
- ToolItem toolItem=new ToolItem(toolBar, SWT.PUSH);
- toolItem.setText("test_"+i);
- if(i%5==0){
- new ToolItem(toolBar, SWT.SEPARATOR);
- }
- }
- tabFolder.setTopRight(toolBar,SWT.RIGHT | SWT.WRAP);
-
-
- //SWT Loop
+ for(int i=0;i<15;i++){
+ ToolItem toolItem=new ToolItem(toolBar, SWT.PUSH);
+ toolItem.setText("test_"+i);
+ if(i%5==0){
+ new ToolItem(toolBar, SWT.SEPARATOR);
+ }
+ }
+ tabFolder.setTopRight(toolBar,SWT.RIGHT | SWT.WRAP);
+
+
+ //SWT Loop
shell.open();
while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- {
- display.sleep();
- }
+ if (!display.readAndDispatch())
+ {
+ display.sleep();
+ }
}
display.dispose();
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug443185_ToolbarTestFillLayout.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug443185_ToolbarTestFillLayout.java
index d5cd06155b..391d6b3323 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug443185_ToolbarTestFillLayout.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug443185_ToolbarTestFillLayout.java
@@ -35,41 +35,41 @@ public class Bug443185_ToolbarTestFillLayout {
shell.setSize(200, 400);
shell.setLayout(new GridLayout());
- // Create the tabs
- CTabFolder tabFolder = new CTabFolder(shell, SWT.TOP|SWT.BORDER);
- tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true) );
- tabFolder.setMaximizeVisible(true);
- tabFolder.setMinimizeVisible(true);
-
- CTabItem item=new CTabItem(tabFolder, SWT.BORDER);
- item.setText("Tab (1)");
- item.setShowClose(true);
- Label content=new Label(tabFolder,SWT.NONE);
- content.setText("bla");
- item.setControl(content);
-
- Composite composite = new Composite(tabFolder, SWT.NONE);
- composite.setLayout(new FillLayout(SWT.HORIZONTAL));
-
-
- ToolBar toolBar=new ToolBar(composite, SWT.FLAT|SWT.RIGHT|SWT.WRAP);
- for(int i=0;i<15;i++){
- ToolItem toolItem=new ToolItem(toolBar, SWT.PUSH);
- toolItem.setText("test_"+i);
- if(i%5==0){
- new ToolItem(toolBar, SWT.SEPARATOR);
- }
- }
- tabFolder.setTopRight(composite,SWT.RIGHT | SWT.WRAP);
-
-
- //SWT Loop
+ // Create the tabs
+ CTabFolder tabFolder = new CTabFolder(shell, SWT.TOP|SWT.BORDER);
+ tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true) );
+ tabFolder.setMaximizeVisible(true);
+ tabFolder.setMinimizeVisible(true);
+
+ CTabItem item=new CTabItem(tabFolder, SWT.BORDER);
+ item.setText("Tab (1)");
+ item.setShowClose(true);
+ Label content=new Label(tabFolder,SWT.NONE);
+ content.setText("bla");
+ item.setControl(content);
+
+ Composite composite = new Composite(tabFolder, SWT.NONE);
+ composite.setLayout(new FillLayout(SWT.HORIZONTAL));
+
+
+ ToolBar toolBar=new ToolBar(composite, SWT.FLAT|SWT.RIGHT|SWT.WRAP);
+ for(int i=0;i<15;i++){
+ ToolItem toolItem=new ToolItem(toolBar, SWT.PUSH);
+ toolItem.setText("test_"+i);
+ if(i%5==0){
+ new ToolItem(toolBar, SWT.SEPARATOR);
+ }
+ }
+ tabFolder.setTopRight(composite,SWT.RIGHT | SWT.WRAP);
+
+
+ //SWT Loop
shell.open();
while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- {
- display.sleep();
- }
+ if (!display.readAndDispatch())
+ {
+ display.sleep();
+ }
}
display.dispose();
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug443185_ToolbarTestGridLayout.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug443185_ToolbarTestGridLayout.java
index 86e343bd5c..8549bbbe38 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug443185_ToolbarTestGridLayout.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug443185_ToolbarTestGridLayout.java
@@ -34,42 +34,42 @@ public class Bug443185_ToolbarTestGridLayout {
shell.setSize(200, 400);
shell.setLayout(new GridLayout());
- // Create the tabs
- CTabFolder tabFolder = new CTabFolder(shell, SWT.TOP|SWT.BORDER);
- tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true) );
- tabFolder.setMaximizeVisible(true);
- tabFolder.setMinimizeVisible(true);
-
- CTabItem item=new CTabItem(tabFolder, SWT.BORDER);
- item.setText("Tab (1)");
- item.setShowClose(true);
- Label content=new Label(tabFolder,SWT.NONE);
- content.setText("bla");
- item.setControl(content);
-
- Composite composite = new Composite(tabFolder, SWT.NONE);
- composite.setLayout(new GridLayout());
-
-
- ToolBar toolBar=new ToolBar(composite, SWT.FLAT|SWT.RIGHT|SWT.WRAP);
- toolBar.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
- for(int i=0;i<15;i++){
- ToolItem toolItem=new ToolItem(toolBar, SWT.PUSH);
- toolItem.setText("test_"+i);
- if(i%5==0){
- new ToolItem(toolBar, SWT.SEPARATOR);
- }
- }
- tabFolder.setTopRight(composite,SWT.RIGHT | SWT.WRAP);
-
-
- //SWT Loop
+ // Create the tabs
+ CTabFolder tabFolder = new CTabFolder(shell, SWT.TOP|SWT.BORDER);
+ tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true) );
+ tabFolder.setMaximizeVisible(true);
+ tabFolder.setMinimizeVisible(true);
+
+ CTabItem item=new CTabItem(tabFolder, SWT.BORDER);
+ item.setText("Tab (1)");
+ item.setShowClose(true);
+ Label content=new Label(tabFolder,SWT.NONE);
+ content.setText("bla");
+ item.setControl(content);
+
+ Composite composite = new Composite(tabFolder, SWT.NONE);
+ composite.setLayout(new GridLayout());
+
+
+ ToolBar toolBar=new ToolBar(composite, SWT.FLAT|SWT.RIGHT|SWT.WRAP);
+ toolBar.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ for(int i=0;i<15;i++){
+ ToolItem toolItem=new ToolItem(toolBar, SWT.PUSH);
+ toolItem.setText("test_"+i);
+ if(i%5==0){
+ new ToolItem(toolBar, SWT.SEPARATOR);
+ }
+ }
+ tabFolder.setTopRight(composite,SWT.RIGHT | SWT.WRAP);
+
+
+ //SWT Loop
shell.open();
while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- {
- display.sleep();
- }
+ if (!display.readAndDispatch())
+ {
+ display.sleep();
+ }
}
display.dispose();
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug443185_ToolbarTestPlain.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug443185_ToolbarTestPlain.java
index 1cf07a0a69..6b6f7f7fd7 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug443185_ToolbarTestPlain.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug443185_ToolbarTestPlain.java
@@ -33,37 +33,37 @@ public class Bug443185_ToolbarTestPlain {
shell.setSize(200, 400);
shell.setLayout(new GridLayout());
- // Create the tabs
- CTabFolder tabFolder = new CTabFolder(shell, SWT.TOP|SWT.BORDER);
- tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true) );
- tabFolder.setMaximizeVisible(true);
- tabFolder.setMinimizeVisible(true);
-
- CTabItem item=new CTabItem(tabFolder, SWT.BORDER);
- item.setText("Tab (1)");
- item.setShowClose(true);
- Label content=new Label(tabFolder,SWT.NONE);
- content.setText("bla");
- item.setControl(content);
-
- ToolBar toolBar=new ToolBar(tabFolder, SWT.FLAT|SWT.RIGHT|SWT.WRAP);
- for(int i=0;i<15;i++){
- ToolItem toolItem=new ToolItem(toolBar, SWT.PUSH);
- toolItem.setText("test_"+i);
- if(i%5==0){
- new ToolItem(toolBar, SWT.SEPARATOR);
- }
- }
- tabFolder.setTopRight(toolBar,SWT.RIGHT | SWT.WRAP);
-
-
- //SWT Loop
+ // Create the tabs
+ CTabFolder tabFolder = new CTabFolder(shell, SWT.TOP|SWT.BORDER);
+ tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true) );
+ tabFolder.setMaximizeVisible(true);
+ tabFolder.setMinimizeVisible(true);
+
+ CTabItem item=new CTabItem(tabFolder, SWT.BORDER);
+ item.setText("Tab (1)");
+ item.setShowClose(true);
+ Label content=new Label(tabFolder,SWT.NONE);
+ content.setText("bla");
+ item.setControl(content);
+
+ ToolBar toolBar=new ToolBar(tabFolder, SWT.FLAT|SWT.RIGHT|SWT.WRAP);
+ for(int i=0;i<15;i++){
+ ToolItem toolItem=new ToolItem(toolBar, SWT.PUSH);
+ toolItem.setText("test_"+i);
+ if(i%5==0){
+ new ToolItem(toolBar, SWT.SEPARATOR);
+ }
+ }
+ tabFolder.setTopRight(toolBar,SWT.RIGHT | SWT.WRAP);
+
+
+ //SWT Loop
shell.open();
while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- {
- display.sleep();
- }
+ if (!display.readAndDispatch())
+ {
+ display.sleep();
+ }
}
display.dispose();
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug443185_ToolbarTestRowLayout.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug443185_ToolbarTestRowLayout.java
index dd41dd0fa8..47cb5c0c98 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug443185_ToolbarTestRowLayout.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug443185_ToolbarTestRowLayout.java
@@ -36,42 +36,42 @@ public class Bug443185_ToolbarTestRowLayout {
shell.setSize(200, 400);
shell.setLayout(new GridLayout());
- // Create the tabs
- CTabFolder tabFolder = new CTabFolder(shell, SWT.TOP|SWT.BORDER);
- tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true) );
- tabFolder.setMaximizeVisible(true);
- tabFolder.setMinimizeVisible(true);
-
- CTabItem item=new CTabItem(tabFolder, SWT.BORDER);
- item.setText("Tab (1)");
- item.setShowClose(true);
- Label content=new Label(tabFolder,SWT.NONE);
- content.setText("bla");
- item.setControl(content);
-
- Composite composite = new Composite(tabFolder, SWT.NONE);
- composite.setLayout(new RowLayout());
-
-
- ToolBar toolBar=new ToolBar(composite, SWT.FLAT|SWT.RIGHT|SWT.WRAP);
- toolBar.setLayoutData(new RowData());
- for(int i=0;i<15;i++){
- ToolItem toolItem=new ToolItem(toolBar, SWT.PUSH);
- toolItem.setText("test_"+i);
- if(i%5==0){
- new ToolItem(toolBar, SWT.SEPARATOR);
- }
- }
- tabFolder.setTopRight(composite ,SWT.RIGHT | SWT.WRAP);
-
-
- //SWT Loop
+ // Create the tabs
+ CTabFolder tabFolder = new CTabFolder(shell, SWT.TOP|SWT.BORDER);
+ tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true) );
+ tabFolder.setMaximizeVisible(true);
+ tabFolder.setMinimizeVisible(true);
+
+ CTabItem item=new CTabItem(tabFolder, SWT.BORDER);
+ item.setText("Tab (1)");
+ item.setShowClose(true);
+ Label content=new Label(tabFolder,SWT.NONE);
+ content.setText("bla");
+ item.setControl(content);
+
+ Composite composite = new Composite(tabFolder, SWT.NONE);
+ composite.setLayout(new RowLayout());
+
+
+ ToolBar toolBar=new ToolBar(composite, SWT.FLAT|SWT.RIGHT|SWT.WRAP);
+ toolBar.setLayoutData(new RowData());
+ for(int i=0;i<15;i++){
+ ToolItem toolItem=new ToolItem(toolBar, SWT.PUSH);
+ toolItem.setText("test_"+i);
+ if(i%5==0){
+ new ToolItem(toolBar, SWT.SEPARATOR);
+ }
+ }
+ tabFolder.setTopRight(composite ,SWT.RIGHT | SWT.WRAP);
+
+
+ //SWT Loop
shell.open();
while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- {
- display.sleep();
- }
+ if (!display.readAndDispatch())
+ {
+ display.sleep();
+ }
}
display.dispose();
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug460017_ComboOverwrite.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug460017_ComboOverwrite.java
index 2a554c1bc3..09666b746c 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug460017_ComboOverwrite.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug460017_ComboOverwrite.java
@@ -22,27 +22,27 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class Bug460017_ComboOverwrite {
- public static void main(String[] args) {
- final Display disp = Display.getDefault();
- Shell shell = new Shell(disp);
- shell.setLayout(new GridLayout());
+ public static void main(String[] args) {
+ final Display disp = Display.getDefault();
+ Shell shell = new Shell(disp);
+ shell.setLayout(new GridLayout());
- final Combo combo = new Combo(shell, SWT.READ_ONLY | SWT.BORDER);
- combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
- combo.add("first", 0);
- combo.add("second", 1);
- combo.add("third", 1);
- combo.add("fourth", 1);
+ final Combo combo = new Combo(shell, SWT.READ_ONLY | SWT.BORDER);
+ combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ combo.add("first", 0);
+ combo.add("second", 1);
+ combo.add("third", 1);
+ combo.add("fourth", 1);
- shell.setText("Combo Test");
- shell.setSize(200, 200);
- shell.setLocation(0, 0);
- shell.open();
+ shell.setText("Combo Test");
+ shell.setSize(200, 200);
+ shell.setLocation(0, 0);
+ shell.open();
- while (!shell.isDisposed()) {
- if (!disp.readAndDispatch()) {
- disp.sleep();
- }
- }
- }
+ while (!shell.isDisposed()) {
+ if (!disp.readAndDispatch()) {
+ disp.sleep();
+ }
+ }
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug461354_ListTopIndexTest.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug461354_ListTopIndexTest.java
index f771c34543..3dc0dddcce 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug461354_ListTopIndexTest.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug461354_ListTopIndexTest.java
@@ -44,7 +44,7 @@ public static void main (String [] args) {
list.addListener (SWT.DefaultSelection, e -> {
int [] selection = list.getSelectionIndices ();
for (int i=0; i<selection.length; i++)
- {
+ {
}
});
list.addListener (SWT.MouseWheel, e -> {
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug465280_InvisibleControlAllocation.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug465280_InvisibleControlAllocation.java
index 3b41aee294..98ddd4c4ba 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug465280_InvisibleControlAllocation.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug465280_InvisibleControlAllocation.java
@@ -30,19 +30,19 @@ import org.eclipse.swt.widgets.Shell;
*/
public class Bug465280_InvisibleControlAllocation {
public static void main(String[] args) {
- Display display = new Display ();
- Shell shell = new Shell(display);
- shell.setLayout(new FillLayout());
- Label descriptionHint = new Label(shell, SWT.WRAP);
- descriptionHint.setText("This is a very very very very very very long string");
- descriptionHint.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
- descriptionHint.setVisible(false);
- shell.open();
- System.err.println(descriptionHint.getSize());
- while (!shell.isDisposed ()) {
- if (!display.readAndDispatch ()) display.sleep ();
- }
- display.dispose ();
+ Display display = new Display ();
+ Shell shell = new Shell(display);
+ shell.setLayout(new FillLayout());
+ Label descriptionHint = new Label(shell, SWT.WRAP);
+ descriptionHint.setText("This is a very very very very very very long string");
+ descriptionHint.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ descriptionHint.setVisible(false);
+ shell.open();
+ System.err.println(descriptionHint.getSize());
+ while (!shell.isDisposed ()) {
+ if (!display.readAndDispatch ()) display.sleep ();
+ }
+ display.dispose ();
}
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug475784_TransparentComposite.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug475784_TransparentComposite.java
index cf73d4d528..57ca06cf69 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug475784_TransparentComposite.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug475784_TransparentComposite.java
@@ -32,220 +32,220 @@ import org.eclipse.swt.widgets.Shell;
public class Bug475784_TransparentComposite extends Shell
{
- public static int RADIUS_OF_ROUND_EDGES = 30;
+ public static int RADIUS_OF_ROUND_EDGES = 30;
- /**
- * Launch the application.
- * @param args
- */
- public static void main(String args[])
- {
- try
- {
- Display display = Display.getDefault();
- Bug475784_TransparentComposite shell = new Bug475784_TransparentComposite(display);
- shell.open();
- shell.layout();
- while (!shell.isDisposed())
- {
- if (!display.readAndDispatch())
- {
- display.sleep();
- }
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
+ /**
+ * Launch the application.
+ * @param args
+ */
+ public static void main(String args[])
+ {
+ try
+ {
+ Display display = Display.getDefault();
+ Bug475784_TransparentComposite shell = new Bug475784_TransparentComposite(display);
+ shell.open();
+ shell.layout();
+ while (!shell.isDisposed())
+ {
+ if (!display.readAndDispatch())
+ {
+ display.sleep();
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
- /**
- * Create the shell.
- * @param display
- */
- public Bug475784_TransparentComposite(final Display display)
- {
- super(display, SWT.SHELL_TRIM);
- setLayout(new GridLayout(1, false));
- final Composite composite = new Composite(this, SWT.NONE);
- composite.setBackground(display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
- composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
- composite.setLayout(new GridLayout(1, false));
- //overlay composite
- final Composite overlay = new Composite(composite, SWT.NO_BACKGROUND | SWT.NO_FOCUS);
- overlay.setLayout(new FillLayout());
- overlay.setVisible(false);
- //label
- Label textLabel = new Label(composite, SWT.NONE);
- textLabel.setText("Hello World!\nHello World!");
- Button btnCheckButton = new Button(composite, SWT.CHECK);
- btnCheckButton.setText("Check Button");
- Button btnRadioButton = new Button(composite, SWT.RADIO);
- btnRadioButton.setText("Radio Button");
- //Composite for drawings
- Composite compDraws = new Composite(composite, SWT.NONE);
- compDraws.addPaintListener(e -> {
- e.gc.setBackground(display.getSystemColor(SWT.COLOR_RED));
- e.gc.fillArc(0, 0, 50, 50, 0, 360);
- });
- //exclude overlay composite
- GridData gData = new GridData();
- gData.exclude = true;
- overlay.setLayoutData(gData);
- //set region
- Region reg = new Region();
- getRegionForRoundRectangle(reg, 0, 0, 200, 200, RADIUS_OF_ROUND_EDGES);
- overlay.setRegion(reg);
- reg.dispose();
- //toggle overlay button
- final Button btnNewButton = new Button(composite, SWT.NONE);
- btnNewButton.setLayoutData(new GridData(SWT.LEFT, SWT.BOTTOM, false, true, 1, 1));
- btnNewButton.setText("Toggle overlay");
- GridData gdDataButton = new GridData(GridData.VERTICAL_ALIGN_END);
- gdDataButton.horizontalAlignment = SWT.LEFT;
- gdDataButton.verticalAlignment = SWT.BOTTOM;
- gdDataButton.grabExcessVerticalSpace = true;
- btnNewButton.setLayoutData(gdDataButton);
- btnNewButton.addSelectionListener(new SelectionAdapter()
- {
- @Override
- public void widgetSelected(SelectionEvent e)
- {
- int width = composite.getSize().x;
- int height = composite.getSize().y - btnNewButton.getSize().y - 10;
- overlay.setSize(width, height);
- overlay.setVisible(!overlay.isVisible());
- }
- });
- overlay.moveAbove(null);
- overlay.addPaintListener(e -> {
- e.gc.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_YELLOW));
- e.gc.setAlpha(150);
- e.gc.fillRectangle(new Rectangle(0, 0, overlay.getSize().x, overlay.getSize().y));
- });
- createContents();
- }
+ /**
+ * Create the shell.
+ * @param display
+ */
+ public Bug475784_TransparentComposite(final Display display)
+ {
+ super(display, SWT.SHELL_TRIM);
+ setLayout(new GridLayout(1, false));
+ final Composite composite = new Composite(this, SWT.NONE);
+ composite.setBackground(display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
+ composite.setLayout(new GridLayout(1, false));
+ //overlay composite
+ final Composite overlay = new Composite(composite, SWT.NO_BACKGROUND | SWT.NO_FOCUS);
+ overlay.setLayout(new FillLayout());
+ overlay.setVisible(false);
+ //label
+ Label textLabel = new Label(composite, SWT.NONE);
+ textLabel.setText("Hello World!\nHello World!");
+ Button btnCheckButton = new Button(composite, SWT.CHECK);
+ btnCheckButton.setText("Check Button");
+ Button btnRadioButton = new Button(composite, SWT.RADIO);
+ btnRadioButton.setText("Radio Button");
+ //Composite for drawings
+ Composite compDraws = new Composite(composite, SWT.NONE);
+ compDraws.addPaintListener(e -> {
+ e.gc.setBackground(display.getSystemColor(SWT.COLOR_RED));
+ e.gc.fillArc(0, 0, 50, 50, 0, 360);
+ });
+ //exclude overlay composite
+ GridData gData = new GridData();
+ gData.exclude = true;
+ overlay.setLayoutData(gData);
+ //set region
+ Region reg = new Region();
+ getRegionForRoundRectangle(reg, 0, 0, 200, 200, RADIUS_OF_ROUND_EDGES);
+ overlay.setRegion(reg);
+ reg.dispose();
+ //toggle overlay button
+ final Button btnNewButton = new Button(composite, SWT.NONE);
+ btnNewButton.setLayoutData(new GridData(SWT.LEFT, SWT.BOTTOM, false, true, 1, 1));
+ btnNewButton.setText("Toggle overlay");
+ GridData gdDataButton = new GridData(GridData.VERTICAL_ALIGN_END);
+ gdDataButton.horizontalAlignment = SWT.LEFT;
+ gdDataButton.verticalAlignment = SWT.BOTTOM;
+ gdDataButton.grabExcessVerticalSpace = true;
+ btnNewButton.setLayoutData(gdDataButton);
+ btnNewButton.addSelectionListener(new SelectionAdapter()
+ {
+ @Override
+ public void widgetSelected(SelectionEvent e)
+ {
+ int width = composite.getSize().x;
+ int height = composite.getSize().y - btnNewButton.getSize().y - 10;
+ overlay.setSize(width, height);
+ overlay.setVisible(!overlay.isVisible());
+ }
+ });
+ overlay.moveAbove(null);
+ overlay.addPaintListener(e -> {
+ e.gc.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_YELLOW));
+ e.gc.setAlpha(150);
+ e.gc.fillRectangle(new Rectangle(0, 0, overlay.getSize().x, overlay.getSize().y));
+ });
+ createContents();
+ }
- /**
- * Create contents of the shell.
- */
- protected void createContents()
- {
- setText("SWT Application");
- setSize(450, 300);
- }
+ /**
+ * Create contents of the shell.
+ */
+ protected void createContents()
+ {
+ setText("SWT Application");
+ setSize(450, 300);
+ }
- @Override
- protected void checkSubclass()
- {
- // Disable the check that prevents subclassing of SWT components
- }
+ @Override
+ protected void checkSubclass()
+ {
+ // Disable the check that prevents subclassing of SWT components
+ }
- public static void getCircleRegion(Region region, int r, int offsetX, int offsetY)
- {
- int[] polygon = new int[8 * r + 4];
- // x^2 + y^2 = r^2
- for (int i = 0; i < 2 * r + 1; i++)
- {
- int x = i - r;
- int y = (int) Math.sqrt(r * r - x * x);
- polygon[2 * i] = offsetX + x;
- polygon[2 * i + 1] = offsetY + y;
- polygon[8 * r - 2 * i - 2] = offsetX + x;
- polygon[8 * r - 2 * i - 1] = offsetY - y;
- }
- region.add(polygon);
- }
+ public static void getCircleRegion(Region region, int r, int offsetX, int offsetY)
+ {
+ int[] polygon = new int[8 * r + 4];
+ // x^2 + y^2 = r^2
+ for (int i = 0; i < 2 * r + 1; i++)
+ {
+ int x = i - r;
+ int y = (int) Math.sqrt(r * r - x * x);
+ polygon[2 * i] = offsetX + x;
+ polygon[2 * i + 1] = offsetY + y;
+ polygon[8 * r - 2 * i - 2] = offsetX + x;
+ polygon[8 * r - 2 * i - 1] = offsetY - y;
+ }
+ region.add(polygon);
+ }
- public static void drawRoundFrame(GC gc, int width, int height)
- {
- Rectangle tmpClippingRect = gc.getClipping();
- Region reg = new Region();
- gc.getClipping(reg);
- Region roundReg = new Region();
- getRegionForRoundRectangle(roundReg, 1, 1, width, height, RADIUS_OF_ROUND_EDGES - 1);
- reg.subtract(roundReg);
- gc.setClipping(reg);
- gc.fillRectangle(0, 0, width + 1, height + 1);
- reg.dispose();
- roundReg.dispose();
- gc.setClipping(tmpClippingRect);
- }
+ public static void drawRoundFrame(GC gc, int width, int height)
+ {
+ Rectangle tmpClippingRect = gc.getClipping();
+ Region reg = new Region();
+ gc.getClipping(reg);
+ Region roundReg = new Region();
+ getRegionForRoundRectangle(roundReg, 1, 1, width, height, RADIUS_OF_ROUND_EDGES - 1);
+ reg.subtract(roundReg);
+ gc.setClipping(reg);
+ gc.fillRectangle(0, 0, width + 1, height + 1);
+ reg.dispose();
+ roundReg.dispose();
+ gc.setClipping(tmpClippingRect);
+ }
- public static void loadPath(Region region, float[] points, byte[] types)
- {
- int start = 0, end = 0;
- for (int i = 0; i < types.length; i++)
- {
- switch (types[i])
- {
- case SWT.PATH_MOVE_TO:
- {
- if (start != end)
- {
- int n = 0;
- int[] temp = new int[end - start];
- for (int k = start; k < end; k++)
- {
- temp[n++] = Math.round(points[k]);
- }
- region.add(temp);
- }
- start = end;
- end += 2;
- break;
- }
- case SWT.PATH_LINE_TO:
- {
- end += 2;
- break;
- }
- case SWT.PATH_CLOSE:
- {
- if (start != end)
- {
- int n = 0;
- int[] temp = new int[end - start];
- for (int k = start; k < end; k++)
- {
- temp[n++] = Math.round(points[k]);
- }
- region.add(temp);
- }
- start = end;
- break;
- }
- }
- }
- }
+ public static void loadPath(Region region, float[] points, byte[] types)
+ {
+ int start = 0, end = 0;
+ for (int i = 0; i < types.length; i++)
+ {
+ switch (types[i])
+ {
+ case SWT.PATH_MOVE_TO:
+ {
+ if (start != end)
+ {
+ int n = 0;
+ int[] temp = new int[end - start];
+ for (int k = start; k < end; k++)
+ {
+ temp[n++] = Math.round(points[k]);
+ }
+ region.add(temp);
+ }
+ start = end;
+ end += 2;
+ break;
+ }
+ case SWT.PATH_LINE_TO:
+ {
+ end += 2;
+ break;
+ }
+ case SWT.PATH_CLOSE:
+ {
+ if (start != end)
+ {
+ int n = 0;
+ int[] temp = new int[end - start];
+ for (int k = start; k < end; k++)
+ {
+ temp[n++] = Math.round(points[k]);
+ }
+ region.add(temp);
+ }
+ start = end;
+ break;
+ }
+ }
+ }
+ }
- public static Path getPathForRoundRectangle(int x, int y, int width, int height, int r)
- {
- Path path = new Path(Display.getDefault());
- path.addArc(x, y, 2 * r, 2 * r, 0, 360);
- path.addArc(width - 2 * r, y, 2 * r, 2 * r, 0, 360);
- path.addArc(x, height - 2 * r, 2 * r, 2 * r, 0, 360);
- path.addArc(width - 2 * r, height - 2 * r, 2 * r, 2 * r, 0, 360);
- path.addRectangle(x, r - y, width - x, height - 2 * r);
- path.addRectangle(r - x, y, width - 2 * r, height - y);
- Path path2 = new Path(Display.getDefault(), path, 0.0001f);
- path.dispose();
- return path2;
- }
+ public static Path getPathForRoundRectangle(int x, int y, int width, int height, int r)
+ {
+ Path path = new Path(Display.getDefault());
+ path.addArc(x, y, 2 * r, 2 * r, 0, 360);
+ path.addArc(width - 2 * r, y, 2 * r, 2 * r, 0, 360);
+ path.addArc(x, height - 2 * r, 2 * r, 2 * r, 0, 360);
+ path.addArc(width - 2 * r, height - 2 * r, 2 * r, 2 * r, 0, 360);
+ path.addRectangle(x, r - y, width - x, height - 2 * r);
+ path.addRectangle(r - x, y, width - 2 * r, height - y);
+ Path path2 = new Path(Display.getDefault(), path, 0.0001f);
+ path.dispose();
+ return path2;
+ }
- public static void drawRoundRectangleByPath(GC gc, int x, int y, int width, int height)
- {
- Path path = getPathForRoundRectangle(x, y, width, height, RADIUS_OF_ROUND_EDGES - 1);
- gc.drawPath(path);
- path.dispose();
- }
+ public static void drawRoundRectangleByPath(GC gc, int x, int y, int width, int height)
+ {
+ Path path = getPathForRoundRectangle(x, y, width, height, RADIUS_OF_ROUND_EDGES - 1);
+ gc.drawPath(path);
+ path.dispose();
+ }
- public static void getRegionForRoundRectangle(Region reg, int x, int y, int width, int height, int r)
- {
- Path tmpPath = getPathForRoundRectangle(x, y, width, height, r);
- PathData data = tmpPath.getPathData();
- tmpPath.dispose();
- loadPath(reg, data.points, data.types);
- }
+ public static void getRegionForRoundRectangle(Region reg, int x, int y, int width, int height, int r)
+ {
+ Path tmpPath = getPathForRoundRectangle(x, y, width, height, r);
+ PathData data = tmpPath.getPathData();
+ tmpPath.dispose();
+ loadPath(reg, data.points, data.types);
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug477950_SystemColors.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug477950_SystemColors.java
index 18b0deb468..1646afa1c5 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug477950_SystemColors.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug477950_SystemColors.java
@@ -119,23 +119,23 @@ public class Bug477950_SystemColors {
colArray = new Color [] {display.getSystemColor(SWT.COLOR_LINK_FOREGROUND), new Color (display, 42,118,198)};
map.put("COLOR_LINK_FOREGROUND", colArray);
- for (Entry<String, Color[]> entry : map.entrySet()) {
- String s = entry.getKey();
- Color gtk = entry.getValue()[1];
- Color current = entry.getValue()[0];
- TableItem item = new TableItem(table, SWT.NONE);
- item.setText(0, s);
- item.setText(1, "rgb(" + gtk.getRed() + ", " + gtk.getGreen() + ", " + gtk.getBlue() + ")");
- item.setBackground(2, gtk);
- item.setBackground(3, current);
- item.setText(4, "rgba(" + current.getRed() + ", " + current.getGreen() + ", " + current.getBlue() + ", " +
- current.getAlpha() + ")");
- }
-
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) display.sleep();
- }
- display.dispose();
+ for (Entry<String, Color[]> entry : map.entrySet()) {
+ String s = entry.getKey();
+ Color gtk = entry.getValue()[1];
+ Color current = entry.getValue()[0];
+ TableItem item = new TableItem(table, SWT.NONE);
+ item.setText(0, s);
+ item.setText(1, "rgb(" + gtk.getRed() + ", " + gtk.getGreen() + ", " + gtk.getBlue() + ")");
+ item.setBackground(2, gtk);
+ item.setBackground(3, current);
+ item.setText(4, "rgba(" + current.getRed() + ", " + current.getGreen() + ", " + current.getBlue() + ", " +
+ current.getAlpha() + ")");
+ }
+
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) display.sleep();
+ }
+ display.dispose();
}
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug480926_CellEditorPosition.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug480926_CellEditorPosition.java
index 125c884cc2..5ca4981a09 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug480926_CellEditorPosition.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug480926_CellEditorPosition.java
@@ -22,55 +22,55 @@ import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.*;
public class Bug480926_CellEditorPosition {
- public static void main(String[] args) {
- Display display = new Display();
- Shell shell = new Shell(display);
- shell.setLayout(new FillLayout());
+ public static void main(String[] args) {
+ Display display = new Display();
+ Shell shell = new Shell(display);
+ shell.setLayout(new FillLayout());
- final Tree tree = new Tree(shell, SWT.FULL_SELECTION);
- tree.setLinesVisible(true);
- tree.setHeaderVisible(true);
+ final Tree tree = new Tree(shell, SWT.FULL_SELECTION);
+ tree.setLinesVisible(true);
+ tree.setHeaderVisible(true);
- TreeColumn column1 = new TreeColumn(tree, 0);
- column1.setText("Column 1");
- column1.setWidth(150);
+ TreeColumn column1 = new TreeColumn(tree, 0);
+ column1.setText("Column 1");
+ column1.setWidth(150);
- TreeColumn column2 = new TreeColumn(tree, 0);
- column2.setText("Column 2");
- column2.setWidth(150);
+ TreeColumn column2 = new TreeColumn(tree, 0);
+ column2.setText("Column 2");
+ column2.setWidth(150);
- TreeItem item = new TreeItem(tree, SWT.NONE, 0);
- item.setText("Row 1");
+ TreeItem item = new TreeItem(tree, SWT.NONE, 0);
+ item.setText("Row 1");
- final TreeEditor treeEditor = new TreeEditor(tree);
- treeEditor.horizontalAlignment = SWT.LEFT;
- treeEditor.grabHorizontal = true;
+ final TreeEditor treeEditor = new TreeEditor(tree);
+ treeEditor.horizontalAlignment = SWT.LEFT;
+ treeEditor.grabHorizontal = true;
- tree.addMouseListener(new MouseAdapter() {
- @Override
+ tree.addMouseListener(new MouseAdapter() {
+ @Override
public void mouseUp(MouseEvent e) {
- TreeItem item = tree.getSelection()[0];
- Text text = new Text(tree, SWT.NONE);
- treeEditor.setEditor(text, item, 1);
- }
- });
+ TreeItem item = tree.getSelection()[0];
+ Text text = new Text(tree, SWT.NONE);
+ treeEditor.setEditor(text, item, 1);
+ }
+ });
- tree.addListener(SWT.PaintItem, new Listener() {
- @Override
- public void handleEvent(Event event) {
+ tree.addListener(SWT.PaintItem, new Listener() {
+ @Override
+ public void handleEvent(Event event) {
- }
- });
+ }
+ });
- shell.setSize(600, 400);
- shell.open();
+ shell.setSize(600, 400);
+ shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) {
- display.sleep();
- }
- }
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) {
+ display.sleep();
+ }
+ }
- display.dispose();
- }
+ display.dispose();
+ }
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug481485_ButtonLabelPaintListener.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug481485_ButtonLabelPaintListener.java
index a9800c9f9f..783c30aaa2 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug481485_ButtonLabelPaintListener.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug481485_ButtonLabelPaintListener.java
@@ -23,23 +23,23 @@ import org.eclipse.swt.widgets.Shell;
public class Bug481485_ButtonLabelPaintListener {
- public static void main(String[] args) {
- Display display = new Display();
- Shell shell = new Shell(display);
- shell.setLayout(new GridLayout());
+ public static void main(String[] args) {
+ Display display = new Display();
+ Shell shell = new Shell(display);
+ shell.setLayout(new GridLayout());
- Button button = new Button(shell, SWT.PUSH);
+ Button button = new Button(shell, SWT.PUSH);
// the bug happens with Label as well
// Label button = new Label(shell, SWT.None);
- button.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- button.addPaintListener(e -> e.gc.drawString("Button", 100, 100, true));
+ button.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ button.addPaintListener(e -> e.gc.drawString("Button", 100, 100, true));
- shell.setSize(300, 300);
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- display.dispose();
- }
+ shell.setSize(300, 300);
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ display.dispose();
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug483112_TreeColumnsTest.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug483112_TreeColumnsTest.java
index ed2208c840..c2cde281e7 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug483112_TreeColumnsTest.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug483112_TreeColumnsTest.java
@@ -26,24 +26,24 @@ import org.eclipse.swt.widgets.TreeItem;
public class Bug483112_TreeColumnsTest {
public static void main (String [] args) {
- Display display = Display.getDefault();
- Shell shell = new Shell(display);
- shell.setLayout(new FillLayout());
+ Display display = Display.getDefault();
+ Shell shell = new Shell(display);
+ shell.setLayout(new FillLayout());
- Tree tree = new Tree(shell, SWT.NONE);
- tree.setHeaderVisible(true);
+ Tree tree = new Tree(shell, SWT.NONE);
+ tree.setHeaderVisible(true);
- TreeColumn column1 = new TreeColumn(tree, SWT.LEFT);
- column1.setText("Column 1");
- column1.setWidth(50);
- TreeColumn column2 = new TreeColumn(tree, SWT.LEFT);
- column2.setText("Column 2");
- column2.setWidth(50);
- TreeColumn column3 = new TreeColumn(tree, SWT.LEFT);
- column3.setText("Column 3");
- column3.setWidth(50);
+ TreeColumn column1 = new TreeColumn(tree, SWT.LEFT);
+ column1.setText("Column 1");
+ column1.setWidth(50);
+ TreeColumn column2 = new TreeColumn(tree, SWT.LEFT);
+ column2.setText("Column 2");
+ column2.setWidth(50);
+ TreeColumn column3 = new TreeColumn(tree, SWT.LEFT);
+ column3.setText("Column 3");
+ column3.setWidth(50);
- int W = 100, H = 100;
+ int W = 100, H = 100;
final Image xImage = new Image (display, W, H);
GC gc = new GC(xImage);
gc.setForeground(display.getSystemColor(SWT.COLOR_RED));
@@ -62,24 +62,24 @@ public class Bug483112_TreeColumnsTest {
gcz.dispose();
- TreeItem item = new TreeItem(tree, SWT.NONE);
- System.out.println("Image dimensions and size of column renderers is " + xImage.getBounds());
- item.setImage(0, xImage);
- item.setImage(1, xImage);
- item.setImage(2, zImage);
- item.setText(2, "Test");
- System.out.println("column 0 getImageBounds() is " + item.getImageBounds(0));
- System.out.println("column 1 getImageBounds() is " + item.getImageBounds(1));
- System.out.println("column 2 getImageBounds() is " + item.getImageBounds(2));
-
- shell.pack();
- shell.open();
+ TreeItem item = new TreeItem(tree, SWT.NONE);
+ System.out.println("Image dimensions and size of column renderers is " + xImage.getBounds());
+ item.setImage(0, xImage);
+ item.setImage(1, xImage);
+ item.setImage(2, zImage);
+ item.setText(2, "Test");
+ System.out.println("column 0 getImageBounds() is " + item.getImageBounds(0));
+ System.out.println("column 1 getImageBounds() is " + item.getImageBounds(1));
+ System.out.println("column 2 getImageBounds() is " + item.getImageBounds(2));
+
+ shell.pack();
+ shell.open();
- while(!shell.isDisposed())
- {
- if(!display.readAndDispatch())
- display.sleep();
- }
+ while(!shell.isDisposed())
+ {
+ if(!display.readAndDispatch())
+ display.sleep();
+ }
}
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug483791_setBackgroundGC.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug483791_setBackgroundGC.java
index adafcedbf7..856a19d32b 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug483791_setBackgroundGC.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug483791_setBackgroundGC.java
@@ -33,42 +33,42 @@ import org.eclipse.swt.widgets.Shell;
*/
public final class Bug483791_setBackgroundGC {
- public static void main(String[] args) {
- final Display display = new Display();
- final Shell shell = new Shell(display);
- shell.setLayout(new GridLayout());
+ public static void main(String[] args) {
+ final Display display = new Display();
+ final Shell shell = new Shell(display);
+ shell.setLayout(new GridLayout());
- final Label l = new Label(shell, SWT.None);
- l.setText("ASDQWE");
- l.addPaintListener(arg0 -> arg0.gc.drawLine(0, 0, arg0.width, arg0.height));
+ final Label l = new Label(shell, SWT.None);
+ l.setText("ASDQWE");
+ l.addPaintListener(arg0 -> arg0.gc.drawLine(0, 0, arg0.width, arg0.height));
- final Button b = new Button(shell, SWT.PUSH);
- b.setText("CLICK");
- b.addSelectionListener(new SelectionAdapter() {
+ final Button b = new Button(shell, SWT.PUSH);
+ b.setText("CLICK");
+ b.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent arg0) {
- l.setBackground(display.getSystemColor(SWT.COLOR_CYAN));
- // these don't help
- /*
- l.redraw();
- l.update();
- */
- MessageBox mb = new MessageBox(shell);
- mb.setMessage("Background should not override GC drawing, but it does");
- mb.open();
- }
- });
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ l.setBackground(display.getSystemColor(SWT.COLOR_CYAN));
+ // these don't help
+ /*
+ l.redraw();
+ l.update();
+ */
+ MessageBox mb = new MessageBox(shell);
+ mb.setMessage("Background should not override GC drawing, but it does");
+ mb.open();
+ }
+ });
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) {
- display.sleep();
- }
- }
- display.dispose();
- }
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) {
+ display.sleep();
+ }
+ }
+ display.dispose();
+ }
- private Bug483791_setBackgroundGC() {
- }
+ private Bug483791_setBackgroundGC() {
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug486068_ExpandBarTest.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug486068_ExpandBarTest.java
index 8070e17209..14c10d86da 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug486068_ExpandBarTest.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug486068_ExpandBarTest.java
@@ -32,13 +32,13 @@ public class Bug486068_ExpandBarTest {
shell.setLayout(new FillLayout());
shell.setText("ExpandBar Example");
ExpandBar bar = new ExpandBar (shell, SWT.V_SCROLL);
-
+
// First item
Composite composite = new Composite (bar, SWT.NONE);
GridLayout layout = new GridLayout ();
layout.marginLeft = layout.marginTop = layout.marginRight = layout.marginBottom = 10;
- layout.verticalSpacing = 10;
+ layout.verticalSpacing = 10;
composite.setLayout(layout);
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug496639_DialogFullScreenShell.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug496639_DialogFullScreenShell.java
index c14b52da29..896e076b85 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug496639_DialogFullScreenShell.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug496639_DialogFullScreenShell.java
@@ -25,61 +25,61 @@ import org.eclipse.swt.widgets.*;
*/
public class Bug496639_DialogFullScreenShell {
- public static void main(String[] args) {
- Display display = new Display();
+ public static void main(String[] args) {
+ Display display = new Display();
- Shell shell = new Shell(display);
- shell.setLayout(new GridLayout());
+ Shell shell = new Shell(display);
+ shell.setLayout(new GridLayout());
- Menu menuBar = new Menu(shell, SWT.BAR);
- MenuItem fileMenuItem = new MenuItem(menuBar, SWT.CASCADE);
- fileMenuItem.setText("File");
- Menu fileMenu = new Menu(fileMenuItem);
- fileMenuItem.setMenu(fileMenu);
+ Menu menuBar = new Menu(shell, SWT.BAR);
+ MenuItem fileMenuItem = new MenuItem(menuBar, SWT.CASCADE);
+ fileMenuItem.setText("File");
+ Menu fileMenu = new Menu(fileMenuItem);
+ fileMenuItem.setMenu(fileMenu);
- MenuItem toggleFullScreenMenuItem = new MenuItem(fileMenu, SWT.CHECK);
- toggleFullScreenMenuItem.setText("Toggle full screen");
- toggleFullScreenMenuItem.addListener(SWT.Selection, new Listener() {
- @Override
- public void handleEvent(Event event) {
- shell.setFullScreen(toggleFullScreenMenuItem.getSelection());
- }
- });
+ MenuItem toggleFullScreenMenuItem = new MenuItem(fileMenu, SWT.CHECK);
+ toggleFullScreenMenuItem.setText("Toggle full screen");
+ toggleFullScreenMenuItem.addListener(SWT.Selection, new Listener() {
+ @Override
+ public void handleEvent(Event event) {
+ shell.setFullScreen(toggleFullScreenMenuItem.getSelection());
+ }
+ });
- MenuItem showDialogMenuItem = new MenuItem(fileMenu, SWT.PUSH);
- showDialogMenuItem.setText("Show dialog");
- showDialogMenuItem.addListener(SWT.Selection, new Listener() {
- @Override
- public void handleEvent(Event event) {
- Shell dialogShell = new Shell(shell, SWT.DIALOG_TRIM | SWT.PRIMARY_MODAL);
- dialogShell.setLayout(new FillLayout());
+ MenuItem showDialogMenuItem = new MenuItem(fileMenu, SWT.PUSH);
+ showDialogMenuItem.setText("Show dialog");
+ showDialogMenuItem.addListener(SWT.Selection, new Listener() {
+ @Override
+ public void handleEvent(Event event) {
+ Shell dialogShell = new Shell(shell, SWT.DIALOG_TRIM | SWT.PRIMARY_MODAL);
+ dialogShell.setLayout(new FillLayout());
- Text text = new Text(dialogShell, SWT.BORDER);
- text.setText("Hello world!");
+ Text text = new Text(dialogShell, SWT.BORDER);
+ text.setText("Hello world!");
- // center on top of parent widget.shell
- Point size = dialogShell.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- Rectangle bounds = shell.getBounds();
- dialogShell.setBounds(bounds.x + (bounds.width - size.x) / 2,
- bounds.y + (bounds.height - size.y) / 2,
- size.x, size.y);
- dialogShell.open();
+ // center on top of parent widget.shell
+ Point size = dialogShell.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ Rectangle bounds = shell.getBounds();
+ dialogShell.setBounds(bounds.x + (bounds.width - size.x) / 2,
+ bounds.y + (bounds.height - size.y) / 2,
+ size.x, size.y);
+ dialogShell.open();
// dialogShell.forceActive();
// dialogShell.moveAbove(widget.shell);
- }
- });
+ }
+ });
- shell.setMenuBar(menuBar);
+ shell.setMenuBar(menuBar);
- shell.setSize(300, 200);
- shell.open();
+ shell.setSize(300, 200);
+ shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) {
- display.sleep();
- }
- }
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) {
+ display.sleep();
+ }
+ }
- display.dispose();
- }
+ display.dispose();
+ }
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug500631_RHELIcons.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug500631_RHELIcons.java
index 433668e22b..b3ed3e0cf3 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug500631_RHELIcons.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug500631_RHELIcons.java
@@ -28,50 +28,50 @@ public class Bug500631_RHELIcons {
public Bug500631_RHELIcons(Display display){
Shell shell = new Shell(display);
- shell.setLayout(new RowLayout());
- shell.setText("Photo Application");
- shell.setSize(500, 500);
-
- //creating a widget.menu
- Composite composite = new Composite(shell, SWT.NONE);
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 1;
- composite.setLayout(gridLayout);
-
- Menu menu = new Menu(shell,SWT.BAR); //root widget.menu bar
+ shell.setLayout(new RowLayout());
+ shell.setText("Photo Application");
+ shell.setSize(500, 500);
+
+ //creating a widget.menu
+ Composite composite = new Composite(shell, SWT.NONE);
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.numColumns = 1;
+ composite.setLayout(gridLayout);
+
+ Menu menu = new Menu(shell,SWT.BAR); //root widget.menu bar
- MenuItem menuItem = new MenuItem(menu,SWT.CASCADE); //adding a widget.menu item to hold each drop-down widget.menu
- menuItem.setText("Menu");
-
- Menu fileMenu = new Menu(menuItem);
-
- MenuItem menuItem1 = new MenuItem(fileMenu, SWT.PUSH);
-
- menuItem1.setText("ADD");
- menuItem1.setImage(Display.getDefault().getSystemImage(SWT.ICON_WORKING));
-
- MenuItem menuItem2 = new MenuItem(fileMenu,SWT.PUSH);
- menuItem2.setText("RMB");
- menuItem2.setImage(Display.getDefault().getSystemImage(SWT.ICON_WORKING));
-
- menuItem.setMenu(fileMenu);
-
- shell.setMenuBar(menu);
- shell.pack();
- shell.open();
+ MenuItem menuItem = new MenuItem(menu,SWT.CASCADE); //adding a widget.menu item to hold each drop-down widget.menu
+ menuItem.setText("Menu");
+
+ Menu fileMenu = new Menu(menuItem);
+
+ MenuItem menuItem1 = new MenuItem(fileMenu, SWT.PUSH);
+
+ menuItem1.setText("ADD");
+ menuItem1.setImage(Display.getDefault().getSystemImage(SWT.ICON_WORKING));
+
+ MenuItem menuItem2 = new MenuItem(fileMenu,SWT.PUSH);
+ menuItem2.setText("RMB");
+ menuItem2.setImage(Display.getDefault().getSystemImage(SWT.ICON_WORKING));
+
+ menuItem.setMenu(fileMenu);
+
+ shell.setMenuBar(menu);
+ shell.pack();
+ shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
}
public static void main(String[] args) {
// TODO Auto-generated method stub
- Display display = new Display();
- new Bug500631_RHELIcons(display);
- display.dispose();
+ Display display = new Display();
+ new Bug500631_RHELIcons(display);
+ display.dispose();
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug500664_ToolTipWrongMonitor.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug500664_ToolTipWrongMonitor.java
index 1b1ba06fbb..8a90e3d7ec 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug500664_ToolTipWrongMonitor.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug500664_ToolTipWrongMonitor.java
@@ -23,15 +23,15 @@ import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.ToolTip;
public class Bug500664_ToolTipWrongMonitor {
- public static void main(String[] args) {
- Display display = new Display();
- Shell shell = new Shell(display);
- shell.setBounds(10,10,200,200);
- final Text text = new Text(shell, SWT.MULTI | SWT.WRAP |
- SWT.V_SCROLL);
- text.setBounds(10,10,150,150);
- text.setText("TextField");
- text.addModifyListener(new ModifyListener(){
+ public static void main(String[] args) {
+ Display display = new Display();
+ Shell shell = new Shell(display);
+ shell.setBounds(10,10,200,200);
+ final Text text = new Text(shell, SWT.MULTI | SWT.WRAP |
+ SWT.V_SCROLL);
+ text.setBounds(10,10,150,150);
+ text.setText("TextField");
+ text.addModifyListener(new ModifyListener(){
@Override
public void modifyText(ModifyEvent e) {
@@ -41,12 +41,12 @@ public class Bug500664_ToolTipWrongMonitor {
t.setVisible(true);
}
- });
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) display.sleep();
- }
- display.dispose();
- }
+ });
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) display.sleep();
+ }
+ display.dispose();
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug500814_GLCanvasCrash.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug500814_GLCanvasCrash.java
index 3eed0731d6..e9098cd81d 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug500814_GLCanvasCrash.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug500814_GLCanvasCrash.java
@@ -23,22 +23,22 @@ import org.eclipse.swt.widgets.Shell;
public class Bug500814_GLCanvasCrash {
- public static void main(String[] args) {
- Display display = new Display();
- Shell shell = new Shell(display);
-
- GLCanvas canvas;
- GLData data = new GLData();
- data.doubleBuffer = true;
- data.depthSize = 24;
- data.alphaSize = 8;
- data.blueSize = 8;
- data.redSize = 8;
- data.greenSize = 8;
- data.stencilSize = 8;
- data.sampleBuffers = 1;
- data.samples = 4;
- canvas = new GLCanvas(shell, SWT.NONE, data);
- canvas.setCurrent(); // <-- it crashes here...
- }
+ public static void main(String[] args) {
+ Display display = new Display();
+ Shell shell = new Shell(display);
+
+ GLCanvas canvas;
+ GLData data = new GLData();
+ data.doubleBuffer = true;
+ data.depthSize = 24;
+ data.alphaSize = 8;
+ data.blueSize = 8;
+ data.redSize = 8;
+ data.greenSize = 8;
+ data.stencilSize = 8;
+ data.sampleBuffers = 1;
+ data.samples = 4;
+ canvas = new GLCanvas(shell, SWT.NONE, data);
+ canvas.setCurrent(); // <-- it crashes here...
+ }
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug510803_TabFolder_editable_table_brokenGtk3.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug510803_TabFolder_editable_table_brokenGtk3.java
index 59f2f65882..f5b72f9cdd 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug510803_TabFolder_editable_table_brokenGtk3.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug510803_TabFolder_editable_table_brokenGtk3.java
@@ -57,20 +57,20 @@ public class Bug510803_TabFolder_editable_table_brokenGtk3 {
// Listeners that make typing into Table edit controls. Useful to test
// functionality, but errors occur without the listeners also.
- table.addMouseListener(new MouseAdapter() {
- @Override
+ table.addMouseListener(new MouseAdapter() {
+ @Override
public void mouseUp(MouseEvent e) {
- cellEditorText.setFocus();
- }
- });
+ cellEditorText.setFocus();
+ }
+ });
- cellEditorText.addKeyListener(new KeyAdapter() {
- @Override
+ cellEditorText.addKeyListener(new KeyAdapter() {
+ @Override
public void keyPressed(KeyEvent e) {
- TableItem selectedItem = table.getSelection()[0];
- selectedItem.setText(selectedItem.getText() + e.character);
- }
- });
+ TableItem selectedItem = table.getSelection()[0];
+ selectedItem.setText(selectedItem.getText() + e.character);
+ }
+ });
// Location of setControl() method call has an impact.
// If it's before 'Text' creation, no errors are thrown into the
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug517633_SpinnerWrongText.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug517633_SpinnerWrongText.java
index fb556d18fa..7df290438a 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug517633_SpinnerWrongText.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug517633_SpinnerWrongText.java
@@ -23,24 +23,24 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Spinner;
public class Bug517633_SpinnerWrongText {
- public static void main(String[] args) {
- Display display = Display.getDefault();
- Shell shell = new Shell(display);
- shell.setLayout(new GridLayout());
- Label info = new Label(shell, SWT.NONE);
- info.setText("Select '1' in spinner text and type '2'");
- info.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false));
- Spinner spin = new Spinner(shell, SWT.BORDER);
- spin.setValues(1000, 0, 10000, 0, 1, 10);
- spin.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false));
- spin.addListener(SWT.Selection, e -> info.setText("Value changed: " + spin.getSelection()));
- shell.pack();
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) {
- display.sleep();
- }
- }
- }
+ public static void main(String[] args) {
+ Display display = Display.getDefault();
+ Shell shell = new Shell(display);
+ shell.setLayout(new GridLayout());
+ Label info = new Label(shell, SWT.NONE);
+ info.setText("Select '1' in spinner text and type '2'");
+ info.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false));
+ Spinner spin = new Spinner(shell, SWT.BORDER);
+ spin.setValues(1000, 0, 10000, 0, 1, 10);
+ spin.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false));
+ spin.addListener(SWT.Selection, e -> info.setText("Value changed: " + spin.getSelection()));
+ shell.pack();
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) {
+ display.sleep();
+ }
+ }
+ }
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug519996_focusDisposeIssue.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug519996_focusDisposeIssue.java
index a4e988db08..389a6b3b07 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug519996_focusDisposeIssue.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug519996_focusDisposeIssue.java
@@ -34,11 +34,11 @@ public class Bug519996_focusDisposeIssue {
Button button = new Button(shell, SWT.PUSH);
button.setText("focus and close");
button.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- combo.setFocus();
- shell.close();
- }
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ combo.setFocus();
+ shell.close();
+ }
});
shell.layout();
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug531667_CTabFolder_right_to_left_tabs_are_not_painted_nested.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug531667_CTabFolder_right_to_left_tabs_are_not_painted_nested.java
index 98217c9cf2..ae9add43ea 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug531667_CTabFolder_right_to_left_tabs_are_not_painted_nested.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug531667_CTabFolder_right_to_left_tabs_are_not_painted_nested.java
@@ -48,7 +48,7 @@ public class Bug531667_CTabFolder_right_to_left_tabs_are_not_painted_nested {
Composite c1 = new Composite(shell, SWT.NONE);
c1.setLayout(new FillLayout(SWT.HORIZONTAL));
Composite c2 = new Composite(shell, SWT.NONE);
- c2.setLayout(new FillLayout(SWT.HORIZONTAL));
+ c2.setLayout(new FillLayout(SWT.HORIZONTAL));
Composite c3 = new Composite(c1, SWT.NONE);
c3.setLayout(new FillLayout());
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug531667_Group_drawing_with_paint_listener_is_wrong.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug531667_Group_drawing_with_paint_listener_is_wrong.java
index f4850eefe4..f9cfd0f7a3 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug531667_Group_drawing_with_paint_listener_is_wrong.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug531667_Group_drawing_with_paint_listener_is_wrong.java
@@ -57,8 +57,8 @@ public class Bug531667_Group_drawing_with_paint_listener_is_wrong {
class DrawSquare implements PaintListener {
@Override
public void paintControl(PaintEvent e) {
- GC gc = e.gc;
- gc.drawImage(image, 0, 0);
+ GC gc = e.gc;
+ gc.drawImage(image, 0, 0);
}
}
group.addPaintListener(new DrawSquare());
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug535124_TreeSelection.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug535124_TreeSelection.java
index e0f695368f..d0dfeedf7f 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug535124_TreeSelection.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug535124_TreeSelection.java
@@ -35,27 +35,27 @@ public class Bug535124_TreeSelection {
new TreeColumn(tree, SWT.NONE).setWidth(100);
new TreeColumn(tree, SWT.NONE).setWidth(100);
for (int i = 0; i < 5; i++) {
- TreeItem item = new TreeItem(tree, SWT.NONE);
- item.setText(0, "item " + i + " col 0");
- item.setText(1, "item " + i + " col 1");
- item.setText(2, "item " + i + " col 2");
+ TreeItem item = new TreeItem(tree, SWT.NONE);
+ item.setText(0, "item " + i + " col 0");
+ item.setText(1, "item " + i + " col 1");
+ item.setText(2, "item " + i + " col 2");
}
tree.pack();
tree.addListener(SWT.EraseItem, event -> {
- event.detail &= ~SWT.HOT;
- if ((event.detail & SWT.SELECTED) == 0) {
- return; /* item not selected */
- }
- int clientWidth = tree.getClientArea().width;
- GC gc = event.gc;
- Color oldForeground = gc.getForeground();
- Color oldBackground = gc.getBackground();
- gc.setForeground(red);
- gc.setBackground(yellow);
- gc.fillGradientRectangle(0, event.y, clientWidth, event.height, false);
- gc.setForeground(oldForeground);
- gc.setBackground(oldBackground);
- event.detail &= ~SWT.SELECTED;
+ event.detail &= ~SWT.HOT;
+ if ((event.detail & SWT.SELECTED) == 0) {
+ return; /* item not selected */
+ }
+ int clientWidth = tree.getClientArea().width;
+ GC gc = event.gc;
+ Color oldForeground = gc.getForeground();
+ Color oldBackground = gc.getBackground();
+ gc.setForeground(red);
+ gc.setBackground(yellow);
+ gc.fillGradientRectangle(0, event.y, clientWidth, event.height, false);
+ gc.setForeground(oldForeground);
+ gc.setBackground(oldBackground);
+ event.detail &= ~SWT.SELECTED;
});
shell.pack();
shell.open();
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug535978_TableEditorHeader.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug535978_TableEditorHeader.java
index 4b45b1f073..ef33681d30 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug535978_TableEditorHeader.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug535978_TableEditorHeader.java
@@ -31,45 +31,45 @@ import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Text;
public class Bug535978_TableEditorHeader {
- public static void main(String[] args) {
- Display display = new Display();
- Shell shell = new Shell(display);
- shell.setLayout(new FillLayout());
- Table table = new Table(shell, SWT.BORDER | SWT.MULTI);
- table.setLinesVisible(true);
- table.setHeaderVisible(true);
- for (int i = 0; i < 3; i++) {
- TableColumn column = new TableColumn(table, SWT.NONE);
- column.setText("C"+i);
- column.setWidth(100);
- }
- for (int i = 0; i < 12; i++) {
- new TableItem(table, SWT.NONE);
- }
- TableItem[] items = table.getItems();
- for (int i = 0; i < items.length; i++) {
- if (i < 6) {
- TableEditor editor = new TableEditor(table);
- Text text = new Text(table, SWT.NONE);
- text.setText("Text");
- editor.grabHorizontal = true;
- editor.setEditor(text, items[i], 1);
- editor = new TableEditor(table);
- Button button = new Button(table, SWT.CHECK);
- button.pack();
- editor.minimumWidth = button.getSize().x;
- editor.horizontalAlignment = SWT.LEFT;
- editor.setEditor(button, items[i], 0);
- } else {
- items[i].setText("item text");
- }
- }
- shell.pack();
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- display.dispose();
- }
+ public static void main(String[] args) {
+ Display display = new Display();
+ Shell shell = new Shell(display);
+ shell.setLayout(new FillLayout());
+ Table table = new Table(shell, SWT.BORDER | SWT.MULTI);
+ table.setLinesVisible(true);
+ table.setHeaderVisible(true);
+ for (int i = 0; i < 3; i++) {
+ TableColumn column = new TableColumn(table, SWT.NONE);
+ column.setText("C"+i);
+ column.setWidth(100);
+ }
+ for (int i = 0; i < 12; i++) {
+ new TableItem(table, SWT.NONE);
+ }
+ TableItem[] items = table.getItems();
+ for (int i = 0; i < items.length; i++) {
+ if (i < 6) {
+ TableEditor editor = new TableEditor(table);
+ Text text = new Text(table, SWT.NONE);
+ text.setText("Text");
+ editor.grabHorizontal = true;
+ editor.setEditor(text, items[i], 1);
+ editor = new TableEditor(table);
+ Button button = new Button(table, SWT.CHECK);
+ button.pack();
+ editor.minimumWidth = button.getSize().x;
+ editor.horizontalAlignment = SWT.LEFT;
+ editor.setEditor(button, items[i], 0);
+ } else {
+ items[i].setText("item text");
+ }
+ }
+ shell.pack();
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ display.dispose();
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug538114_ExpandBarEmptyAll.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug538114_ExpandBarEmptyAll.java
index 12bf38709f..3a453486f8 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug538114_ExpandBarEmptyAll.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug538114_ExpandBarEmptyAll.java
@@ -29,37 +29,37 @@ import org.eclipse.swt.widgets.TreeItem;
public class Bug538114_ExpandBarEmptyAll {
public static void main(String[] args) {
- final Display display = new Display();
- Shell shell = new Shell(display);
- shell.setSize(400, 600);
- shell.setLayout(new FillLayout());
- shell.setText("ExpandBar Bug");
+ final Display display = new Display();
+ Shell shell = new Shell(display);
+ shell.setSize(400, 600);
+ shell.setLayout(new FillLayout());
+ shell.setText("ExpandBar Bug");
- expandBar(shell);
+ expandBar(shell);
- shell.open();
+ shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- display.dispose();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ display.dispose();
}
private static void expandBar(Shell shell) {
- ExpandBar bar = new ExpandBar(shell, SWT.NONE);
+ ExpandBar bar = new ExpandBar(shell, SWT.NONE);
- Composite expandControl = new Composite(bar, SWT.NONE);
- expandControl.setLayout(new FillLayout(SWT.VERTICAL));
+ Composite expandControl = new Composite(bar, SWT.NONE);
+ expandControl.setLayout(new FillLayout(SWT.VERTICAL));
- ExpandItem expandItem = new ExpandItem(bar, SWT.NONE, 0);
- expandItem.setText("expand");
- expandItem.setControl(expandControl);
- expandItem.setExpanded(false);
- expandItem.setHeight(shell.getSize().y - 50);
+ ExpandItem expandItem = new ExpandItem(bar, SWT.NONE, 0);
+ expandItem.setText("expand");
+ expandItem.setControl(expandControl);
+ expandItem.setExpanded(false);
+ expandItem.setHeight(shell.getSize().y - 50);
- Label listLabel = new Label(expandControl, SWT.NONE);
- listLabel.setText("List");
+ Label listLabel = new Label(expandControl, SWT.NONE);
+ listLabel.setText("List");
List list = new List(expandControl, SWT.NONE);
for (int i = 0; i < 3; ++i) {
list.add("list item " + i);
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug542475_DateTimeWrongIncrement.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug542475_DateTimeWrongIncrement.java
index 30bd1219cd..3530e14f82 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug542475_DateTimeWrongIncrement.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug542475_DateTimeWrongIncrement.java
@@ -21,26 +21,26 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class Bug542475_DateTimeWrongIncrement {
- public static void main(String args[]) {
+ public static void main(String args[]) {
- Display display = Display.getDefault();
- Shell shell = new Shell(display, SWT.SHELL_TRIM);
+ Display display = Display.getDefault();
+ Shell shell = new Shell(display, SWT.SHELL_TRIM);
- shell.setLayout(new GridLayout());
+ shell.setLayout(new GridLayout());
- new DateTime(shell, SWT.DATE | SWT.SHORT);
+ new DateTime(shell, SWT.DATE | SWT.SHORT);
- new DateTime(shell, SWT.DATE | SWT.MEDIUM);
+ new DateTime(shell, SWT.DATE | SWT.MEDIUM);
- new DateTime(shell, SWT.DATE | SWT.LONG);
+ new DateTime(shell, SWT.DATE | SWT.LONG);
- shell.pack();
- shell.open();
+ shell.pack();
+ shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) {
- display.sleep();
- }
- }
- }
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) {
+ display.sleep();
+ }
+ }
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug71990_SlowTablePack.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug71990_SlowTablePack.java
index 9caacdea01..db8fdb650a 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug71990_SlowTablePack.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug71990_SlowTablePack.java
@@ -31,119 +31,119 @@ import org.eclipse.swt.widgets.TableItem;
public class Bug71990_SlowTablePack {
- public static void main(String[] args) {
- Display display = new Display();
- Shell shell = new Shell(display);
- shell.setLayout(new GridLayout());
+ public static void main(String[] args) {
+ Display display = new Display();
+ Shell shell = new Shell(display);
+ shell.setLayout(new GridLayout());
- long start = System.currentTimeMillis();
+ long start = System.currentTimeMillis();
- final Composite parent = new Composite(shell, SWT.NONE);
- parent.setLayout(new FillLayout());
- parent.setLayoutData(new GridData(GridData.FILL_BOTH));
- final StackLayout layout = new StackLayout();
- parent.setLayout(layout);
+ final Composite parent = new Composite(shell, SWT.NONE);
+ parent.setLayout(new FillLayout());
+ parent.setLayoutData(new GridData(GridData.FILL_BOTH));
+ final StackLayout layout = new StackLayout();
+ parent.setLayout(layout);
- final Composite c1 = new Composite(parent, SWT.NONE);
- c1.setLayout(new FillLayout());
- final Composite c2 = new Composite(parent, SWT.NONE);
- c2.setLayout(new FillLayout());
+ final Composite c1 = new Composite(parent, SWT.NONE);
+ c1.setLayout(new FillLayout());
+ final Composite c2 = new Composite(parent, SWT.NONE);
+ c2.setLayout(new FillLayout());
- final Button button = new Button(shell, SWT.NONE);
- button.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- button.setText("Switch");
+ final Button button = new Button(shell, SWT.NONE);
+ button.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ button.setText("Switch");
- final Table t1 = makeTable(c1);
- final Table t2 = makeTable(c2);
+ final Table t1 = makeTable(c1);
+ final Table t2 = makeTable(c2);
- button.addSelectionListener(new SelectionAdapter() {
- @Override
+ button.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
- long st = System.currentTimeMillis();
-
- if (layout.topControl == c1) {
- layout.topControl = c2;
- makeColumns(t2, false);
- } else {
- layout.topControl = c1;
- makeColumns(t1, false);
- }
-
- parent.layout();
-
- System.out.println("Layout: "
- + (System.currentTimeMillis() - st));
-
- }
- });
-
- layout.topControl = c1;
-
- long packTime = System.currentTimeMillis();
-
- shell.pack();
- shell.setSize(400, 400);
- shell.open();
-
- System.out.println("Pack: " + (System.currentTimeMillis() - packTime));
-
- System.out.println("Finish: " + (System.currentTimeMillis() - start));
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- display.dispose();
- }
-
- public static Table makeTable(Composite parent) {
- Table table = new Table(parent, SWT.MULTI | SWT.BORDER
- | SWT.FULL_SELECTION);
- table.setLinesVisible(true);
- table.setHeaderVisible(true);
- String[] titles = { " ", "C", "!", "Description", "Resource",
- "In Folder", "Location" };
- for (int i = 0; i < titles.length; i++) {
- TableColumn column = new TableColumn(table, SWT.NULL);
- column.setText(titles[i]);
- }
- makeColumns(table, true);
- table.pack();
- return table;
- }
-
- public static void makeColumns(Table table, boolean pack) {
- int count = 1024;
-
- long time = System.currentTimeMillis();
-
- table.removeAll();
-
- System.out.println("Time RemoveAll: "
- + (System.currentTimeMillis() - time));
-
- long time0 = System.currentTimeMillis();
-
- for (int i = 0; i < count; i++) {
- TableItem item = new TableItem(table, SWT.NULL);
- item.setText(0, "x");
- item.setText(1, "y");
- item.setText(2, "!");
- item.setText(3, "this stuff behaves the way I expect");
- item.setText(4, "almost everywhere");
- item.setText(5, "some.folder");
- item.setText(6, "line " + i + " in nowhere");
- }
-
- long time1 = System.currentTimeMillis();
-
- System.out.println("Time add Items: " + (time1 - time0));
-
- if (pack) {
- for (int i = 0; i < table.getColumnCount(); i++)
- table.getColumn(i).pack();
- long time2 = System.currentTimeMillis();
- System.out.println("Time column pack: " + (time2 - time1));
- }
-
- }
+ long st = System.currentTimeMillis();
+
+ if (layout.topControl == c1) {
+ layout.topControl = c2;
+ makeColumns(t2, false);
+ } else {
+ layout.topControl = c1;
+ makeColumns(t1, false);
+ }
+
+ parent.layout();
+
+ System.out.println("Layout: "
+ + (System.currentTimeMillis() - st));
+
+ }
+ });
+
+ layout.topControl = c1;
+
+ long packTime = System.currentTimeMillis();
+
+ shell.pack();
+ shell.setSize(400, 400);
+ shell.open();
+
+ System.out.println("Pack: " + (System.currentTimeMillis() - packTime));
+
+ System.out.println("Finish: " + (System.currentTimeMillis() - start));
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ display.dispose();
+ }
+
+ public static Table makeTable(Composite parent) {
+ Table table = new Table(parent, SWT.MULTI | SWT.BORDER
+ | SWT.FULL_SELECTION);
+ table.setLinesVisible(true);
+ table.setHeaderVisible(true);
+ String[] titles = { " ", "C", "!", "Description", "Resource",
+ "In Folder", "Location" };
+ for (int i = 0; i < titles.length; i++) {
+ TableColumn column = new TableColumn(table, SWT.NULL);
+ column.setText(titles[i]);
+ }
+ makeColumns(table, true);
+ table.pack();
+ return table;
+ }
+
+ public static void makeColumns(Table table, boolean pack) {
+ int count = 1024;
+
+ long time = System.currentTimeMillis();
+
+ table.removeAll();
+
+ System.out.println("Time RemoveAll: "
+ + (System.currentTimeMillis() - time));
+
+ long time0 = System.currentTimeMillis();
+
+ for (int i = 0; i < count; i++) {
+ TableItem item = new TableItem(table, SWT.NULL);
+ item.setText(0, "x");
+ item.setText(1, "y");
+ item.setText(2, "!");
+ item.setText(3, "this stuff behaves the way I expect");
+ item.setText(4, "almost everywhere");
+ item.setText(5, "some.folder");
+ item.setText(6, "line " + i + " in nowhere");
+ }
+
+ long time1 = System.currentTimeMillis();
+
+ System.out.println("Time add Items: " + (time1 - time0));
+
+ if (pack) {
+ for (int i = 0; i < table.getColumnCount(); i++)
+ table.getColumn(i).pack();
+ long time2 = System.currentTimeMillis();
+ System.out.println("Time column pack: " + (time2 - time1));
+ }
+
+ }
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug74739_TableTopIndex.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug74739_TableTopIndex.java
index de54ee5bde..40574253e4 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug74739_TableTopIndex.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug74739_TableTopIndex.java
@@ -48,7 +48,7 @@ import org.eclipse.swt.widgets.Text;
*/
public class Bug74739_TableTopIndex {
- public static void main(String[] args) {
+ public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new GridLayout());
@@ -122,9 +122,9 @@ public class Bug74739_TableTopIndex {
@Override
public void keyPressed(KeyEvent e) {
if (e.keyCode == SWT.MOD1 ||
- e.keyCode == SWT.MOD2 ||
- (e.stateMask & SWT.MOD1) != 0 ||
- (e.stateMask & SWT.MOD2) != 0) {
+ e.keyCode == SWT.MOD2 ||
+ (e.stateMask & SWT.MOD1) != 0 ||
+ (e.stateMask & SWT.MOD2) != 0) {
cursor.setVisible(false);
}
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug85131_ToolTipSetNull.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug85131_ToolTipSetNull.java
index 16d41468e1..b3af29d837 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug85131_ToolTipSetNull.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug85131_ToolTipSetNull.java
@@ -32,29 +32,29 @@ public class Bug85131_ToolTipSetNull
{
public static void main(String[]v)
{
- Display disp = Display.getDefault();
- final Shell shell = new Shell(disp, SWT.DIALOG_TRIM|SWT.RESIZE );
- shell.setText( "Test Tooltip" );
-
- shell.setLayout( new FillLayout() );
-
- final Canvas canvas = new Canvas( shell, SWT.NONE );
- canvas.addPaintListener( new PaintListener() {
- @Override
+ Display disp = Display.getDefault();
+ final Shell shell = new Shell(disp, SWT.DIALOG_TRIM|SWT.RESIZE );
+ shell.setText( "Test Tooltip" );
+
+ shell.setLayout( new FillLayout() );
+
+ final Canvas canvas = new Canvas( shell, SWT.NONE );
+ canvas.addPaintListener( new PaintListener() {
+ @Override
public void paintControl(PaintEvent e)
- {
- Rectangle r = canvas.getClientArea();
- int wm = r.width/8, w2 = r.width/2;
- int hm = r.height/8;
- int rw = w2-wm, rh = r.height-2*hm;
-
- e.gc.setBackground( new Color(null,200,0,0) );
- e.gc.fillRectangle( 0,hm,w2,rh);
- e.gc.setBackground( new Color(null,0,0,200) );
- e.gc.fillRectangle( w2,hm+hm,rw+wm,rh-hm);
- }
- });
- canvas.addMouseMoveListener( new MouseMoveListener() {
+ {
+ Rectangle r = canvas.getClientArea();
+ int wm = r.width/8, w2 = r.width/2;
+ int hm = r.height/8;
+ int rw = w2-wm, rh = r.height-2*hm;
+
+ e.gc.setBackground( new Color(null,200,0,0) );
+ e.gc.fillRectangle( 0,hm,w2,rh);
+ e.gc.setBackground( new Color(null,0,0,200) );
+ e.gc.fillRectangle( w2,hm+hm,rw+wm,rh-hm);
+ }
+ });
+ canvas.addMouseMoveListener( new MouseMoveListener() {
@Override
public void mouseMove(org.eclipse.swt.events.MouseEvent
e) {
@@ -62,30 +62,30 @@ e) {
int my = e.y;
Rectangle r = canvas.getClientArea();
- int wm = r.width/8, w2 = r.width/2;
- int hm = r.height/8;
- int rw = w2-wm, rh = r.height-2*hm;
-
- String tip = null;
- if( mx>=0 && mx <= 0+w2 && my >= hm && my <= hm+rh )
- {
- tip = "Red Rectangle";
- }
- else if( mx>=w2 && mx <= w2+rw+wm && my >= hm+hm && my <=
+ int wm = r.width/8, w2 = r.width/2;
+ int hm = r.height/8;
+ int rw = w2-wm, rh = r.height-2*hm;
+
+ String tip = null;
+ if( mx>=0 && mx <= 0+w2 && my >= hm && my <= hm+rh )
+ {
+ tip = "Red Rectangle";
+ }
+ else if( mx>=w2 && mx <= w2+rw+wm && my >= hm+hm && my <=
hm+rh )
- {
- tip = "Blue Rectangle";
- }
-System.out.println("setToolTipText("+tip+")");
- canvas.setToolTipText( tip );
+ {
+ tip = "Blue Rectangle";
+ }
+System.out.println("setToolTipText("+tip+")");
+ canvas.setToolTipText( tip );
}
- });
+ });
- shell.setSize( 300, 200 );
- shell.open();
-
- while (!shell.isDisposed())
- if (!disp.readAndDispatch())
- disp.sleep();
+ shell.setSize( 300, 200 );
+ shell.open();
+
+ while (!shell.isDisposed())
+ if (!disp.readAndDispatch())
+ disp.sleep();
}
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/manualJUnit/MJ_Table.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/manualJUnit/MJ_Table.java
index 5e1b9a9a01..b5d96a22af 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/manualJUnit/MJ_Table.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/manualJUnit/MJ_Table.java
@@ -328,23 +328,23 @@ public class MJ_Table extends MJ_root {
shell.setSize(SWIDTH, SHEIGHT);
shell.setLayout(new FillLayout());
- final Table tt = new Table(shell, SWT.FULL_SELECTION | SWT.MULTI | SWT.VIRTUAL);
- tt.setLinesVisible(true);
- tt.setHeaderVisible(true);
-
- for (int i = 0; i < 10; i++) {
- TableColumn tc = new TableColumn(tt, SWT.NONE);
- tc.setWidth(100);
- System.out.println(tc.getWidth());
- tc.setWidth(tc.getWidth());
- tc.setText("Column " + i);
- }
-
- for (int i = 0; i < 100; i++) {
- new TableItem(tt, SWT.NONE);
- }
-
- shell.open();
+ final Table tt = new Table(shell, SWT.FULL_SELECTION | SWT.MULTI | SWT.VIRTUAL);
+ tt.setLinesVisible(true);
+ tt.setHeaderVisible(true);
+
+ for (int i = 0; i < 10; i++) {
+ TableColumn tc = new TableColumn(tt, SWT.NONE);
+ tc.setWidth(100);
+ System.out.println(tc.getWidth());
+ tc.setWidth(tc.getWidth());
+ tc.setText("Column " + i);
+ }
+
+ for (int i = 0; i < 100; i++) {
+ new TableItem(tt, SWT.NONE);
+ }
+
+ shell.open();
mainLoop(shell);
}
@@ -357,74 +357,74 @@ public class MJ_Table extends MJ_root {
Shell shell = mkShell("column SetGet Width : Make shell smaller and bigger. If you don't see COL_SIZE_ERROR in console, all is well.");
shell.setSize(SWIDTH, SHEIGHT);
shell.setLayout(new FillLayout());
- StringBuffer sbBuffer = new StringBuffer();
-
- final Composite comp = new Composite(shell, SWT.NONE);
- final Table table = new Table(comp, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION);
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
- final TableColumn column1 = new TableColumn(table, SWT.NONE);
- column1.setText("Column 1");
- column1.setResizable(false);
- final TableColumn column2 = new TableColumn(table, SWT.NONE);
- column2.setText("Column 2");
- column2.setResizable(false);
- for (int i = 0; i < 60; i++) {
- TableItem item = new TableItem(table, SWT.NONE);
- sbBuffer.append("M");
- item.setText(new String[] { "item 0 " + sbBuffer.toString() + " " + i, "item 1 " + i });
- }
-
- Consumer<Integer> setColumnWidths = (width) -> {
- int c1w = (int)(width * 0.9);
- column1.setWidth(c1w);
- int c1wPost = column1.getWidth();
- if (c1w != c1wPost)
- System.err.println("COL_SIZE_ERROR 1 Expected:" + c1w + " actual:" + c1wPost);
-
- int c2w = width - column1.getWidth();
- column2.setWidth(c2w);
- int c2wPost = column2.getWidth();
- if (c2w != c2wPost)
- System.err.println("COL_SIZE_ERROR 2 Expected:" + c2w + " actual:" + column2.getWidth());
- };
-
- comp.addControlListener(new ControlAdapter()
- {
- @Override
+ StringBuffer sbBuffer = new StringBuffer();
+
+ final Composite comp = new Composite(shell, SWT.NONE);
+ final Table table = new Table(comp, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION);
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+ final TableColumn column1 = new TableColumn(table, SWT.NONE);
+ column1.setText("Column 1");
+ column1.setResizable(false);
+ final TableColumn column2 = new TableColumn(table, SWT.NONE);
+ column2.setText("Column 2");
+ column2.setResizable(false);
+ for (int i = 0; i < 60; i++) {
+ TableItem item = new TableItem(table, SWT.NONE);
+ sbBuffer.append("M");
+ item.setText(new String[] { "item 0 " + sbBuffer.toString() + " " + i, "item 1 " + i });
+ }
+
+ Consumer<Integer> setColumnWidths = (width) -> {
+ int c1w = (int)(width * 0.9);
+ column1.setWidth(c1w);
+ int c1wPost = column1.getWidth();
+ if (c1w != c1wPost)
+ System.err.println("COL_SIZE_ERROR 1 Expected:" + c1w + " actual:" + c1wPost);
+
+ int c2w = width - column1.getWidth();
+ column2.setWidth(c2w);
+ int c2wPost = column2.getWidth();
+ if (c2w != c2wPost)
+ System.err.println("COL_SIZE_ERROR 2 Expected:" + c2w + " actual:" + column2.getWidth());
+ };
+
+ comp.addControlListener(new ControlAdapter()
+ {
+ @Override
public void controlResized(ControlEvent e)
- {
- Rectangle area = table.getParent().getClientArea();
- Point preferredSize = table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- int width = area.width - 2 * table.getBorderWidth();
- if (preferredSize.y > area.height)
- {
- // Subtract the scrollbar width from the total column width
- // if a vertical scrollbar will be required
- Point vBarSize = table.getVerticalBar().getSize();
- width -= vBarSize.x;
- }
- Point oldSize = table.getSize();
- if (oldSize.x > area.width)
- {
- // table is getting smaller so make the columns
- // smaller first and then resize the table to
- // match the client area width
- setColumnWidths.accept(width);
- table.setSize(area.width, area.height);
- }
- else
- {
- // table is getting bigger so make the table
- // bigger first and then make the columns wider
- // to match the client area width
- table.setSize(area.width, area.height);
- setColumnWidths.accept(width);
- }
- }
- });
- shell.open();
- mainLoop(shell);
+ {
+ Rectangle area = table.getParent().getClientArea();
+ Point preferredSize = table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ int width = area.width - 2 * table.getBorderWidth();
+ if (preferredSize.y > area.height)
+ {
+ // Subtract the scrollbar width from the total column width
+ // if a vertical scrollbar will be required
+ Point vBarSize = table.getVerticalBar().getSize();
+ width -= vBarSize.x;
+ }
+ Point oldSize = table.getSize();
+ if (oldSize.x > area.width)
+ {
+ // table is getting smaller so make the columns
+ // smaller first and then resize the table to
+ // match the client area width
+ setColumnWidths.accept(width);
+ table.setSize(area.width, area.height);
+ }
+ else
+ {
+ // table is getting bigger so make the table
+ // bigger first and then make the columns wider
+ // to match the client area width
+ table.setSize(area.width, area.height);
+ setColumnWidths.accept(width);
+ }
+ }
+ });
+ shell.open();
+ mainLoop(shell);
}
@Test
@@ -515,8 +515,8 @@ public class MJ_Table extends MJ_root {
column2.setWidth(200);
String[] labels = new String[]{"Resolved", "New", "Won't Fix", "Invalid"};
for (int i=0; i<labels.length; i++) {
- TableItem item = new TableItem(table, SWT.NONE);
- item.setText(labels[i]);
+ TableItem item = new TableItem(table, SWT.NONE);
+ item.setText(labels[i]);
}
/*
@@ -1049,51 +1049,51 @@ public class MJ_Table extends MJ_root {
@Test
public void sort_by_column_Snippet2() {
- Shell shell = mkShell("Click on columns to verify items are sorted properly");
- shell.setLayout(new FillLayout());
-
- final Table table = new Table(shell, SWT.BORDER);
- table.setHeaderVisible(true);
- final TableColumn column1 = new TableColumn(table, SWT.NONE);
- column1.setText("Column 1");
- final TableColumn column2 = new TableColumn(table, SWT.NONE);
- column2.setText("Column 2");
- TableItem item = new TableItem(table, SWT.NONE);
- item.setText(new String[] {"a", "3"});
- item = new TableItem(table, SWT.NONE);
- item.setText(new String[] {"b", "2"});
- item = new TableItem(table, SWT.NONE);
- item.setText(new String[] {"c", "1"});
- column1.setWidth(100);
- column2.setWidth(100);
- Listener sortListener = e -> {
- TableItem[] items = table.getItems();
- Collator collator = Collator.getInstance(Locale.getDefault());
- TableColumn column = (TableColumn)e.widget;
- int index = column == column1 ? 0 : 1;
- for (int i = 1; i < items.length; i++) {
- String value1 = items[i].getText(index);
- for (int j = 0; j < i; j++){
- String value2 = items[j].getText(index);
- if (collator.compare(value1, value2) < 0) {
- String[] values = {items[i].getText(0), items[i].getText(1)};
- items[i].dispose();
- TableItem item1 = new TableItem(table, SWT.NONE, j);
- item1.setText(values);
- items = table.getItems();
- break;
- }
- }
- }
- table.setSortColumn(column);
+ Shell shell = mkShell("Click on columns to verify items are sorted properly");
+ shell.setLayout(new FillLayout());
+
+ final Table table = new Table(shell, SWT.BORDER);
+ table.setHeaderVisible(true);
+ final TableColumn column1 = new TableColumn(table, SWT.NONE);
+ column1.setText("Column 1");
+ final TableColumn column2 = new TableColumn(table, SWT.NONE);
+ column2.setText("Column 2");
+ TableItem item = new TableItem(table, SWT.NONE);
+ item.setText(new String[] {"a", "3"});
+ item = new TableItem(table, SWT.NONE);
+ item.setText(new String[] {"b", "2"});
+ item = new TableItem(table, SWT.NONE);
+ item.setText(new String[] {"c", "1"});
+ column1.setWidth(100);
+ column2.setWidth(100);
+ Listener sortListener = e -> {
+ TableItem[] items = table.getItems();
+ Collator collator = Collator.getInstance(Locale.getDefault());
+ TableColumn column = (TableColumn)e.widget;
+ int index = column == column1 ? 0 : 1;
+ for (int i = 1; i < items.length; i++) {
+ String value1 = items[i].getText(index);
+ for (int j = 0; j < i; j++){
+ String value2 = items[j].getText(index);
+ if (collator.compare(value1, value2) < 0) {
+ String[] values = {items[i].getText(0), items[i].getText(1)};
+ items[i].dispose();
+ TableItem item1 = new TableItem(table, SWT.NONE, j);
+ item1.setText(values);
+ items = table.getItems();
+ break;
+ }
+ }
+ }
+ table.setSortColumn(column);
};
- column1.addListener(SWT.Selection, sortListener);
- column2.addListener(SWT.Selection, sortListener);
- table.setSortColumn(column1);
- table.setSortDirection(SWT.UP);
- shell.setSize(SWIDTH, SHEIGHT);
- shell.open();
- mainLoop(shell);
+ column1.addListener(SWT.Selection, sortListener);
+ column2.addListener(SWT.Selection, sortListener);
+ table.setSortColumn(column1);
+ table.setSortDirection(SWT.UP);
+ shell.setSize(SWIDTH, SHEIGHT);
+ shell.open();
+ mainLoop(shell);
}
@Test
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/manualJUnit/MJ_Tree.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/manualJUnit/MJ_Tree.java
index 29f1d16a4e..d278ca273b 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/manualJUnit/MJ_Tree.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/manualJUnit/MJ_Tree.java
@@ -305,23 +305,23 @@ public class MJ_Tree extends MJ_root {
shell.setSize(SWIDTH, SHEIGHT);
shell.setLayout(new FillLayout());
- final Tree tt = new Tree(shell, SWT.FULL_SELECTION | SWT.MULTI | SWT.VIRTUAL);
- tt.setLinesVisible(true);
- tt.setHeaderVisible(true);
-
- for (int i = 0; i < 10; i++) {
- TreeColumn tc = new TreeColumn(tt, SWT.NONE);
- tc.setWidth(100);
- System.out.println(tc.getWidth());
- tc.setWidth(tc.getWidth());
- tc.setText("Column " + i);
- }
-
- for (int i = 0; i < 100; i++) {
- new TreeItem(tt, SWT.NONE);
- }
-
- shell.open();
+ final Tree tt = new Tree(shell, SWT.FULL_SELECTION | SWT.MULTI | SWT.VIRTUAL);
+ tt.setLinesVisible(true);
+ tt.setHeaderVisible(true);
+
+ for (int i = 0; i < 10; i++) {
+ TreeColumn tc = new TreeColumn(tt, SWT.NONE);
+ tc.setWidth(100);
+ System.out.println(tc.getWidth());
+ tc.setWidth(tc.getWidth());
+ tc.setText("Column " + i);
+ }
+
+ for (int i = 0; i < 100; i++) {
+ new TreeItem(tt, SWT.NONE);
+ }
+
+ shell.open();
mainLoop(shell);
}
@@ -334,74 +334,74 @@ public class MJ_Tree extends MJ_root {
Shell shell = mkShell("column SetGet Width : Make shell smaller and bigger. If you don't see COL_SIZE_ERROR in console, all is well.");
shell.setSize(SWIDTH, SHEIGHT);
shell.setLayout(new FillLayout());
- StringBuffer sbBuffer = new StringBuffer();
-
- final Composite comp = new Composite(shell, SWT.NONE);
- final Tree tree = new Tree(comp, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION);
- tree.setHeaderVisible(true);
- tree.setLinesVisible(true);
- final TreeColumn column1 = new TreeColumn(tree, SWT.NONE);
- column1.setText("Column 1");
- column1.setResizable(false);
- final TreeColumn column2 = new TreeColumn(tree, SWT.NONE);
- column2.setText("Column 2");
- column2.setResizable(false);
- for (int i = 0; i < 60; i++) {
- TreeItem item = new TreeItem(tree, SWT.NONE);
- sbBuffer.append("M");
- item.setText(new String[] { "item 0 " + sbBuffer.toString() + " " + i, "item 1 " + i });
- }
-
- Consumer<Integer> setColumnWidths = (width) -> {
- int c1w = (int)(width * 0.9);
- column1.setWidth(c1w);
- int c1wPost = column1.getWidth();
- if (c1w != c1wPost)
- System.err.println("COL_SIZE_ERROR 1 Expected:" + c1w + " actual:" + c1wPost);
-
- int c2w = width - column1.getWidth();
- column2.setWidth(c2w);
- int c2wPost = column2.getWidth();
- if (c2w != c2wPost)
- System.err.println("COL_SIZE_ERROR 2 Expected:" + c2w + " actual:" + column2.getWidth());
- };
-
- comp.addControlListener(new ControlAdapter()
- {
- @Override
+ StringBuffer sbBuffer = new StringBuffer();
+
+ final Composite comp = new Composite(shell, SWT.NONE);
+ final Tree tree = new Tree(comp, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION);
+ tree.setHeaderVisible(true);
+ tree.setLinesVisible(true);
+ final TreeColumn column1 = new TreeColumn(tree, SWT.NONE);
+ column1.setText("Column 1");
+ column1.setResizable(false);
+ final TreeColumn column2 = new TreeColumn(tree, SWT.NONE);
+ column2.setText("Column 2");
+ column2.setResizable(false);
+ for (int i = 0; i < 60; i++) {
+ TreeItem item = new TreeItem(tree, SWT.NONE);
+ sbBuffer.append("M");
+ item.setText(new String[] { "item 0 " + sbBuffer.toString() + " " + i, "item 1 " + i });
+ }
+
+ Consumer<Integer> setColumnWidths = (width) -> {
+ int c1w = (int)(width * 0.9);
+ column1.setWidth(c1w);
+ int c1wPost = column1.getWidth();
+ if (c1w != c1wPost)
+ System.err.println("COL_SIZE_ERROR 1 Expected:" + c1w + " actual:" + c1wPost);
+
+ int c2w = width - column1.getWidth();
+ column2.setWidth(c2w);
+ int c2wPost = column2.getWidth();
+ if (c2w != c2wPost)
+ System.err.println("COL_SIZE_ERROR 2 Expected:" + c2w + " actual:" + column2.getWidth());
+ };
+
+ comp.addControlListener(new ControlAdapter()
+ {
+ @Override
public void controlResized(ControlEvent e)
- {
- Rectangle area = tree.getParent().getClientArea();
- Point preferredSize = tree.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- int width = area.width - 2 * tree.getBorderWidth();
- if (preferredSize.y > area.height)
- {
- // Subtract the scrollbar width from the total column width
- // if a vertical scrollbar will be required
- Point vBarSize = tree.getVerticalBar().getSize();
- width -= vBarSize.x;
- }
- Point oldSize = tree.getSize();
- if (oldSize.x > area.width)
- {
- // tree is getting smaller so make the columns
- // smaller first and then resize the tree to
- // match the client area width
- setColumnWidths.accept(width);
- tree.setSize(area.width, area.height);
- }
- else
- {
- // tree is getting bigger so make the tree
- // bigger first and then make the columns wider
- // to match the client area width
- tree.setSize(area.width, area.height);
- setColumnWidths.accept(width);
- }
- }
- });
- shell.open();
- mainLoop(shell);
+ {
+ Rectangle area = tree.getParent().getClientArea();
+ Point preferredSize = tree.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ int width = area.width - 2 * tree.getBorderWidth();
+ if (preferredSize.y > area.height)
+ {
+ // Subtract the scrollbar width from the total column width
+ // if a vertical scrollbar will be required
+ Point vBarSize = tree.getVerticalBar().getSize();
+ width -= vBarSize.x;
+ }
+ Point oldSize = tree.getSize();
+ if (oldSize.x > area.width)
+ {
+ // tree is getting smaller so make the columns
+ // smaller first and then resize the tree to
+ // match the client area width
+ setColumnWidths.accept(width);
+ tree.setSize(area.width, area.height);
+ }
+ else
+ {
+ // tree is getting bigger so make the tree
+ // bigger first and then make the columns wider
+ // to match the client area width
+ tree.setSize(area.width, area.height);
+ setColumnWidths.accept(width);
+ }
+ }
+ });
+ shell.open();
+ mainLoop(shell);
}
@Test
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/manualJUnit/MJ_root.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/manualJUnit/MJ_root.java
index 83c3bb44ac..85b15ae9e5 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/manualJUnit/MJ_root.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/manualJUnit/MJ_root.java
@@ -102,20 +102,20 @@ public class MJ_root {
}
};
- @Rule
- public TestName testName = new TestName();
- private String getCurrentTestName() {
- return testName.getMethodName ();
- }
+ @Rule
+ public TestName testName = new TestName();
+ private String getCurrentTestName() {
+ return testName.getMethodName ();
+ }
- // Util functions.
- public void knownToBeBrokenGtk3(String msg) {
- System.err.println(" info:" + getCurrentTestName() + " is known to be broken at the moment. Additional info: " + msg);
- }
+ // Util functions.
+ public void knownToBeBrokenGtk3(String msg) {
+ System.err.println(" info:" + getCurrentTestName() + " is known to be broken at the moment. Additional info: " + msg);
+ }
- public void knownToBeBrokenGtk(String msg) {
- System.err.println(" info:" + getCurrentTestName() + " is known to be broken at the moment. Additional info: " + msg);
- }
+ public void knownToBeBrokenGtk(String msg) {
+ System.err.println(" info:" + getCurrentTestName() + " is known to be broken at the moment. Additional info: " + msg);
+ }
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/ConsistencyUtility.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/ConsistencyUtility.java
index 87aea9d34a..c86f2680ed 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/ConsistencyUtility.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/ConsistencyUtility.java
@@ -23,114 +23,114 @@ import org.eclipse.swt.widgets.Event;
public class ConsistencyUtility {
- static HashMap<String, String[]> eventOrdering = new HashMap<>();
- static HashMap<String, Integer> eventTypes = new HashMap<>();
- static {
-
- eventOrdering.put("DoubleClick", new String[] {"MouseDown", "Selection:", "MouseUp", "MouseDown", "MouseDoubleClick", "DefaultSelection", "MouseUp"});
- eventOrdering.put("DragDetect", new String[] {"MouseDown", "DragDetect", "MouseUp"});
- eventOrdering.put("EnterSelection", new String[] {"Traverse:Return", "KeyDown", "DefaultSelection", "KeyUp"});
- eventOrdering.put("KeySelection", new String[] {"Traverse:Arrow Next", "KeyDown", "Selection:", "KeyUp"});
- eventOrdering.put("MenuDetect", new String[] {"MouseDown", "MenuDetect", "MouseUp"});
-
- eventOrdering.put("ButtonMouseSelection", new String[] {"MouseDown", "MouseUp", "Selection:"});
- eventOrdering.put("ComboMouseSelection", new String[] {"MouseDown", "MouseUp", "Verify", "Modify", "Selection:"});
- eventOrdering.put("CComboMouseSelection", new String[] {"Modify", "Selection:"});
- eventOrdering.put("ExpandBarMouseSelection",new String[] {"MouseDown", "MouseUp", "Selection:"});
- eventOrdering.put("ListMouseSelection", new String[] {"MouseDown", "MouseUp", "Selection:"});
- eventOrdering.put("SashMouseSelection", new String[] {"Selection:Drag", "MouseDown", "Selection:", "MouseUp"});
- eventOrdering.put("TabFolderMouseSelection",new String[] {"MouseDown", "Selection:", "MouseUp" });
- eventOrdering.put("TableMouseSelection", new String[] {"MouseDown", "Selection:", "MouseUp" });
- eventOrdering.put("ToolBarMouseSelection", new String[] {"MouseDown", "MouseUp", "Selection:"});
- eventOrdering.put("TreeMouseSelection", new String[] {"MouseDown", "Selection:", "MouseUp" });
- eventOrdering.put("CTabFolderMouseSelection",new String[] {"Selection:", "MouseDown", "MouseUp" });
-
- eventOrdering.put("ListDoubleClick", new String[] {"MouseDown", "MouseUp", "Selection:", "MouseDown", "MouseDoubleClick", "DefaultSelection", "MouseUp"});
- eventOrdering.put("ButtonEnterSelection", new String[] {"Traverse:Return", "KeyDown", "KeyUp"});
- eventOrdering.put("ExpandBarEnterSelection",new String[] {"Traverse:Return", "Selection:", "KeyDown", "KeyUp"});
- eventOrdering.put("CComboEnterSelection", new String[] {"Traverse:Return", "DefaultSelection", "KeyDown", "KeyUp"});
- eventOrdering.put("ToolBarEnterSelection", new String[] {"Traverse:Return", "Selection:", "KeyDown", "KeyUp"});
- eventOrdering.put("TreeDragDetect", new String[] {"MouseDown", "Selection:", "DragDetect", "MouseUp"});
- eventOrdering.put("TableMenuDetect", new String[] {"MenuDetect", "MouseDown", "Selection:", "MouseUp"});
-
- eventOrdering.put("ButtonSpaceSelection", new String[] {"Traverse:Mnemonic", "KeyDown", "KeyUp", "Selection:"});
- eventOrdering.put("ExpandBarSpaceSelection",new String[] {"MouseDown", "MouseUp", "Selection:", "Traverse:Mnemonic", "KeyDown", "KeyUp"});
- eventOrdering.put("ListSpaceSelection", new String[] {"Selection:", "KeyDown", "KeyUp"});
- eventOrdering.put("ToolBarSpaceSelection", new String[] {"MouseDown", "MouseUp", "Selection:", "Traverse:Mnemonic", "KeyDown", "KeyUp"});
- eventOrdering.put("TreeSpaceSelection", new String[] {"Selection:", "KeyDown", "KeyUp"});
-
- eventOrdering.put("ComboKeySelection", new String[] {"KeyDown", "Verify", "Modify", "Selection:", "KeyUp"});
- eventOrdering.put("CComboKeySelection", new String[] {"Traverse:Arrow Next", "Modify", "Selection:", "KeyDown", "KeyUp"});
- eventOrdering.put("CTabFolderKeySelection", new String[] {"Traverse:Arrow Next", "Selection:", "KeyDown", "KeyUp"});
- eventOrdering.put("SliderKeySelection", new String[] {"Traverse:Arrow Next", "KeyDown", "Selection:Arrow Down", "KeyUp" });
-
- eventOrdering.put("SliderArrowSelection", new String[] {"MouseDown", "Selection:Arrow Down", "MouseUp" });
-
- eventOrdering.put("CoolBarChevronDragDetect",new String[] {"MouseDown", "DragDetect"});
- eventOrdering.put("CoolBarChevronMenuDetect",new String[] {"MouseDown", "Selection:Arrow"});
- eventOrdering.put("CoolBarChevronMouseSelection",new String[] {"MouseDown", "Selection:Arrow", });
-
- eventOrdering.put("ScaleTroughSelection", new String[] {"Selection:", "MouseDown", "MouseUp" });
- eventOrdering.put("SliderTroughSelection", new String[] {"MouseDown", "Selection:Page Down", "MouseUp" });
- eventOrdering.put("ScaleThumbSelection", new String[] {"Selection:", "MouseDown", "MouseUp" });
- eventOrdering.put("SliderThumbSelection", new String[] {"MouseDown", "Selection:Drag", "MouseUp" });
-
- eventOrdering.put("ShellClose", new String[] {"Close", "Dispose"});
- eventOrdering.put("ShellDispose", new String[] {"Dispose"});
- eventOrdering.put("ShellIconify", new String[] {"FocusOut", "Iconify", "Deactivate", "Deiconify", "Activate", "FocusIn", "Activate"});
- eventOrdering.put("ShellOpen", new String[] {"Activate", "FocusIn", "Show"});
-
- eventOrdering.put("TabFolderPgdwnSelection",new String[] {"KeyDown", "Traverse:Page Next", "Selection:", "KeyUp", "KeyUp"});
- eventOrdering.put("TabFolderPgupSelection", new String[] {"KeyDown", "Traverse:Page Previous", "Selection:", "KeyUp", "KeyUp"});
- eventOrdering.put("CTabFolderPgdwnSelection",new String[] {"KeyDown", "Selection:", "Traverse:None", "KeyUp", "KeyUp"});
- eventOrdering.put("CTabFolderPgupSelection",new String[] {"KeyDown", "Selection:", "Traverse:None", "KeyUp", "KeyUp"});
-
- eventOrdering.put("StyledTextModify", new String[] {"Verify", "Modify", "KeyDown", "KeyUp"});
- eventOrdering.put("TextModify", new String[] {"KeyDown", "Verify", "Modify", "KeyUp"});
-
- eventOrdering.put("TreeKeyExpand", new String[] {"Traverse:Arrow Next", "KeyDown", "Expand", "KeyUp"});
- eventOrdering.put("TreeMouseExpand", new String[] {"Expand", "MouseDown", "MouseUp"});
-
- eventTypes.put("None", Integer.valueOf(SWT.None));
- eventTypes.put("KeyDown", Integer.valueOf(SWT.KeyDown));
- eventTypes.put("KeyUp", Integer.valueOf(SWT.KeyUp));
- eventTypes.put("MouseDown", Integer.valueOf(SWT.MouseDown));
- eventTypes.put("MouseUp", Integer.valueOf(SWT.MouseUp));
- eventTypes.put("MouseMove", Integer.valueOf(SWT.MouseMove));
- eventTypes.put("MouseEnter", Integer.valueOf(SWT.MouseEnter));
- eventTypes.put("MouseExit", Integer.valueOf(SWT.MouseExit));
- eventTypes.put("MouseDoubleClick", Integer.valueOf(SWT.MouseDoubleClick));
- eventTypes.put("Paint", Integer.valueOf(SWT.Paint));
- eventTypes.put("Move", Integer.valueOf(SWT.Move));
- eventTypes.put("Resize", Integer.valueOf(SWT.Resize));
- eventTypes.put("Dispose", Integer.valueOf(SWT.Dispose));
- eventTypes.put("Selection", Integer.valueOf(SWT.Selection));
- eventTypes.put("DefaultSelection", Integer.valueOf(SWT.DefaultSelection));
- eventTypes.put("FocusIn", Integer.valueOf(SWT.FocusIn));
- eventTypes.put("FocusOut", Integer.valueOf(SWT.FocusOut));
- eventTypes.put("Expand", Integer.valueOf(SWT.Expand));
- eventTypes.put("Collapse", Integer.valueOf(SWT.Collapse));
- eventTypes.put("Iconify", Integer.valueOf(SWT.Iconify));
- eventTypes.put("Deiconify", Integer.valueOf(SWT.Deiconify));
- eventTypes.put("Close", Integer.valueOf(SWT.Close));
- eventTypes.put("Show", Integer.valueOf(SWT.Show));
- eventTypes.put("Hide", Integer.valueOf(SWT.Hide));
- eventTypes.put("Modify", Integer.valueOf(SWT.Modify));
- eventTypes.put("Verify", Integer.valueOf(SWT.Verify));
- eventTypes.put("Activate", Integer.valueOf(SWT.Activate));
- eventTypes.put("Deactivate", Integer.valueOf(SWT.Deactivate));
- eventTypes.put("Help", Integer.valueOf(SWT.Help));
- eventTypes.put("DragDetect", Integer.valueOf(SWT.DragDetect));
- eventTypes.put("Arm", Integer.valueOf(SWT.Arm));
- eventTypes.put("Traverse", Integer.valueOf(SWT.Traverse));
- eventTypes.put("MouseHover", Integer.valueOf(SWT.MouseHover));
- eventTypes.put("HardKeyDown", Integer.valueOf(SWT.HardKeyDown));
- eventTypes.put("HardKeyUp", Integer.valueOf(SWT.HardKeyUp));
- eventTypes.put("MenuDetect", Integer.valueOf(SWT.MenuDetect));
- eventTypes.put("SetData", Integer.valueOf(SWT.SetData));
- }
-
- static String[] eventNames = {
+ static HashMap<String, String[]> eventOrdering = new HashMap<>();
+ static HashMap<String, Integer> eventTypes = new HashMap<>();
+ static {
+
+ eventOrdering.put("DoubleClick", new String[] {"MouseDown", "Selection:", "MouseUp", "MouseDown", "MouseDoubleClick", "DefaultSelection", "MouseUp"});
+ eventOrdering.put("DragDetect", new String[] {"MouseDown", "DragDetect", "MouseUp"});
+ eventOrdering.put("EnterSelection", new String[] {"Traverse:Return", "KeyDown", "DefaultSelection", "KeyUp"});
+ eventOrdering.put("KeySelection", new String[] {"Traverse:Arrow Next", "KeyDown", "Selection:", "KeyUp"});
+ eventOrdering.put("MenuDetect", new String[] {"MouseDown", "MenuDetect", "MouseUp"});
+
+ eventOrdering.put("ButtonMouseSelection", new String[] {"MouseDown", "MouseUp", "Selection:"});
+ eventOrdering.put("ComboMouseSelection", new String[] {"MouseDown", "MouseUp", "Verify", "Modify", "Selection:"});
+ eventOrdering.put("CComboMouseSelection", new String[] {"Modify", "Selection:"});
+ eventOrdering.put("ExpandBarMouseSelection",new String[] {"MouseDown", "MouseUp", "Selection:"});
+ eventOrdering.put("ListMouseSelection", new String[] {"MouseDown", "MouseUp", "Selection:"});
+ eventOrdering.put("SashMouseSelection", new String[] {"Selection:Drag", "MouseDown", "Selection:", "MouseUp"});
+ eventOrdering.put("TabFolderMouseSelection",new String[] {"MouseDown", "Selection:", "MouseUp" });
+ eventOrdering.put("TableMouseSelection", new String[] {"MouseDown", "Selection:", "MouseUp" });
+ eventOrdering.put("ToolBarMouseSelection", new String[] {"MouseDown", "MouseUp", "Selection:"});
+ eventOrdering.put("TreeMouseSelection", new String[] {"MouseDown", "Selection:", "MouseUp" });
+ eventOrdering.put("CTabFolderMouseSelection",new String[] {"Selection:", "MouseDown", "MouseUp" });
+
+ eventOrdering.put("ListDoubleClick", new String[] {"MouseDown", "MouseUp", "Selection:", "MouseDown", "MouseDoubleClick", "DefaultSelection", "MouseUp"});
+ eventOrdering.put("ButtonEnterSelection", new String[] {"Traverse:Return", "KeyDown", "KeyUp"});
+ eventOrdering.put("ExpandBarEnterSelection",new String[] {"Traverse:Return", "Selection:", "KeyDown", "KeyUp"});
+ eventOrdering.put("CComboEnterSelection", new String[] {"Traverse:Return", "DefaultSelection", "KeyDown", "KeyUp"});
+ eventOrdering.put("ToolBarEnterSelection", new String[] {"Traverse:Return", "Selection:", "KeyDown", "KeyUp"});
+ eventOrdering.put("TreeDragDetect", new String[] {"MouseDown", "Selection:", "DragDetect", "MouseUp"});
+ eventOrdering.put("TableMenuDetect", new String[] {"MenuDetect", "MouseDown", "Selection:", "MouseUp"});
+
+ eventOrdering.put("ButtonSpaceSelection", new String[] {"Traverse:Mnemonic", "KeyDown", "KeyUp", "Selection:"});
+ eventOrdering.put("ExpandBarSpaceSelection",new String[] {"MouseDown", "MouseUp", "Selection:", "Traverse:Mnemonic", "KeyDown", "KeyUp"});
+ eventOrdering.put("ListSpaceSelection", new String[] {"Selection:", "KeyDown", "KeyUp"});
+ eventOrdering.put("ToolBarSpaceSelection", new String[] {"MouseDown", "MouseUp", "Selection:", "Traverse:Mnemonic", "KeyDown", "KeyUp"});
+ eventOrdering.put("TreeSpaceSelection", new String[] {"Selection:", "KeyDown", "KeyUp"});
+
+ eventOrdering.put("ComboKeySelection", new String[] {"KeyDown", "Verify", "Modify", "Selection:", "KeyUp"});
+ eventOrdering.put("CComboKeySelection", new String[] {"Traverse:Arrow Next", "Modify", "Selection:", "KeyDown", "KeyUp"});
+ eventOrdering.put("CTabFolderKeySelection", new String[] {"Traverse:Arrow Next", "Selection:", "KeyDown", "KeyUp"});
+ eventOrdering.put("SliderKeySelection", new String[] {"Traverse:Arrow Next", "KeyDown", "Selection:Arrow Down", "KeyUp" });
+
+ eventOrdering.put("SliderArrowSelection", new String[] {"MouseDown", "Selection:Arrow Down", "MouseUp" });
+
+ eventOrdering.put("CoolBarChevronDragDetect",new String[] {"MouseDown", "DragDetect"});
+ eventOrdering.put("CoolBarChevronMenuDetect",new String[] {"MouseDown", "Selection:Arrow"});
+ eventOrdering.put("CoolBarChevronMouseSelection",new String[] {"MouseDown", "Selection:Arrow", });
+
+ eventOrdering.put("ScaleTroughSelection", new String[] {"Selection:", "MouseDown", "MouseUp" });
+ eventOrdering.put("SliderTroughSelection", new String[] {"MouseDown", "Selection:Page Down", "MouseUp" });
+ eventOrdering.put("ScaleThumbSelection", new String[] {"Selection:", "MouseDown", "MouseUp" });
+ eventOrdering.put("SliderThumbSelection", new String[] {"MouseDown", "Selection:Drag", "MouseUp" });
+
+ eventOrdering.put("ShellClose", new String[] {"Close", "Dispose"});
+ eventOrdering.put("ShellDispose", new String[] {"Dispose"});
+ eventOrdering.put("ShellIconify", new String[] {"FocusOut", "Iconify", "Deactivate", "Deiconify", "Activate", "FocusIn", "Activate"});
+ eventOrdering.put("ShellOpen", new String[] {"Activate", "FocusIn", "Show"});
+
+ eventOrdering.put("TabFolderPgdwnSelection",new String[] {"KeyDown", "Traverse:Page Next", "Selection:", "KeyUp", "KeyUp"});
+ eventOrdering.put("TabFolderPgupSelection", new String[] {"KeyDown", "Traverse:Page Previous", "Selection:", "KeyUp", "KeyUp"});
+ eventOrdering.put("CTabFolderPgdwnSelection",new String[] {"KeyDown", "Selection:", "Traverse:None", "KeyUp", "KeyUp"});
+ eventOrdering.put("CTabFolderPgupSelection",new String[] {"KeyDown", "Selection:", "Traverse:None", "KeyUp", "KeyUp"});
+
+ eventOrdering.put("StyledTextModify", new String[] {"Verify", "Modify", "KeyDown", "KeyUp"});
+ eventOrdering.put("TextModify", new String[] {"KeyDown", "Verify", "Modify", "KeyUp"});
+
+ eventOrdering.put("TreeKeyExpand", new String[] {"Traverse:Arrow Next", "KeyDown", "Expand", "KeyUp"});
+ eventOrdering.put("TreeMouseExpand", new String[] {"Expand", "MouseDown", "MouseUp"});
+
+ eventTypes.put("None", Integer.valueOf(SWT.None));
+ eventTypes.put("KeyDown", Integer.valueOf(SWT.KeyDown));
+ eventTypes.put("KeyUp", Integer.valueOf(SWT.KeyUp));
+ eventTypes.put("MouseDown", Integer.valueOf(SWT.MouseDown));
+ eventTypes.put("MouseUp", Integer.valueOf(SWT.MouseUp));
+ eventTypes.put("MouseMove", Integer.valueOf(SWT.MouseMove));
+ eventTypes.put("MouseEnter", Integer.valueOf(SWT.MouseEnter));
+ eventTypes.put("MouseExit", Integer.valueOf(SWT.MouseExit));
+ eventTypes.put("MouseDoubleClick", Integer.valueOf(SWT.MouseDoubleClick));
+ eventTypes.put("Paint", Integer.valueOf(SWT.Paint));
+ eventTypes.put("Move", Integer.valueOf(SWT.Move));
+ eventTypes.put("Resize", Integer.valueOf(SWT.Resize));
+ eventTypes.put("Dispose", Integer.valueOf(SWT.Dispose));
+ eventTypes.put("Selection", Integer.valueOf(SWT.Selection));
+ eventTypes.put("DefaultSelection", Integer.valueOf(SWT.DefaultSelection));
+ eventTypes.put("FocusIn", Integer.valueOf(SWT.FocusIn));
+ eventTypes.put("FocusOut", Integer.valueOf(SWT.FocusOut));
+ eventTypes.put("Expand", Integer.valueOf(SWT.Expand));
+ eventTypes.put("Collapse", Integer.valueOf(SWT.Collapse));
+ eventTypes.put("Iconify", Integer.valueOf(SWT.Iconify));
+ eventTypes.put("Deiconify", Integer.valueOf(SWT.Deiconify));
+ eventTypes.put("Close", Integer.valueOf(SWT.Close));
+ eventTypes.put("Show", Integer.valueOf(SWT.Show));
+ eventTypes.put("Hide", Integer.valueOf(SWT.Hide));
+ eventTypes.put("Modify", Integer.valueOf(SWT.Modify));
+ eventTypes.put("Verify", Integer.valueOf(SWT.Verify));
+ eventTypes.put("Activate", Integer.valueOf(SWT.Activate));
+ eventTypes.put("Deactivate", Integer.valueOf(SWT.Deactivate));
+ eventTypes.put("Help", Integer.valueOf(SWT.Help));
+ eventTypes.put("DragDetect", Integer.valueOf(SWT.DragDetect));
+ eventTypes.put("Arm", Integer.valueOf(SWT.Arm));
+ eventTypes.put("Traverse", Integer.valueOf(SWT.Traverse));
+ eventTypes.put("MouseHover", Integer.valueOf(SWT.MouseHover));
+ eventTypes.put("HardKeyDown", Integer.valueOf(SWT.HardKeyDown));
+ eventTypes.put("HardKeyUp", Integer.valueOf(SWT.HardKeyUp));
+ eventTypes.put("MenuDetect", Integer.valueOf(SWT.MenuDetect));
+ eventTypes.put("SetData", Integer.valueOf(SWT.SetData));
+ }
+
+ static String[] eventNames = {
"None", "KeyDown", "KeyUp", "MouseDown",
"MouseUp", "MouseMove", "MouseEnter", "MouseExit",
"MouseDoubleClick", "Paint", "Move", "Resize",
@@ -142,254 +142,254 @@ public class ConsistencyUtility {
"MouseHover", "HardKeyDown", "HardKeyUp", "MenuDetect",
"SetData"};
- static int[] convertEventNames(String[] origNames) {
- String[] names = new String[origNames.length];
- System.arraycopy(origNames, 0, names, 0, origNames.length);
- names = removeDuplicates(names);
- int[] types = new int[names.length];
- for(int i=0; i<names.length; i++) {
- types[i] = eventTypes.get(names[i]).intValue();
- }
- return types;
- }
-
- private static String[] removeDuplicates(String[] names) {
- int dups=0;
- for(int i=0; i<names.length; i++) {
- int index = names[i].indexOf(':');
- if(index != -1)
- names[i] = names[i].substring(0, index);
- for(int j=0; j<i; j++) {
- if(names[i].equals(names[j])) {
- for(int k=i+1; k<names.length; k++) {
- names[k-1] = names[k];
- }
- names[names.length-1] = "duplicate"+ dups;
- dups++;
- }
- }
- }
- String[] temp = new String[names.length-dups];
- System.arraycopy(names, 0, temp, 0, names.length-dups);
- return temp;
- }
-
- public static String[] selectionTypes = {
- "Drag", "Home", "End", "Arrow Down",
- "Arrow Up", "Page Down", "Page Up", "Check",
- "Arrow",
- };
-
- public static int[] [] selectionConversion = {
- {SWT.DRAG, 0},
- {SWT.HOME, 1},
- {SWT.END, 2},
- {SWT.ARROW_DOWN, 3},
- {SWT.ARROW_UP, 4},
- {SWT.PAGE_DOWN, 5},
- {SWT.PAGE_UP, 6},
- {SWT.CHECK, 7},
- {SWT.ARROW, 8},
- };
-
- static String getSelectionType(int type) {
- for(int i=0; i<selectionConversion.length;i++) {
- if(type == selectionConversion[i][0])
- return selectionTypes[selectionConversion[i][1]];
- }
- return "";
- }
-
- static String[] traversalTypes = {
- "None", "Escape", "Return", "Tab Previous",
- "Tab Next", "Arrow Previous", "Arrow Next", "Mnemonic",
- "Page Previous", "Page Next"};
-
- static String getTraversalType(int type) {
- int pow = 0;
- if(type != 0)
- pow =(int)(Math.log(type)/Math.log(2));
- return traversalTypes[pow];
- }
-
- static final int NONE = 0;
- static final int SHELL_ICONIFY = 1;
- static final int KEY_PRESS = 10;
- static final int DOUBLE_KEY_PRESS = 20;
- static final int MOUSE_CLICK = 30;
- static final int MOUSE_DOUBLECLICK = 40;
- static final int MOUSE_DRAG = 50;
- static final int SELECTION = 60;
-
- static final int ESCAPE_MENU = 1;
-
-
- //posts a click at display mapped x and y with button button
- static boolean postClick(Display display, int x, int y, int button) {
- Event event = new Event();
- event.type = SWT.MouseMove;
- event.x = x;
- event.y = y;
- if(!display.post(event)) {
- System.out.println("MouseMove not posted");
- return false;
- }
-
- event = new Event();
- event.type = SWT.MouseDown;
- event.button = button;
- if(!display.post(event)) {
- System.out.println("MouseDown not posted");
- return false;
- }
- event = new Event();
- event.type = SWT.MouseUp;
- event.button = button;
- if(!display.post(event)) {
- System.out.println("MouseUp not posted");
- //TODO: potentially dangerous to have a mousedown and no mouseup
- //force the issue?
- return false;
- }
+ static int[] convertEventNames(String[] origNames) {
+ String[] names = new String[origNames.length];
+ System.arraycopy(origNames, 0, names, 0, origNames.length);
+ names = removeDuplicates(names);
+ int[] types = new int[names.length];
+ for(int i=0; i<names.length; i++) {
+ types[i] = eventTypes.get(names[i]).intValue();
+ }
+ return types;
+ }
+
+ private static String[] removeDuplicates(String[] names) {
+ int dups=0;
+ for(int i=0; i<names.length; i++) {
+ int index = names[i].indexOf(':');
+ if(index != -1)
+ names[i] = names[i].substring(0, index);
+ for(int j=0; j<i; j++) {
+ if(names[i].equals(names[j])) {
+ for(int k=i+1; k<names.length; k++) {
+ names[k-1] = names[k];
+ }
+ names[names.length-1] = "duplicate"+ dups;
+ dups++;
+ }
+ }
+ }
+ String[] temp = new String[names.length-dups];
+ System.arraycopy(names, 0, temp, 0, names.length-dups);
+ return temp;
+ }
+
+ public static String[] selectionTypes = {
+ "Drag", "Home", "End", "Arrow Down",
+ "Arrow Up", "Page Down", "Page Up", "Check",
+ "Arrow",
+ };
+
+ public static int[] [] selectionConversion = {
+ {SWT.DRAG, 0},
+ {SWT.HOME, 1},
+ {SWT.END, 2},
+ {SWT.ARROW_DOWN, 3},
+ {SWT.ARROW_UP, 4},
+ {SWT.PAGE_DOWN, 5},
+ {SWT.PAGE_UP, 6},
+ {SWT.CHECK, 7},
+ {SWT.ARROW, 8},
+ };
+
+ static String getSelectionType(int type) {
+ for(int i=0; i<selectionConversion.length;i++) {
+ if(type == selectionConversion[i][0])
+ return selectionTypes[selectionConversion[i][1]];
+ }
+ return "";
+ }
+
+ static String[] traversalTypes = {
+ "None", "Escape", "Return", "Tab Previous",
+ "Tab Next", "Arrow Previous", "Arrow Next", "Mnemonic",
+ "Page Previous", "Page Next"};
+
+ static String getTraversalType(int type) {
+ int pow = 0;
+ if(type != 0)
+ pow =(int)(Math.log(type)/Math.log(2));
+ return traversalTypes[pow];
+ }
+
+ static final int NONE = 0;
+ static final int SHELL_ICONIFY = 1;
+ static final int KEY_PRESS = 10;
+ static final int DOUBLE_KEY_PRESS = 20;
+ static final int MOUSE_CLICK = 30;
+ static final int MOUSE_DOUBLECLICK = 40;
+ static final int MOUSE_DRAG = 50;
+ static final int SELECTION = 60;
+
+ static final int ESCAPE_MENU = 1;
+
+
+ //posts a click at display mapped x and y with button button
+ static boolean postClick(Display display, int x, int y, int button) {
+ Event event = new Event();
+ event.type = SWT.MouseMove;
+ event.x = x;
+ event.y = y;
+ if(!display.post(event)) {
+ System.out.println("MouseMove not posted");
+ return false;
+ }
+
+ event = new Event();
+ event.type = SWT.MouseDown;
+ event.button = button;
+ if(!display.post(event)) {
+ System.out.println("MouseDown not posted");
+ return false;
+ }
+ event = new Event();
+ event.type = SWT.MouseUp;
+ event.button = button;
+ if(!display.post(event)) {
+ System.out.println("MouseUp not posted");
+ //TODO: potentially dangerous to have a mousedown and no mouseup
+ //force the issue?
+ return false;
+ }
// try {
// Thread.sleep(1600);
// } catch(InterruptedException ie) {}
- return true;
- }
+ return true;
+ }
- static boolean postClick(Display display, Point pt, int button) {
- return postClick(display, pt.x, pt.y, button);
- }
+ static boolean postClick(Display display, Point pt, int button) {
+ return postClick(display, pt.x, pt.y, button);
+ }
- //doubleclicks at display mapped pt with button button
- static boolean postDoubleClick(Display display, Point pt, int button) {
- boolean ret = postClick(display, pt, button);
- ret &= postClick(display, pt, button);
+ //doubleclicks at display mapped pt with button button
+ static boolean postDoubleClick(Display display, Point pt, int button) {
+ boolean ret = postClick(display, pt, button);
+ ret &= postClick(display, pt, button);
// try {
// Thread.sleep(1600);
// } catch(InterruptedException ie) {}
- return ret;
- }
-
- //post a key press
- static boolean postKeyPress(Display display, int ch, int keycode) {
- Event event = new Event();
- event.type = SWT.KeyDown;
- event.character = (char)ch;
- event.keyCode = keycode;
- if(!display.post(event)) {
- System.out.println("KeyDown not posted");
- return false;
- }
- event = new Event();
- event.type = SWT.KeyUp;
- event.character = (char)ch;
- event.keyCode = keycode;
- if(!display.post(event)) {
- System.out.println("KeyUp not posted");
- //TODO: potentially dangerous to have a keydown and no keyup
- //force the issue?
- return false;
- }
- return true;
- }
-
- //post pressing and holding ch1/keycode1 and then pressing ch2/keycode2
- static boolean postDoubleKeyPress(Display display, int ch1, int keycode1,
- int ch2, int keycode2) {
- Event event = new Event();
- event.type = SWT.KeyDown;
- event.character = (char)ch1;
- event.keyCode = keycode1;
- if(!display.post(event)) {
- System.out.println("KeyDown not posted");
- return false;
- }
- postKeyPress(display, ch2, keycode2);
- event = new Event();
- event.type = SWT.KeyUp;
- event.character = (char)ch1;
- event.keyCode = keycode1;
- if(!display.post(event)) {
- System.out.println("KeyUp not posted");
- //TODO: potentially dangerous to have a keydown and no keyup
- //force the issue?
- return false;
- }
- return true;
- }
-
- //posts a drag from display mapped origin to destination
- //the button to drag with is system dependent
- static boolean postDrag(Display display, Point origin, Point destination) {
- int button = determineDrag();
- Event event = new Event();
- event.type = SWT.MouseMove;
- event.x = origin.x;
- event.y = origin.y;
- if(!display.post(event)) {
- System.out.println("MouseMove not posted");
- return false;
- }
-
- event = new Event();
- event.type = SWT.MouseDown;
- event.button = button;
- if(!display.post(event)) {
- System.out.println("MouseDown not posted");
- return false;
- }
-
- event = new Event();
- event.type = SWT.MouseMove;
- event.x = destination.x;
- event.y = destination.y;
- if(!display.post(event)) {
- System.out.println("MouseMove not posted");
- return false;
- }
-
- event = new Event();
- event.type = SWT.MouseUp;
- event.button = button;
- if(!display.post(event)) {
- System.out.println("MouseUp not posted");
- //TODO: potentially dangerous to have a mousedown and no mouseup
- //force the issue?
- return false;
- }
- return true;
- }
-
- //determines which button to drag with
- private static int determineDrag() {
- if(SwtTestUtil.isWindows || SwtTestUtil.isGTK)
- return 1;
- return 2;
- }
-
- //posts a selection ie clicks on pt1, then click on pt2 (for example, selecting
- //one of the options in a combo by dropping down the list)
- static boolean postSelection(final Display display, Point pt1, Point pt2) {
- boolean ret = postClick(display, pt1, 1);
- display.syncExec(new Thread() {
- @Override
+ return ret;
+ }
+
+ //post a key press
+ static boolean postKeyPress(Display display, int ch, int keycode) {
+ Event event = new Event();
+ event.type = SWT.KeyDown;
+ event.character = (char)ch;
+ event.keyCode = keycode;
+ if(!display.post(event)) {
+ System.out.println("KeyDown not posted");
+ return false;
+ }
+ event = new Event();
+ event.type = SWT.KeyUp;
+ event.character = (char)ch;
+ event.keyCode = keycode;
+ if(!display.post(event)) {
+ System.out.println("KeyUp not posted");
+ //TODO: potentially dangerous to have a keydown and no keyup
+ //force the issue?
+ return false;
+ }
+ return true;
+ }
+
+ //post pressing and holding ch1/keycode1 and then pressing ch2/keycode2
+ static boolean postDoubleKeyPress(Display display, int ch1, int keycode1,
+ int ch2, int keycode2) {
+ Event event = new Event();
+ event.type = SWT.KeyDown;
+ event.character = (char)ch1;
+ event.keyCode = keycode1;
+ if(!display.post(event)) {
+ System.out.println("KeyDown not posted");
+ return false;
+ }
+ postKeyPress(display, ch2, keycode2);
+ event = new Event();
+ event.type = SWT.KeyUp;
+ event.character = (char)ch1;
+ event.keyCode = keycode1;
+ if(!display.post(event)) {
+ System.out.println("KeyUp not posted");
+ //TODO: potentially dangerous to have a keydown and no keyup
+ //force the issue?
+ return false;
+ }
+ return true;
+ }
+
+ //posts a drag from display mapped origin to destination
+ //the button to drag with is system dependent
+ static boolean postDrag(Display display, Point origin, Point destination) {
+ int button = determineDrag();
+ Event event = new Event();
+ event.type = SWT.MouseMove;
+ event.x = origin.x;
+ event.y = origin.y;
+ if(!display.post(event)) {
+ System.out.println("MouseMove not posted");
+ return false;
+ }
+
+ event = new Event();
+ event.type = SWT.MouseDown;
+ event.button = button;
+ if(!display.post(event)) {
+ System.out.println("MouseDown not posted");
+ return false;
+ }
+
+ event = new Event();
+ event.type = SWT.MouseMove;
+ event.x = destination.x;
+ event.y = destination.y;
+ if(!display.post(event)) {
+ System.out.println("MouseMove not posted");
+ return false;
+ }
+
+ event = new Event();
+ event.type = SWT.MouseUp;
+ event.button = button;
+ if(!display.post(event)) {
+ System.out.println("MouseUp not posted");
+ //TODO: potentially dangerous to have a mousedown and no mouseup
+ //force the issue?
+ return false;
+ }
+ return true;
+ }
+
+ //determines which button to drag with
+ private static int determineDrag() {
+ if(SwtTestUtil.isWindows || SwtTestUtil.isGTK)
+ return 1;
+ return 2;
+ }
+
+ //posts a selection ie clicks on pt1, then click on pt2 (for example, selecting
+ //one of the options in a combo by dropping down the list)
+ static boolean postSelection(final Display display, Point pt1, Point pt2) {
+ boolean ret = postClick(display, pt1, 1);
+ display.syncExec(new Thread() {
+ @Override
public void run() {
- display.update();
- }});
- ret &= postClick(display, pt2, 1);
- return ret;
- }
-
- //iconifies the shell. pt is a system dependent point on the shell.
- static boolean postShellIconify(Display display, Point pt, int button) {
- int x = pt.x;
- int y = pt.y - 10;
- if(SwtTestUtil.isWindows) {
- x += -35;
- } else if(SwtTestUtil.isLinux) {
- x += -16;
- }
- return postClick(display, x, y, button);
- }
+ display.update();
+ }});
+ ret &= postClick(display, pt2, 1);
+ return ret;
+ }
+
+ //iconifies the shell. pt is a system dependent point on the shell.
+ static boolean postShellIconify(Display display, Point pt, int button) {
+ int x = pt.x;
+ int y = pt.y - 10;
+ if(SwtTestUtil.isWindows) {
+ x += -35;
+ } else if(SwtTestUtil.isLinux) {
+ x += -16;
+ }
+ return postClick(display, x, y, button);
+ }
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/StyledTextContentSpec.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/StyledTextContentSpec.java
index 87c5413b35..f357788f44 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/StyledTextContentSpec.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/StyledTextContentSpec.java
@@ -971,7 +971,7 @@ public void test_Text_Changed_Event() {
catch (IllegalArgumentException ex) {assertTrue(":17:", true);}
verify = 18;
- content.setText("L1\r");
+ content.setText("L1\r");
content.replaceTextRange(3, 0, "\ntest\r\n");
verify = 19;
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java
index 2f8500afaf..0eb1205187 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java
@@ -587,7 +587,7 @@ public void test_OpenWindowListener_open_ChildPopup() {
childShell.open();
browserChild.setText("Child Browser");
}));
- //Triggers test to finish.
+ //Triggers test to finish.
browserChild.addProgressListener(completedAdapter(event -> childCompleted.set(true)));
shell.open();
@@ -1306,7 +1306,7 @@ public void test_LocationListener_evaluateInCallback() {
String errMsg = "\n changing: fired:" + changingFinished.get() + " evaluated:" + changing +
- "\n changed: fired:" + changedFinished.get() + " evaluated:" + changed;
+ "\n changed: fired:" + changedFinished.get() + " evaluated:" + changed;
boolean passed = false;
if (isWebkit2) {
@@ -1666,7 +1666,7 @@ public void test_evaluate_boolean() {
@Test
public void test_evaluate_null() {
assumeFalse(webkit1SkipMsg(), isWebkit1); // Bug 509411
- // Boolen only used as dummy placeholder so the object is not null.
+ // Boolen only used as dummy placeholder so the object is not null.
final AtomicReference<Object> returnValue = new AtomicReference<>(true);
browser.addProgressListener(completedAdapter(event -> {
Object evalResult = browser.evaluate("return null");
@@ -1999,7 +1999,7 @@ public void test_BrowserFunction_callback_with_boolean () {
@Override
public Object function(Object[] arguments) {
Boolean returnBool = (Boolean) arguments[0];
- javaCallbackExecuted.set(returnBool);
+ javaCallbackExecuted.set(returnBool);
return null;
}
}
@@ -2332,23 +2332,23 @@ private String webkit1SkipMsg() {
*/
private static Boolean checkInternet(String url) {
HttpURLConnection connection = null;
- try {
- connection = (HttpURLConnection) new URL(url).openConnection();
- connection.setRequestMethod("HEAD");
- int code = connection.getResponseCode(); // 200 is success. See https://tools.ietf.org/html/rfc7231#section-6.3.1.
- if (code == 200)
- return true;
- } catch (MalformedURLException e) {
- System.err.println("Given url is malformed: " + url + "Try a fully formed url like: http://www.example.com");
- e.printStackTrace();
- } catch (IOException e) {
- // No connection was made.
- } finally {
- if (connection != null) {
- connection.disconnect();
- }
- }
- return false;
+ try {
+ connection = (HttpURLConnection) new URL(url).openConnection();
+ connection.setRequestMethod("HEAD");
+ int code = connection.getResponseCode(); // 200 is success. See https://tools.ietf.org/html/rfc7231#section-6.3.1.
+ if (code == 200)
+ return true;
+ } catch (MalformedURLException e) {
+ System.err.println("Given url is malformed: " + url + "Try a fully formed url like: http://www.example.com");
+ e.printStackTrace();
+ } catch (IOException e) {
+ // No connection was made.
+ } finally {
+ if (connection != null) {
+ connection.disconnect();
+ }
+ }
+ return false;
}
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CCombo.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CCombo.java
index a413e1ed61..deef387cc1 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CCombo.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CCombo.java
@@ -289,45 +289,45 @@ public void test_setVisibleZ() {
CCombo ccombo;
private void add() {
- ccombo.add("this");
- ccombo.add("is");
- ccombo.add("SWT");
+ ccombo.add("this");
+ ccombo.add("is");
+ ccombo.add("SWT");
}
@Test
public void test_consistency_MouseSelection () {
- add();
- consistencyPrePackShell();
- consistencyEvent(ccombo.getSize().x-10, 5, 30, ccombo.getItemHeight()*2,
- ConsistencyUtility.SELECTION);
+ add();
+ consistencyPrePackShell();
+ consistencyEvent(ccombo.getSize().x-10, 5, 30, ccombo.getItemHeight()*2,
+ ConsistencyUtility.SELECTION);
}
@Test
public void test_consistency_KeySelection () {
- add();
- consistencyEvent(0, SWT.ARROW_DOWN, 0, 0, ConsistencyUtility.KEY_PRESS);
+ add();
+ consistencyEvent(0, SWT.ARROW_DOWN, 0, 0, ConsistencyUtility.KEY_PRESS);
}
@Test
public void test_consistency_EnterSelection () {
- add();
- consistencyEvent(10, 13, 0, 0, ConsistencyUtility.KEY_PRESS);
+ add();
+ consistencyEvent(10, 13, 0, 0, ConsistencyUtility.KEY_PRESS);
}
@Test
public void test_consistency_MenuDetect () {
- add();
- consistencyPrePackShell();
- //on arrow
- consistencyEvent(ccombo.getSize().x-10, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
- //on text
- consistencyEvent(10, 5, 3, ConsistencyUtility.ESCAPE_MENU, ConsistencyUtility.MOUSE_CLICK);
+ add();
+ consistencyPrePackShell();
+ //on arrow
+ consistencyEvent(ccombo.getSize().x-10, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
+ //on text
+ consistencyEvent(10, 5, 3, ConsistencyUtility.ESCAPE_MENU, ConsistencyUtility.MOUSE_CLICK);
}
@Test
public void test_consistency_DragDetect () {
- add();
- consistencyEvent(10, 5, 20, 10, ConsistencyUtility.MOUSE_DRAG);
+ add();
+ consistencyEvent(10, 5, 20, 10, ConsistencyUtility.MOUSE_DRAG);
}
@Test
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CLabel.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CLabel.java
index 5e748f2fd6..ceb6782fc6 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CLabel.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CLabel.java
@@ -64,12 +64,12 @@ CLabel label;
@Override
@Test
public void test_consistency_MenuDetect () {
- consistencyEvent(10, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
+ consistencyEvent(10, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
}
@Override
@Test
public void test_consistency_DragDetect () {
- consistencyEvent(10, 5, 20, 10, ConsistencyUtility.MOUSE_DRAG);
+ consistencyEvent(10, 5, 20, 10, ConsistencyUtility.MOUSE_DRAG);
}
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CTabFolder.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CTabFolder.java
index a1574def6c..574bbe5e25 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CTabFolder.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CTabFolder.java
@@ -106,48 +106,48 @@ private void createTabFolder(List<String> events) {
@Test
public void test_consistency_KeySelection() {
- List<String> events = new ArrayList<>();
- createTabFolder(events);
- consistencyEvent(0, SWT.ARROW_RIGHT, 0, 0, ConsistencyUtility.KEY_PRESS, events, false);
+ List<String> events = new ArrayList<>();
+ createTabFolder(events);
+ consistencyEvent(0, SWT.ARROW_RIGHT, 0, 0, ConsistencyUtility.KEY_PRESS, events, false);
}
@Test
public void test_consistency_MouseSelection() {
- List<String> events = new ArrayList<>();
- createTabFolder(events);
- consistencyPrePackShell();
- consistencyEvent(ctabFolder.getSize().x/2, 5, 1, 0, ConsistencyUtility.MOUSE_CLICK, events);
+ List<String> events = new ArrayList<>();
+ createTabFolder(events);
+ consistencyPrePackShell();
+ consistencyEvent(ctabFolder.getSize().x/2, 5, 1, 0, ConsistencyUtility.MOUSE_CLICK, events);
}
@Test
public void test_consistency_PgdwnSelection () {
- List<String> events = new ArrayList<>();
- createTabFolder(events);
- consistencyEvent(0, SWT.CTRL, 0, SWT.PAGE_DOWN, ConsistencyUtility.DOUBLE_KEY_PRESS, events, false);
+ List<String> events = new ArrayList<>();
+ createTabFolder(events);
+ consistencyEvent(0, SWT.CTRL, 0, SWT.PAGE_DOWN, ConsistencyUtility.DOUBLE_KEY_PRESS, events, false);
}
@Test
public void test_consistency_PgupSelection () {
- List<String> events = new ArrayList<>();
- createTabFolder(events);
- ctabFolder.setSelection(2);
- consistencyEvent(0, SWT.CTRL, 0, SWT.PAGE_UP, ConsistencyUtility.DOUBLE_KEY_PRESS, events, false);
+ List<String> events = new ArrayList<>();
+ createTabFolder(events);
+ ctabFolder.setSelection(2);
+ consistencyEvent(0, SWT.CTRL, 0, SWT.PAGE_UP, ConsistencyUtility.DOUBLE_KEY_PRESS, events, false);
}
@Test
public void test_consistency_MenuDetect () {
- List<String> events = new ArrayList<>();
- createTabFolder(events);
- ctabFolder.setSelection(1);
- consistencyEvent(50, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK, events);
+ List<String> events = new ArrayList<>();
+ createTabFolder(events);
+ ctabFolder.setSelection(1);
+ consistencyEvent(50, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK, events);
}
@Test
public void test_consistency_DragDetect () {
- List<String> events = new ArrayList<>();
- createTabFolder(events);
- ctabFolder.setSelection(1);
- consistencyEvent(50, 5, 70, 10, ConsistencyUtility.MOUSE_DRAG, events);
+ List<String> events = new ArrayList<>();
+ createTabFolder(events);
+ ctabFolder.setSelection(1);
+ consistencyEvent(50, 5, 70, 10, ConsistencyUtility.MOUSE_DRAG, events);
}
@Test
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_ExtendedModifyListener.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_ExtendedModifyListener.java
index 909f861914..2b2b08c2b8 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_ExtendedModifyListener.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_ExtendedModifyListener.java
@@ -278,7 +278,7 @@ public void test_modifyTextLorg_eclipse_swt_custom_ExtendedModifyEvent() {
exceptionHandled = false;
verify = 0;
- styledText.setText("L1\r");
+ styledText.setText("L1\r");
verify = 18;
styledText.replaceTextRange(3, 0, "\ntest\r\n");
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java
index bd67ad325f..ea07d58f73 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java
@@ -696,28 +696,28 @@ public void test_computeSizeIIZ() {
@Test
public void test_computeSizeAlignment(){
- shell.setLayout(new GridLayout());
- StyledText singleText = new StyledText(shell, SWT.SINGLE);
- shell.layout(true);
- Point beforeAlignment = singleText.computeSize(100, SWT.DEFAULT);
- //Should not change the computed size
- singleText.setAlignment(SWT.RIGHT);
- Point afterAlignment = singleText.computeSize(100, SWT.DEFAULT);
- assertEquals(beforeAlignment, afterAlignment);
- singleText.dispose();
+ shell.setLayout(new GridLayout());
+ StyledText singleText = new StyledText(shell, SWT.SINGLE);
+ shell.layout(true);
+ Point beforeAlignment = singleText.computeSize(100, SWT.DEFAULT);
+ //Should not change the computed size
+ singleText.setAlignment(SWT.RIGHT);
+ Point afterAlignment = singleText.computeSize(100, SWT.DEFAULT);
+ assertEquals(beforeAlignment, afterAlignment);
+ singleText.dispose();
}
@Test
public void test_marginsCorrect(){
- shell.setLayout(new GridLayout());
- StyledText singleText = new StyledText(shell, SWT.SINGLE);
- int leftMargin = 10;
- singleText.setLeftMargin(leftMargin);
- shell.layout(true);
- singleText.setAlignment(SWT.RIGHT);
- assertEquals(leftMargin, singleText.getLeftMargin());
- singleText.setLeftMargin(leftMargin);
- assertEquals(leftMargin, singleText.getLeftMargin());
- singleText.dispose();
+ shell.setLayout(new GridLayout());
+ StyledText singleText = new StyledText(shell, SWT.SINGLE);
+ int leftMargin = 10;
+ singleText.setLeftMargin(leftMargin);
+ shell.layout(true);
+ singleText.setAlignment(SWT.RIGHT);
+ assertEquals(leftMargin, singleText.getLeftMargin());
+ singleText.setLeftMargin(leftMargin);
+ assertEquals(leftMargin, singleText.getLeftMargin());
+ singleText.dispose();
}
@Test
public void test_copy() {
@@ -1888,8 +1888,8 @@ public void test_getStyleRanges() {
text.setStyleRange(getStyle(14,23,RED,null));
text.setStyleRange(getStyle(38,6,BLUE,null));
text.setStyleRange(getStyle(45,5,BLUE,null));
- text.replaceTextRange(14, 23, "\t/*Line 1\n\t * Line 2\n\t */");
- String newText = text.getTextRange(0, text.getCharCount());
+ text.replaceTextRange(14, 23, "\t/*Line 1\n\t * Line 2\n\t */");
+ String newText = text.getTextRange(0, text.getCharCount());
assertTrue(":1:", newText.equals("package test;\n\t/*Line 1\n\t * Line 2\n\t */\npublic class SimpleClass {\n}"));
StyleRange[] styles = text.getStyleRanges();
assertTrue(":1:", styles.length == 3);
@@ -5345,19 +5345,19 @@ protected void rtfCopy() {
@Test
public void test_consistency_Modify() {
- consistencyEvent('a', 0, 0, 0, ConsistencyUtility.KEY_PRESS);
+ consistencyEvent('a', 0, 0, 0, ConsistencyUtility.KEY_PRESS);
}
@Override
@Test
public void test_consistency_MenuDetect () {
- consistencyEvent(10, 10, 3, ConsistencyUtility.ESCAPE_MENU, ConsistencyUtility.MOUSE_CLICK);
+ consistencyEvent(10, 10, 3, ConsistencyUtility.ESCAPE_MENU, ConsistencyUtility.MOUSE_CLICK);
}
@Override
@Test
public void test_consistency_DragDetect () {
- consistencyEvent(30, 10, 50, 0, ConsistencyUtility.MOUSE_DRAG);
+ consistencyEvent(30, 10, 50, 0, ConsistencyUtility.MOUSE_DRAG);
}
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TextChangeListener.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TextChangeListener.java
index 6ee0c82096..5b23954ffd 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TextChangeListener.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TextChangeListener.java
@@ -258,7 +258,7 @@ public void test_textChangedLorg_eclipse_swt_custom_TextChangedEvent() {
exceptionHandled = false;
verify = 0;
- styledText.setText("L1\r");
+ styledText.setText("L1\r");
verify = 18;
styledText.replaceTextRange(3, 0, "\ntest\r\n");
@@ -490,7 +490,7 @@ public void test_textChangingLorg_eclipse_swt_custom_TextChangingEvent() {
exceptionHandled = false;
verify = 18;
- styledText.setText("L1\r");
+ styledText.setText("L1\r");
styledText.replaceTextRange(3, 0, "\ntest\r\n");
verify = 19;
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_GC.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_GC.java
index 00abc07665..115b61d852 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_GC.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_GC.java
@@ -153,7 +153,7 @@ public void test_copyAreaIIIIII() {
int pixel = imageData.getPixel(destX + 4, destY);
assertEquals(":a:", whiteRGB, palette.getRGB(pixel));
pixel = imageData.getPixel(destX + 6 , destY);
- assertEquals(":b:", blueRGB, palette.getRGB(pixel));
+ assertEquals(":b:", blueRGB, palette.getRGB(pixel));
pixel = imageData.getPixel(destX + 10, destY);
assertEquals(":c:", blueRGB, palette.getRGB(pixel));
pixel = imageData.getPixel(destX + 12, destY);
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Image.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Image.java
index 04c87544df..d3555b113c 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Image.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Image.java
@@ -471,7 +471,7 @@ public void test_ConstructorLorg_eclipse_swt_graphics_DeviceLjava_lang_String()
@Test
public void test_ConstructorLorg_eclipse_swt_graphics_Device_ImageFileNameProvider() {
- // Null provider
+ // Null provider
ImageFileNameProvider provider = null;
try {
Image image = new Image(display, provider);
@@ -534,7 +534,7 @@ public void test_ConstructorLorg_eclipse_swt_graphics_Device_ImageFileNameProvid
@Test
public void test_ConstructorLorg_eclipse_swt_graphics_Device_ImageDataProvider() {
- // Null provider
+ // Null provider
ImageDataProvider provider = null;
try {
Image image = new Image(display, provider);
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_RGB.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_RGB.java
index 5fda8377bf..52f505aa1d 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_RGB.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_RGB.java
@@ -238,9 +238,9 @@ public void test_equalsLjava_lang_Object() {
}
if (rgb1.equals(new RGB(r+1, g, b)) ||
- rgb1.equals(new RGB(r, g+1, b)) ||
- rgb1.equals(new RGB(r, g, b+1)) ||
- rgb1.equals(new RGB(r+1, g+1, b+1))) {
+ rgb1.equals(new RGB(r, g+1, b)) ||
+ rgb1.equals(new RGB(r, g, b+1)) ||
+ rgb1.equals(new RGB(r+1, g+1, b+1))) {
fail("Comparing two RGB instances with different combination of R G B parameters found equal");
}
@@ -257,9 +257,9 @@ public void test_equalsLjava_lang_Object() {
}
if (rgb1.equals(new RGB(hue+1, sat, bright)) ||
- rgb1.equals(new RGB(hue, sat+0.1f, bright)) ||
- rgb1.equals(new RGB(hue, sat, bright+0.1f)) ||
- rgb1.equals(new RGB(hue+1, sat+0.1f, bright+0.1f))) {
+ rgb1.equals(new RGB(hue, sat+0.1f, bright)) ||
+ rgb1.equals(new RGB(hue, sat, bright+0.1f)) ||
+ rgb1.equals(new RGB(hue+1, sat+0.1f, bright+0.1f))) {
fail("Comparing two RGB instances with different combination of H S B parameters found equal");
}
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_RGBA.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_RGBA.java
index c66cb103d0..d2aec50ce0 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_RGBA.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_RGBA.java
@@ -265,10 +265,10 @@ public void test_equalsLjava_lang_Object() {
}
if (rgba1.equals(new RGBA(r+1, g, b, a)) ||
- rgba1.equals(new RGBA(r, g+1, b, a)) ||
- rgba1.equals(new RGBA(r, g, b+1, a)) ||
- rgba1.equals(new RGBA(r, g, b, a+1)) ||
- rgba1.equals(new RGBA(r+1, g+1, b+1, a+1))) {
+ rgba1.equals(new RGBA(r, g+1, b, a)) ||
+ rgba1.equals(new RGBA(r, g, b+1, a)) ||
+ rgba1.equals(new RGBA(r, g, b, a+1)) ||
+ rgba1.equals(new RGBA(r+1, g+1, b+1, a+1))) {
fail("Comparing two RGBA instances with different combination of R G B A parameters found equal");
}
@@ -285,10 +285,10 @@ public void test_equalsLjava_lang_Object() {
}
if (rgba1.equals(new RGBA(hue+1, sat, bright, alpha)) ||
- rgba1.equals(new RGBA(hue, sat+0.1f, bright, alpha)) ||
- rgba1.equals(new RGBA(hue, sat, bright+0.1f, alpha)) ||
- rgba1.equals(new RGBA(hue, sat, bright, alpha+1f)) ||
- rgba1.equals(new RGBA(hue+1, sat+0.1f, bright+0.1f, alpha+1f))) {
+ rgba1.equals(new RGBA(hue, sat+0.1f, bright, alpha)) ||
+ rgba1.equals(new RGBA(hue, sat, bright+0.1f, alpha)) ||
+ rgba1.equals(new RGBA(hue, sat, bright, alpha+1f)) ||
+ rgba1.equals(new RGBA(hue+1, sat+0.1f, bright+0.1f, alpha+1f))) {
fail("Comparing two RGBA instances with different combination of H S B A parameters found equal");
}
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_TextLayout.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_TextLayout.java
index a9a57e63bd..b688e43a9a 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_TextLayout.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_TextLayout.java
@@ -172,7 +172,7 @@ public void test_getSegments() {
assertEquals("hit test to the right (trailing)", 1, trailing[0]);
}
- /* wrong: internal testing */
+ /* wrong: internal testing */
// String text = "AB";
// int textLength = text.length();
// layout.setText(text);
@@ -763,26 +763,26 @@ public void test_getNextOffset2() {
//for gtk, testing machine (rhel4) is too old to
//support thai.
- TextLayout layout = new TextLayout(display);
- layout.setText("A\u0E19\u0E49\u0E33B");
- String[] messages = {"no segments", "segments", "segments (duplicate at 0)", "segments (duplicate at 1)", "segments (duplicate at 2)",
- "segments (duplicate at 3)", "segments (duplicate at 4)", "segments (duplicate at 5)"};
+ TextLayout layout = new TextLayout(display);
+ layout.setText("A\u0E19\u0E49\u0E33B");
+ String[] messages = {"no segments", "segments", "segments (duplicate at 0)", "segments (duplicate at 1)", "segments (duplicate at 2)",
+ "segments (duplicate at 3)", "segments (duplicate at 4)", "segments (duplicate at 5)"};
// int[][] segments = {null, {0, 1, 2, 3, 4, 5}, {0, 0, 1, 2, 3, 4, 5}, {0, 1, 1, 2, 3, 4, 5}, {0, 1, 2, 2, 3, 4, 5}, {0, 1, 2, 3, 3, 4, 5},
// {0, 1, 2, 3, 4, 4, 5}, {0, 1, 2, 3, 4, 5, 5}};
- int[][] segments = {null};
-
- for (int i = 0; i < segments.length; i++) {
- String m = messages[i];
- layout.setSegments(segments[i]);
- assertEquals(m, 1, layout.getNextOffset(0, SWT.MOVEMENT_CLUSTER));
- assertEquals(m, 4, layout.getNextOffset(1, SWT.MOVEMENT_CLUSTER));
- assertEquals(m, 5, layout.getNextOffset(4, SWT.MOVEMENT_CLUSTER));
- assertEquals(m, 4, layout.getPreviousOffset(5, SWT.MOVEMENT_CLUSTER));
- assertEquals(m, 1, layout.getPreviousOffset(4, SWT.MOVEMENT_CLUSTER));
- assertEquals(m, 0, layout.getPreviousOffset(1, SWT.MOVEMENT_CLUSTER));
- }
- layout.dispose();
+ int[][] segments = {null};
+
+ for (int i = 0; i < segments.length; i++) {
+ String m = messages[i];
+ layout.setSegments(segments[i]);
+ assertEquals(m, 1, layout.getNextOffset(0, SWT.MOVEMENT_CLUSTER));
+ assertEquals(m, 4, layout.getNextOffset(1, SWT.MOVEMENT_CLUSTER));
+ assertEquals(m, 5, layout.getNextOffset(4, SWT.MOVEMENT_CLUSTER));
+ assertEquals(m, 4, layout.getPreviousOffset(5, SWT.MOVEMENT_CLUSTER));
+ assertEquals(m, 1, layout.getPreviousOffset(4, SWT.MOVEMENT_CLUSTER));
+ assertEquals(m, 0, layout.getPreviousOffset(1, SWT.MOVEMENT_CLUSTER));
+ }
+ layout.dispose();
}
@Test
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Button.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Button.java
index 54f0e2bb35..2edca6279c 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Button.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Button.java
@@ -438,45 +438,45 @@ public void test_setTextLjava_lang_String() {
//custom
protected void setUp(int style) {
- super.setUp();
- button = new Button(shell, style);
- setWidget(button);
+ super.setUp();
+ button = new Button(shell, style);
+ setWidget(button);
}
@Test
public void test_consistency_MenuDetect () {
- consistencyEvent(10, 10, 3, 0, ConsistencyUtility.MOUSE_CLICK);
- tearDown();
- setUp(SWT.CHECK);
- consistencyEvent(5, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
- tearDown();
- setUp(SWT.RADIO);
- consistencyEvent(5, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
- tearDown();
- setUp(SWT.TOGGLE);
- consistencyEvent(5, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
- tearDown();
- setUp(SWT.ARROW);
- consistencyEvent(5, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
+ consistencyEvent(10, 10, 3, 0, ConsistencyUtility.MOUSE_CLICK);
+ tearDown();
+ setUp(SWT.CHECK);
+ consistencyEvent(5, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
+ tearDown();
+ setUp(SWT.RADIO);
+ consistencyEvent(5, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
+ tearDown();
+ setUp(SWT.TOGGLE);
+ consistencyEvent(5, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
+ tearDown();
+ setUp(SWT.ARROW);
+ consistencyEvent(5, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
}
@Test
public void test_consistency_MouseSelection () {
- consistencyEvent(10, 10, 1, 0, ConsistencyUtility.MOUSE_CLICK);
- tearDown();
- setUp(SWT.CHECK);
- consistencyEvent(5, 5, 1, 0, ConsistencyUtility.MOUSE_CLICK);
- tearDown();
- setUp(SWT.RADIO);
- button.setSelection(true);
- consistencyEvent(5, 5, 1, 0, ConsistencyUtility.MOUSE_CLICK);
- tearDown();
- setUp(SWT.TOGGLE);
- consistencyEvent(5, 5, 1, 0, ConsistencyUtility.MOUSE_CLICK);
- tearDown();
- setUp(SWT.ARROW);
- consistencyEvent(5, 5, 1, 0, ConsistencyUtility.MOUSE_CLICK);
+ consistencyEvent(10, 10, 1, 0, ConsistencyUtility.MOUSE_CLICK);
+ tearDown();
+ setUp(SWT.CHECK);
+ consistencyEvent(5, 5, 1, 0, ConsistencyUtility.MOUSE_CLICK);
+ tearDown();
+ setUp(SWT.RADIO);
+ button.setSelection(true);
+ consistencyEvent(5, 5, 1, 0, ConsistencyUtility.MOUSE_CLICK);
+ tearDown();
+ setUp(SWT.TOGGLE);
+ consistencyEvent(5, 5, 1, 0, ConsistencyUtility.MOUSE_CLICK);
+ tearDown();
+ setUp(SWT.ARROW);
+ consistencyEvent(5, 5, 1, 0, ConsistencyUtility.MOUSE_CLICK);
}
@Test
@@ -484,54 +484,54 @@ public void test_consistency_EnterSelection () {
// differences between push and the rest of the buttons
// different across platforms
// consistencyEvent(10, 13, 0, 0, ConsistencyUtility.KEY_PRESS);
- tearDown();
- setUp(SWT.CHECK);
- consistencyEvent(10, 13, 0, 0, ConsistencyUtility.KEY_PRESS);
- tearDown();
- setUp(SWT.RADIO);
- consistencyEvent(10, 13, 0, 0, ConsistencyUtility.KEY_PRESS);
- tearDown();
- setUp(SWT.TOGGLE);
- consistencyEvent(10, 13, 0, 0, ConsistencyUtility.KEY_PRESS);
- tearDown();
- setUp(SWT.ARROW);
- consistencyEvent(10, 13, 0, 0, ConsistencyUtility.KEY_PRESS);
+ tearDown();
+ setUp(SWT.CHECK);
+ consistencyEvent(10, 13, 0, 0, ConsistencyUtility.KEY_PRESS);
+ tearDown();
+ setUp(SWT.RADIO);
+ consistencyEvent(10, 13, 0, 0, ConsistencyUtility.KEY_PRESS);
+ tearDown();
+ setUp(SWT.TOGGLE);
+ consistencyEvent(10, 13, 0, 0, ConsistencyUtility.KEY_PRESS);
+ tearDown();
+ setUp(SWT.ARROW);
+ consistencyEvent(10, 13, 0, 0, ConsistencyUtility.KEY_PRESS);
}
@Test
public void test_consistency_SpaceSelection () {
- consistencyEvent(' ', 32, 0, 0, ConsistencyUtility.KEY_PRESS);
- tearDown();
- setUp(SWT.CHECK);
- consistencyEvent(' ', 32, 0, 0, ConsistencyUtility.KEY_PRESS);
- tearDown();
- setUp(SWT.RADIO);
- button.setSelection(true);
- consistencyEvent(' ', 32, 0, 0, ConsistencyUtility.KEY_PRESS);
- tearDown();
- setUp(SWT.TOGGLE);
- consistencyEvent(' ', 32, 0, 0, ConsistencyUtility.KEY_PRESS);
- tearDown();
- //arrow does not produce a traverse mnemonic on xp
- setUp(SWT.ARROW);
- consistencyEvent(' ', 32, 0, 0, ConsistencyUtility.KEY_PRESS);
+ consistencyEvent(' ', 32, 0, 0, ConsistencyUtility.KEY_PRESS);
+ tearDown();
+ setUp(SWT.CHECK);
+ consistencyEvent(' ', 32, 0, 0, ConsistencyUtility.KEY_PRESS);
+ tearDown();
+ setUp(SWT.RADIO);
+ button.setSelection(true);
+ consistencyEvent(' ', 32, 0, 0, ConsistencyUtility.KEY_PRESS);
+ tearDown();
+ setUp(SWT.TOGGLE);
+ consistencyEvent(' ', 32, 0, 0, ConsistencyUtility.KEY_PRESS);
+ tearDown();
+ //arrow does not produce a traverse mnemonic on xp
+ setUp(SWT.ARROW);
+ consistencyEvent(' ', 32, 0, 0, ConsistencyUtility.KEY_PRESS);
}
@Test
public void test_consistency_DragDetect () {
- consistencyEvent(10, 10, 20, 20, ConsistencyUtility.MOUSE_DRAG);
- tearDown();
- setUp(SWT.CHECK);
- consistencyEvent(5, 5, 15, 15, ConsistencyUtility.MOUSE_DRAG);
- tearDown();
- setUp(SWT.RADIO);
- consistencyEvent(5, 5, 15, 15, ConsistencyUtility.MOUSE_DRAG);
- tearDown();
- setUp(SWT.TOGGLE);
- consistencyEvent(5, 5, 15, 15, ConsistencyUtility.MOUSE_DRAG);
- tearDown();
- setUp(SWT.ARROW);
- consistencyEvent(5, 5, 15, 15, ConsistencyUtility.MOUSE_DRAG);
+ consistencyEvent(10, 10, 20, 20, ConsistencyUtility.MOUSE_DRAG);
+ tearDown();
+ setUp(SWT.CHECK);
+ consistencyEvent(5, 5, 15, 15, ConsistencyUtility.MOUSE_DRAG);
+ tearDown();
+ setUp(SWT.RADIO);
+ consistencyEvent(5, 5, 15, 15, ConsistencyUtility.MOUSE_DRAG);
+ tearDown();
+ setUp(SWT.TOGGLE);
+ consistencyEvent(5, 5, 15, 15, ConsistencyUtility.MOUSE_DRAG);
+ tearDown();
+ setUp(SWT.ARROW);
+ consistencyEvent(5, 5, 15, 15, ConsistencyUtility.MOUSE_DRAG);
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Canvas.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Canvas.java
index 3b1fcc19b6..8afe752dd6 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Canvas.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Canvas.java
@@ -112,12 +112,12 @@ public void test_setFontLorg_eclipse_swt_graphics_Font() {
/* custom*/
@Test
public void test_consistency_MenuDetect() {
- consistencyEvent(10, 10, 3, 0, ConsistencyUtility.MOUSE_CLICK);
+ consistencyEvent(10, 10, 3, 0, ConsistencyUtility.MOUSE_CLICK);
}
@Test
public void test_consistency_DragDetect() {
- consistencyEvent(10, 10, 20, 20, ConsistencyUtility.MOUSE_DRAG);
+ consistencyEvent(10, 10, 20, 20, ConsistencyUtility.MOUSE_DRAG);
}
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Combo.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Combo.java
index e6fe80e3a1..35e386629a 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Combo.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Combo.java
@@ -1122,45 +1122,45 @@ public void test_setSizeLorg_eclipse_swt_graphics_Point() {
}
private void add() {
- combo.add("this");
- combo.add("is");
- combo.add("SWT");
+ combo.add("this");
+ combo.add("is");
+ combo.add("SWT");
}
@Test
public void test_consistency_MouseSelection () {
- add();
- consistencyPrePackShell();
- consistencyEvent(combo.getSize().x-10, 5, 30, combo.getItemHeight()*2,
- ConsistencyUtility.SELECTION);
+ add();
+ consistencyPrePackShell();
+ consistencyEvent(combo.getSize().x-10, 5, 30, combo.getItemHeight()*2,
+ ConsistencyUtility.SELECTION);
}
@Test
public void test_consistency_KeySelection () {
- add();
- consistencyEvent(0, SWT.ARROW_DOWN, 0, 0, ConsistencyUtility.KEY_PRESS);
+ add();
+ consistencyEvent(0, SWT.ARROW_DOWN, 0, 0, ConsistencyUtility.KEY_PRESS);
}
@Test
public void test_consistency_EnterSelection () {
- add();
- consistencyEvent(10, 13, 0, 0, ConsistencyUtility.KEY_PRESS);
+ add();
+ consistencyEvent(10, 13, 0, 0, ConsistencyUtility.KEY_PRESS);
}
@Test
public void test_consistency_MenuDetect () {
- add();
- consistencyPrePackShell();
- //on arrow
- consistencyEvent(combo.getSize().x-10, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
- //on text
- consistencyEvent(10, 5, 3, ConsistencyUtility.ESCAPE_MENU, ConsistencyUtility.MOUSE_CLICK);
+ add();
+ consistencyPrePackShell();
+ //on arrow
+ consistencyEvent(combo.getSize().x-10, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
+ //on text
+ consistencyEvent(10, 5, 3, ConsistencyUtility.ESCAPE_MENU, ConsistencyUtility.MOUSE_CLICK);
}
@Test
public void test_consistency_DragDetect () {
- add();
- consistencyEvent(10, 5, 20, 10, ConsistencyUtility.MOUSE_DRAG);
+ add();
+ consistencyEvent(10, 5, 20, 10, ConsistencyUtility.MOUSE_DRAG);
}
@Test
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Control.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Control.java
index f8482361d4..a892ea2b53 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Control.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Control.java
@@ -1016,132 +1016,132 @@ protected void setWidget(Widget w) {
* invokes ConsistencyUtility.postShellIconify(Display, Point, int)
*/
protected void consistencyEvent(final int paramA, final int paramB,
- final int paramC, final int paramD,
- final int method, List<String> events, boolean focus) {
- if(SwtTestUtil.fTestConsistency) {
- final Display display = shell.getDisplay();
- if(events == null)
- events = new ArrayList<>();
- final String test = getTestName();
-
- shell.setLayout(new org.eclipse.swt.layout.FillLayout());
- shell.setText("Parent");
-
- shell.pack();
- shell.open();
- if(control instanceof Shell) {
- ((Shell)control).pack();
- ((Shell)control).open();
- }
- final Point[] pt = determineLocations(paramA, paramB, paramC, paramD, method);
- if(focus && !control.setFocus())
- control.forceFocus();
- String[] expectedEvents = hookExpectedEvents(test, events);
- new Thread() {
- @Override
+ final int paramC, final int paramD,
+ final int method, List<String> events, boolean focus) {
+ if(SwtTestUtil.fTestConsistency) {
+ final Display display = shell.getDisplay();
+ if(events == null)
+ events = new ArrayList<>();
+ final String test = getTestName();
+
+ shell.setLayout(new org.eclipse.swt.layout.FillLayout());
+ shell.setText("Parent");
+
+ shell.pack();
+ shell.open();
+ if(control instanceof Shell) {
+ ((Shell)control).pack();
+ ((Shell)control).open();
+ }
+ final Point[] pt = determineLocations(paramA, paramB, paramC, paramD, method);
+ if(focus && !control.setFocus())
+ control.forceFocus();
+ String[] expectedEvents = hookExpectedEvents(test, events);
+ new Thread() {
+ @Override
public void run() {
- display.wake();
- switch(method) {
- case ConsistencyUtility.MOUSE_CLICK:
- Assert.assertTrue(test,
- ConsistencyUtility.postClick(display, pt[0], paramC));
- if(paramD == ConsistencyUtility.ESCAPE_MENU) {
- Assert.assertTrue(test,
- ConsistencyUtility.postClick(display, pt[1], 1));
- }
- break;
- case ConsistencyUtility.MOUSE_DOUBLECLICK:
- Assert.assertTrue(test,
- ConsistencyUtility.postDoubleClick(display, pt[0], paramC));
- break;
- case ConsistencyUtility.KEY_PRESS:
- Assert.assertTrue(test,
- ConsistencyUtility.postKeyPress(display, paramA, paramB));
- break;
- case ConsistencyUtility.DOUBLE_KEY_PRESS:
- Assert.assertTrue(test,
- ConsistencyUtility.postDoubleKeyPress(display, paramA, paramB, paramC, paramD));
- break;
- case ConsistencyUtility.MOUSE_DRAG:
- Assert.assertTrue(test,
- ConsistencyUtility.postDrag(display,
- pt[0], pt[1]));
- break;
- case ConsistencyUtility.SELECTION:
-
- Assert.assertTrue(test,
- ConsistencyUtility.postSelection(display,
- pt[0], pt[1]));
- break;
- case ConsistencyUtility.SHELL_ICONIFY:
- Assert.assertTrue(test,
- ConsistencyUtility.postShellIconify(display, pt[1], paramA));
- if(control instanceof Shell) {
- display.syncExec(new Thread() {
- @Override
+ display.wake();
+ switch(method) {
+ case ConsistencyUtility.MOUSE_CLICK:
+ Assert.assertTrue(test,
+ ConsistencyUtility.postClick(display, pt[0], paramC));
+ if(paramD == ConsistencyUtility.ESCAPE_MENU) {
+ Assert.assertTrue(test,
+ ConsistencyUtility.postClick(display, pt[1], 1));
+ }
+ break;
+ case ConsistencyUtility.MOUSE_DOUBLECLICK:
+ Assert.assertTrue(test,
+ ConsistencyUtility.postDoubleClick(display, pt[0], paramC));
+ break;
+ case ConsistencyUtility.KEY_PRESS:
+ Assert.assertTrue(test,
+ ConsistencyUtility.postKeyPress(display, paramA, paramB));
+ break;
+ case ConsistencyUtility.DOUBLE_KEY_PRESS:
+ Assert.assertTrue(test,
+ ConsistencyUtility.postDoubleKeyPress(display, paramA, paramB, paramC, paramD));
+ break;
+ case ConsistencyUtility.MOUSE_DRAG:
+ Assert.assertTrue(test,
+ ConsistencyUtility.postDrag(display,
+ pt[0], pt[1]));
+ break;
+ case ConsistencyUtility.SELECTION:
+
+ Assert.assertTrue(test,
+ ConsistencyUtility.postSelection(display,
+ pt[0], pt[1]));
+ break;
+ case ConsistencyUtility.SHELL_ICONIFY:
+ Assert.assertTrue(test,
+ ConsistencyUtility.postShellIconify(display, pt[1], paramA));
+ if(control instanceof Shell) {
+ display.syncExec(new Thread() {
+ @Override
public void run() {
- ((Shell)control).setMinimized(false);
- }});
- } else
- fail("Iconifying a non shell control");
- break;
- }
+ ((Shell)control).setMinimized(false);
+ }});
+ } else
+ fail("Iconifying a non shell control");
+ break;
+ }
display.asyncExec(new Thread() {
- @Override
+ @Override
public void run() {
- shell.dispose();
- }
+ shell.dispose();
+ }
});
- }
- }.start();
+ }
+ }.start();
- while(!shell.isDisposed()) {
- if(!display.readAndDispatch()) display.sleep();
- }
- setUp();
- String[] results = new String[events.size()];
- results = events.toArray(results);
- assertArrayEquals(test + " event ordering", expectedEvents, results);
- }
+ while(!shell.isDisposed()) {
+ if(!display.readAndDispatch()) display.sleep();
+ }
+ setUp();
+ String[] results = new String[events.size()];
+ results = events.toArray(results);
+ assertArrayEquals(test + " event ordering", expectedEvents, results);
+ }
}
protected void consistencyEvent(int paramA, int paramB,
int paramC, int paramD,
int method, List<String> events) {
- consistencyEvent(paramA, paramB, paramC, paramD, method, events, true);
+ consistencyEvent(paramA, paramB, paramC, paramD, method, events, true);
}
protected void consistencyEvent(int paramA, int paramB,
int paramC, int paramD,
int method) {
- consistencyEvent(paramA, paramB, paramC, paramD, method, null, true);
+ consistencyEvent(paramA, paramB, paramC, paramD, method, null, true);
}
protected void consistencyPrePackShell() {
- shell.setLayout(new org.eclipse.swt.layout.FillLayout());
- shell.pack();
+ shell.setLayout(new org.eclipse.swt.layout.FillLayout());
+ shell.pack();
}
protected void consistencyPrePackShell(Shell shell) {
- consistencyPrePackShell();
- shell.pack();
+ consistencyPrePackShell();
+ shell.pack();
}
protected Point[] determineLocations(int paramA, int paramB,
- int paramC, int paramD, int method) {
- Point[] array = new Point[2];
- if(method >= ConsistencyUtility.MOUSE_CLICK)
- array[0] = control.toDisplay(paramA, paramB);
- if(method >= ConsistencyUtility.MOUSE_DRAG)
- array[1] = control.toDisplay(paramC, paramD);
- if(method == ConsistencyUtility.MOUSE_CLICK && paramD == ConsistencyUtility.ESCAPE_MENU)
- array[1] = shell.toDisplay(25, -10);
- else if(method == ConsistencyUtility.SHELL_ICONIFY) {
- array[0] = control.toDisplay(0,0);
- array[1] = control.toDisplay(control.getSize().x -20, 0);
- }
- return array;
+ int paramC, int paramD, int method) {
+ Point[] array = new Point[2];
+ if(method >= ConsistencyUtility.MOUSE_CLICK)
+ array[0] = control.toDisplay(paramA, paramB);
+ if(method >= ConsistencyUtility.MOUSE_DRAG)
+ array[1] = control.toDisplay(paramC, paramD);
+ if(method == ConsistencyUtility.MOUSE_CLICK && paramD == ConsistencyUtility.ESCAPE_MENU)
+ array[1] = shell.toDisplay(25, -10);
+ else if(method == ConsistencyUtility.SHELL_ICONIFY) {
+ array[0] = control.toDisplay(0,0);
+ array[1] = control.toDisplay(control.getSize().x -20, 0);
+ }
+ return array;
}
@Test
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_CoolBar.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_CoolBar.java
index 4189e18bef..2a31a701d0 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_CoolBar.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_CoolBar.java
@@ -61,10 +61,10 @@ public void test_computeSizeIIZ() {
CoolBar coolBar;
private void createCoolBar(List<String> events) {
- tearDown();
- super.setUp();
- String test = getTestName();
- coolBar = new CoolBar(shell, SWT.FLAT);
+ tearDown();
+ super.setUp();
+ String test = getTestName();
+ coolBar = new CoolBar(shell, SWT.FLAT);
ToolBar[] coolItemToolBar = new ToolBar[2];
for (int i = 0; i < 2; i++) {
CoolItem coolItem = new CoolItem(coolBar, SWT.DROP_DOWN);
@@ -77,68 +77,68 @@ private void createCoolBar(List<String> events) {
item.setText("CB" + ((i*2) + j));
item.setToolTipText("ToolItem ToolTip" + i + j);
if (item.getWidth() > toolItemWidth)
- toolItemWidth = item.getWidth();
+ toolItemWidth = item.getWidth();
hookExpectedEvents(item, test, events);
}
- coolItem.setControl(coolItemToolBar[i]);
- Point size;
- if(i == 1)
- size = coolItemToolBar[i].computeSize(20, SWT.DEFAULT);
- else
- size = coolItemToolBar[i].computeSize(SWT.DEFAULT, SWT.DEFAULT);
- Point coolSize = coolItem.computeSize (size.x, size.y);
- coolItem.setMinimumSize(toolItemWidth/3, coolSize.y);
- coolItem.setPreferredSize(coolSize);
- coolItem.setSize(coolSize.x/3, coolSize.y);
- coolItem.addSelectionListener(new CoolItemSelectionListener());
+ coolItem.setControl(coolItemToolBar[i]);
+ Point size;
+ if(i == 1)
+ size = coolItemToolBar[i].computeSize(20, SWT.DEFAULT);
+ else
+ size = coolItemToolBar[i].computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ Point coolSize = coolItem.computeSize (size.x, size.y);
+ coolItem.setMinimumSize(toolItemWidth/3, coolSize.y);
+ coolItem.setPreferredSize(coolSize);
+ coolItem.setSize(coolSize.x/3, coolSize.y);
+ coolItem.addSelectionListener(new CoolItemSelectionListener());
}
setWidget(coolBar);
}
@Test
public void test_consistency_ChevronMenuDetect () {
- List<String> events = new ArrayList<>();
- createCoolBar(events);
- consistencyPrePackShell();
- Point[] points = coolBar.getItemSizes();
- //chevron
- consistencyEvent(points[0].x-12, 0, 3, ConsistencyUtility.ESCAPE_MENU, ConsistencyUtility.MOUSE_CLICK, events);
+ List<String> events = new ArrayList<>();
+ createCoolBar(events);
+ consistencyPrePackShell();
+ Point[] points = coolBar.getItemSizes();
+ //chevron
+ consistencyEvent(points[0].x-12, 0, 3, ConsistencyUtility.ESCAPE_MENU, ConsistencyUtility.MOUSE_CLICK, events);
}
@Test
public void test_consistency_MenuDetect () {
- List<String> events = new ArrayList<>();
- createCoolBar(events);
- consistencyPrePackShell();
- Point[] points = coolBar.getItemSizes();
- consistencyEvent(points[0].x, 2, 3, 0, ConsistencyUtility.MOUSE_CLICK, events);
+ List<String> events = new ArrayList<>();
+ createCoolBar(events);
+ consistencyPrePackShell();
+ Point[] points = coolBar.getItemSizes();
+ consistencyEvent(points[0].x, 2, 3, 0, ConsistencyUtility.MOUSE_CLICK, events);
}
@Test
public void test_consistency_ChevronDragDetect () {
- List<String> events = new ArrayList<>();
- createCoolBar(events);
- consistencyPrePackShell();
- Point[] points = coolBar.getItemSizes();
- consistencyEvent(points[0].x-12, 0, points[0].x-12, 5, ConsistencyUtility.MOUSE_DRAG, events);
+ List<String> events = new ArrayList<>();
+ createCoolBar(events);
+ consistencyPrePackShell();
+ Point[] points = coolBar.getItemSizes();
+ consistencyEvent(points[0].x-12, 0, points[0].x-12, 5, ConsistencyUtility.MOUSE_DRAG, events);
}
@Test
public void test_consistency_DragDetect () {
- List<String> events = new ArrayList<>();
- createCoolBar(events);
- consistencyPrePackShell();
- Point[] points = coolBar.getItemSizes();
- consistencyEvent(points[0].x, 0, points[0].x, 5, ConsistencyUtility.MOUSE_DRAG, events);
+ List<String> events = new ArrayList<>();
+ createCoolBar(events);
+ consistencyPrePackShell();
+ Point[] points = coolBar.getItemSizes();
+ consistencyEvent(points[0].x, 0, points[0].x, 5, ConsistencyUtility.MOUSE_DRAG, events);
}
@Test
public void test_consistency_ChevronMouseSelection() {
- List<String> events = new ArrayList<>();
- createCoolBar(events);
- consistencyPrePackShell();
- Point[] points = coolBar.getItemSizes();
- consistencyEvent(points[0].x-12, 0, points[0].x-8, 30, ConsistencyUtility.SELECTION, events);
+ List<String> events = new ArrayList<>();
+ createCoolBar(events);
+ consistencyPrePackShell();
+ Point[] points = coolBar.getItemSizes();
+ consistencyEvent(points[0].x-12, 0, points[0].x-8, 30, ConsistencyUtility.SELECTION, events);
}
class CoolItemSelectionListener extends SelectionAdapter {
@@ -184,9 +184,9 @@ class CoolItemSelectionListener extends SelectionAdapter {
pt = toolBar.toDisplay(new Point(toolBounds.x, toolBounds.y));
toolBounds.x = pt.x;
toolBounds.y = pt.y;
- Rectangle intersection = itemBounds.intersection (toolBounds);
- if (!intersection.equals (toolBounds)) break;
- i++;
+ Rectangle intersection = itemBounds.intersection (toolBounds);
+ if (!intersection.equals (toolBounds)) break;
+ i++;
}
/* Create a pop-up menu with items for each of the hidden buttons. */
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_DateTime.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_DateTime.java
index 4abb2586c6..a01e94f29f 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_DateTime.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_DateTime.java
@@ -46,10 +46,10 @@ public class Test_org_eclipse_swt_widgets_DateTime extends Test_org_eclipse_swt_
int style = SWT.DATE;
@Parameters
- public static Collection<Object[]> data() {
- Object[][] data = new Object[][] { { SWT.DATE }, { SWT.TIME}, { SWT.CALENDAR }};
- return Arrays.asList(data);
- }
+ public static Collection<Object[]> data() {
+ Object[][] data = new Object[][] { { SWT.DATE }, { SWT.TIME}, { SWT.CALENDAR }};
+ return Arrays.asList(data);
+ }
public Test_org_eclipse_swt_widgets_DateTime(int style) {
this.style = style;
@@ -716,63 +716,63 @@ public void test_removeSelectionListenerLorg_eclipse_swt_events_SelectionListene
}
protected void setUp(int style) {
- super.setUp();
- datetime = new DateTime(shell, style);
- setWidget(datetime);
+ super.setUp();
+ datetime = new DateTime(shell, style);
+ setWidget(datetime);
}
@Test
public void test_consistency_MenuDetect () {
- consistencyEvent(10, 10, 3, 0, ConsistencyUtility.MOUSE_CLICK);
- tearDown();
- setUp(SWT.DATE);
- consistencyEvent(5, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
- tearDown();
- setUp(SWT.TIME);
- consistencyEvent(5, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
- tearDown();
- setUp(SWT.CALENDAR);
- consistencyEvent(5, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
+ consistencyEvent(10, 10, 3, 0, ConsistencyUtility.MOUSE_CLICK);
+ tearDown();
+ setUp(SWT.DATE);
+ consistencyEvent(5, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
+ tearDown();
+ setUp(SWT.TIME);
+ consistencyEvent(5, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
+ tearDown();
+ setUp(SWT.CALENDAR);
+ consistencyEvent(5, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
}
@Test
public void test_consistency_MouseSelection () {
- consistencyEvent(10, 10, 1, 0, ConsistencyUtility.MOUSE_CLICK);
- tearDown();
- setUp(SWT.DATE);
- consistencyEvent(5, 5, 1, 0, ConsistencyUtility.MOUSE_CLICK);
- tearDown();
- setUp(SWT.TIME);
- consistencyEvent(5, 5, 1, 0, ConsistencyUtility.MOUSE_CLICK);
- tearDown();
- setUp(SWT.CALENDAR);
- consistencyEvent(5, 5, 1, 0, ConsistencyUtility.MOUSE_CLICK);
+ consistencyEvent(10, 10, 1, 0, ConsistencyUtility.MOUSE_CLICK);
+ tearDown();
+ setUp(SWT.DATE);
+ consistencyEvent(5, 5, 1, 0, ConsistencyUtility.MOUSE_CLICK);
+ tearDown();
+ setUp(SWT.TIME);
+ consistencyEvent(5, 5, 1, 0, ConsistencyUtility.MOUSE_CLICK);
+ tearDown();
+ setUp(SWT.CALENDAR);
+ consistencyEvent(5, 5, 1, 0, ConsistencyUtility.MOUSE_CLICK);
}
@Test
public void test_consistency_EnterSelection () {
- tearDown();
- setUp(SWT.DATE);
- consistencyEvent(10, 13, 0, 0, ConsistencyUtility.KEY_PRESS);
- tearDown();
- setUp(SWT.TIME);
- consistencyEvent(10, 13, 0, 0, ConsistencyUtility.KEY_PRESS);
- tearDown();
- setUp(SWT.CALENDAR);
- consistencyEvent(10, 13, 0, 0, ConsistencyUtility.KEY_PRESS);
+ tearDown();
+ setUp(SWT.DATE);
+ consistencyEvent(10, 13, 0, 0, ConsistencyUtility.KEY_PRESS);
+ tearDown();
+ setUp(SWT.TIME);
+ consistencyEvent(10, 13, 0, 0, ConsistencyUtility.KEY_PRESS);
+ tearDown();
+ setUp(SWT.CALENDAR);
+ consistencyEvent(10, 13, 0, 0, ConsistencyUtility.KEY_PRESS);
}
@Test
public void test_consistency_DragDetect () {
- consistencyEvent(10, 10, 20, 20, ConsistencyUtility.MOUSE_DRAG);
- tearDown();
- setUp(SWT.DATE);
- consistencyEvent(5, 5, 15, 15, ConsistencyUtility.MOUSE_DRAG);
- tearDown();
- setUp(SWT.TIME);
- consistencyEvent(5, 5, 15, 15, ConsistencyUtility.MOUSE_DRAG);
- tearDown();
- setUp(SWT.CALENDAR);
- consistencyEvent(5, 5, 15, 15, ConsistencyUtility.MOUSE_DRAG);
+ consistencyEvent(10, 10, 20, 20, ConsistencyUtility.MOUSE_DRAG);
+ tearDown();
+ setUp(SWT.DATE);
+ consistencyEvent(5, 5, 15, 15, ConsistencyUtility.MOUSE_DRAG);
+ tearDown();
+ setUp(SWT.TIME);
+ consistencyEvent(5, 5, 15, 15, ConsistencyUtility.MOUSE_DRAG);
+ tearDown();
+ setUp(SWT.CALENDAR);
+ consistencyEvent(5, 5, 15, 15, ConsistencyUtility.MOUSE_DRAG);
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Decorations.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Decorations.java
index 21e2eb6821..47625944af 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Decorations.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Decorations.java
@@ -72,9 +72,9 @@ public void test_getImage() {
Image[] cases = {null, new Image(null, 100, 100)};
for(int i=0; i<cases.length; i++){
decorations.setImage(cases[i]);
- assertEquals(decorations.getImage(), cases[i]);
- if (cases[i]!=null)
- cases[i].dispose();
+ assertEquals(decorations.getImage(), cases[i]);
+ if (cases[i]!=null)
+ cases[i].dispose();
}
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ExpandBar.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ExpandBar.java
index 830290518b..e882a7c8d4 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ExpandBar.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ExpandBar.java
@@ -150,7 +150,7 @@ public void test_getItemCount() {
int number = 10;
for (int i = 0; i < number; i++) {
assertTrue(":a:" + i, expandBar.getItemCount() == i);
- new ExpandItem(expandBar, 0);
+ new ExpandItem(expandBar, 0);
}
}
@@ -159,7 +159,7 @@ public void test_getItemI() {
int number = 5;
ExpandItem[] items = new ExpandItem[number];
for (int i = 0; i<number ; i++){
- items[i] = new ExpandItem(expandBar, 0);
+ items[i] = new ExpandItem(expandBar, 0);
}
for (int i = 0; i<number ; i++){
assertTrue(":a:", expandBar.getItem(i)==items[i]);
@@ -169,7 +169,7 @@ public void test_getItemI() {
number = 5;
items = new ExpandItem[number];
for (int i = 0; i<number ; i++){
- items[i] = new ExpandItem(expandBar, 0);
+ items[i] = new ExpandItem(expandBar, 0);
}
try {
expandBar.getItem(number);
@@ -184,7 +184,7 @@ public void test_getItems() {
int number = 5;
ExpandItem[] items = new ExpandItem[number];
for (int i = 0; i<number ; i++) {
- items[i] = new ExpandItem(expandBar, 0);
+ items[i] = new ExpandItem(expandBar, 0);
}
assertArrayEquals(items, expandBar.getItems());
@@ -203,7 +203,7 @@ public void test_indexOfLorg_eclipse_swt_widgets_ExpandItem() {
int number = 10;
ExpandItem[] items = new ExpandItem[number];
for (int i = 0; i < number; i++) {
- items[i] = new ExpandItem(expandBar, 0);
+ items[i] = new ExpandItem(expandBar, 0);
}
for (int i = 0; i < number; i++) {
assertTrue(":a:" + i, expandBar.indexOf(items[i] ) == i);
@@ -211,7 +211,7 @@ public void test_indexOfLorg_eclipse_swt_widgets_ExpandItem() {
items = new ExpandItem[number];
for (int i = 0; i < number; i++) {
- items[i] = new ExpandItem(expandBar, 0);
+ items[i] = new ExpandItem(expandBar, 0);
}
for (int i = 0; i < number; i++) {
try {
@@ -247,37 +247,37 @@ private void createExpandBar(List<String> events) {
@Test
public void test_consistency_MouseSelection() {
- List<String> events = new ArrayList<>();
- createExpandBar(events);
- consistencyEvent(30, 10, 1, 0, ConsistencyUtility.MOUSE_CLICK, events);
+ List<String> events = new ArrayList<>();
+ createExpandBar(events);
+ consistencyEvent(30, 10, 1, 0, ConsistencyUtility.MOUSE_CLICK, events);
}
@Test
public void test_consistency_EnterSelection() {
- List<String> events = new ArrayList<>();
- createExpandBar(events);
- consistencyEvent(13, 10, 0, 0, ConsistencyUtility.KEY_PRESS, events);
+ List<String> events = new ArrayList<>();
+ createExpandBar(events);
+ consistencyEvent(13, 10, 0, 0, ConsistencyUtility.KEY_PRESS, events);
}
@Test
public void test_consistency_SpaceSelection () {
- List<String> events = new ArrayList<>();
- createExpandBar(events);
- consistencyEvent(' ', 32, 0, 0, ConsistencyUtility.KEY_PRESS, events);
+ List<String> events = new ArrayList<>();
+ createExpandBar(events);
+ consistencyEvent(' ', 32, 0, 0, ConsistencyUtility.KEY_PRESS, events);
}
@Test
public void test_consistency_MenuDetect () {
- List<String> events = new ArrayList<>();
- createExpandBar(events);
- consistencyEvent(50, 15, 3, 0, ConsistencyUtility.MOUSE_CLICK, events);
+ List<String> events = new ArrayList<>();
+ createExpandBar(events);
+ consistencyEvent(50, 15, 3, 0, ConsistencyUtility.MOUSE_CLICK, events);
}
@Test
public void test_consistency_DragDetect () {
- List<String> events = new ArrayList<>();
- createExpandBar(events);
- consistencyEvent(30, 20, 50, 20, ConsistencyUtility.MOUSE_DRAG, events);
+ List<String> events = new ArrayList<>();
+ createExpandBar(events);
+ consistencyEvent(30, 20, 50, 20, ConsistencyUtility.MOUSE_DRAG, events);
}
/* custom */
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Group.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Group.java
index 90231ab74f..d8e3c7e5ba 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Group.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Group.java
@@ -76,12 +76,12 @@ Group group;
@Test
public void test_consistency_MenuDetect () {
- consistencyEvent(10, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
+ consistencyEvent(10, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
}
@Test
public void test_consistency_DragDetect () {
- consistencyEvent(10, 5, 20, 10, ConsistencyUtility.MOUSE_DRAG);
+ consistencyEvent(10, 5, 20, 10, ConsistencyUtility.MOUSE_DRAG);
}
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Label.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Label.java
index f2d4671a2c..4480b9a858 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Label.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Label.java
@@ -65,8 +65,8 @@ public void test_getAlignment(){
int[] cases = {SWT.LEFT, SWT.RIGHT, SWT.CENTER};
for (int i=0; i<cases.length; i++)
{
- label = new Label(shell, cases[i]);
- assertEquals(label.getAlignment(), cases[i]);
+ label = new Label(shell, cases[i]);
+ assertEquals(label.getAlignment(), cases[i]);
}
}
@@ -74,10 +74,10 @@ public void test_getAlignment(){
public void test_getImage(){
Image[] cases = {null, new Image(null, 100, 100)};
for(int i=0; i<cases.length; i++){
- label.setImage(cases[i]);
- assertEquals(label.getImage(), cases[i]);
- if (cases[i]!=null)
- cases[i].dispose();
+ label.setImage(cases[i]);
+ assertEquals(label.getImage(), cases[i]);
+ if (cases[i]!=null)
+ cases[i].dispose();
}
}
@@ -85,8 +85,8 @@ public void test_getImage(){
public void test_getText(){
String[] cases = {"", "some name", "sdasdlkjshcdascecoewcwe"};
for(int i=0; i<cases.length; i++){
- label.setText(cases[i]);
- assertEquals(label.getText(), cases[i]);
+ label.setText(cases[i]);
+ assertEquals(label.getText(), cases[i]);
}
}
@@ -95,8 +95,8 @@ public void test_setAlignmentI(){
int[] cases = {SWT.LEFT, SWT.RIGHT, SWT.CENTER};
for (int i=0; i<cases.length; i++)
{
- label.setAlignment(cases[i]);
- assertEquals(label.getAlignment(), cases[i]);
+ label.setAlignment(cases[i]);
+ assertEquals(label.getAlignment(), cases[i]);
}
}
@@ -121,11 +121,11 @@ Label label;
@Test
public void test_consistency_MenuDetect () {
- consistencyEvent(10, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
+ consistencyEvent(10, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
}
@Test
public void test_consistency_DragDetect () {
- consistencyEvent(10, 5, 20, 10, ConsistencyUtility.MOUSE_DRAG);
+ consistencyEvent(10, 5, 20, 10, ConsistencyUtility.MOUSE_DRAG);
}
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_List.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_List.java
index f48983bd17..95626c20c6 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_List.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_List.java
@@ -831,7 +831,7 @@ public void test_indexOfLjava_lang_StringI() {
assertEquals(list.indexOf("text2", 2), 2);
try {
- list.indexOf(null, 0);
+ list.indexOf(null, 0);
fail("No exception thrown for string == null");
} catch (IllegalArgumentException e) {
}
@@ -2442,43 +2442,43 @@ protected void select$I_helper(
}
private void add() {
- list.add("this");
- list.add("is");
- list.add("SWT");
+ list.add("this");
+ list.add("is");
+ list.add("SWT");
}
@Test
public void test_consistency_MouseSelection () {
- add();
- consistencyEvent(27, 10, 1, 0, ConsistencyUtility.MOUSE_CLICK);
+ add();
+ consistencyEvent(27, 10, 1, 0, ConsistencyUtility.MOUSE_CLICK);
}
@Test
public void test_consistency_KeySelection () {
- add();
- consistencyEvent(0, SWT.ARROW_DOWN, 0, 0, ConsistencyUtility.KEY_PRESS);
+ add();
+ consistencyEvent(0, SWT.ARROW_DOWN, 0, 0, ConsistencyUtility.KEY_PRESS);
}
@Test
public void test_consistency_SpaceSelection () {
- add();
- consistencyEvent(' ', 32, 0, 0, ConsistencyUtility.KEY_PRESS);
+ add();
+ consistencyEvent(' ', 32, 0, 0, ConsistencyUtility.KEY_PRESS);
}
@Test
public void test_consistency_DoubleClick () {
- add();
- consistencyEvent(27, 10, 1, 0, ConsistencyUtility.MOUSE_DOUBLECLICK);
+ add();
+ consistencyEvent(27, 10, 1, 0, ConsistencyUtility.MOUSE_DOUBLECLICK);
}
@Test
public void test_consistency_MenuDetect () {
- add();
- consistencyEvent(27, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
+ add();
+ consistencyEvent(27, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
}
@Test
public void test_consistency_DragDetect () {
- add();
- consistencyEvent(20, 5, 30, 10, ConsistencyUtility.MOUSE_DRAG);
+ add();
+ consistencyEvent(20, 5, 30, 10, ConsistencyUtility.MOUSE_DRAG);
}
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Menu.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Menu.java
index 34e2285f14..c1a907bc96 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Menu.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Menu.java
@@ -210,7 +210,7 @@ public void test_getItemCount() {
int number = 10;
for (int i = 0; i<number ; i++){
assertEquals(menu.getItemCount(), i);
- new MenuItem(menu, 0);
+ new MenuItem(menu, 0);
}
}
@@ -227,7 +227,7 @@ public void test_getItems() {
int number = 5;
MenuItem[] items = new MenuItem[number];
for (int i = 0; i<number ; i++){
- items[i] = new MenuItem(menu, 0);
+ items[i] = new MenuItem(menu, 0);
}
assertArrayEquals(":a:", items, menu.getItems());
@@ -274,7 +274,7 @@ public void test_indexOfLorg_eclipse_swt_widgets_MenuItem() {
int number = 10;
MenuItem[] mis = new MenuItem[number];
for (int i = 0; i<number ; i++){
- mis[i] = new MenuItem(menu, SWT.NULL);
+ mis[i] = new MenuItem(menu, SWT.NULL);
}
for (int i = 0; i<number ; i++){
assertEquals(menu.indexOf(mis[i]), i);
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ProgressBar.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ProgressBar.java
index 3f507bd1ba..469afbeb05 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ProgressBar.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ProgressBar.java
@@ -564,12 +564,12 @@ return new int[][] {
@Test
public void test_consistency_MenuDetect () {
- consistencyEvent(10, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
+ consistencyEvent(10, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
}
@Test
public void test_consistency_DragDetect () {
- consistencyEvent(10, 5, 20, 10, ConsistencyUtility.MOUSE_DRAG);
+ consistencyEvent(10, 5, 20, 10, ConsistencyUtility.MOUSE_DRAG);
}
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Sash.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Sash.java
index ba1afbcf70..cb899714b6 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Sash.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Sash.java
@@ -67,30 +67,30 @@ public void test_setFontLorg_eclipse_swt_graphics_Font() {
Sash sash;
private void createSash() {
- tearDown();
- super.setUp();
- new Button(shell, SWT.PUSH);
- Sash sash = new Sash(shell, SWT.VERTICAL);
- new Button(shell, SWT.PUSH);
- setWidget(sash);
+ tearDown();
+ super.setUp();
+ new Button(shell, SWT.PUSH);
+ Sash sash = new Sash(shell, SWT.VERTICAL);
+ new Button(shell, SWT.PUSH);
+ setWidget(sash);
}
@Test
public void test_consistency_MenuDetect () {
- createSash();
- consistencyEvent(0, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
+ createSash();
+ consistencyEvent(0, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
}
@Test
public void test_consistency_DragDetect () {
- createSash();
- consistencyEvent(0, 5, 20, 10, ConsistencyUtility.MOUSE_DRAG);
+ createSash();
+ consistencyEvent(0, 5, 20, 10, ConsistencyUtility.MOUSE_DRAG);
}
@Test
public void test_consistency_MouseSelection() {
- createSash();
- consistencyEvent(0, 5, 1, 0, ConsistencyUtility.MOUSE_CLICK);
+ createSash();
+ consistencyEvent(0, 5, 1, 0, ConsistencyUtility.MOUSE_CLICK);
}
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Scale.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Scale.java
index 8758f9442e..089b400e81 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Scale.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Scale.java
@@ -107,8 +107,8 @@ Scale scale;
// this method must be private or protected so the auto-gen tool keeps it
private void report(String call, int set, int minExpected, int maxExpected, int selectionExpected) {
- //Uncomment these lines and comment out call to check() if you want the test to report all errors without
- //stopping.
+ //Uncomment these lines and comment out call to check() if you want the test to report all errors without
+ //stopping.
//if (trackBar.getMinimum() != minExpected)
//System.out.println(call + "(" + set + "): Minimum Expected: " + minExpected + " Actual: " + trackBar.getMinimum());
@@ -568,27 +568,27 @@ return new int[][] {
@Test
public void test_consistency_KeySelection () {
- consistencyEvent(0, SWT.ARROW_RIGHT, 0, 0, ConsistencyUtility.KEY_PRESS);
+ consistencyEvent(0, SWT.ARROW_RIGHT, 0, 0, ConsistencyUtility.KEY_PRESS);
}
@Test
public void test_consistency_ThumbSelection () {
- consistencyEvent(9, 10, 1, 0, ConsistencyUtility.MOUSE_CLICK);
+ consistencyEvent(9, 10, 1, 0, ConsistencyUtility.MOUSE_CLICK);
}
@Test
public void test_consistency_TroughSelection () {
- consistencyEvent(27, 10, 1, 0, ConsistencyUtility.MOUSE_CLICK);
+ consistencyEvent(27, 10, 1, 0, ConsistencyUtility.MOUSE_CLICK);
}
@Test
public void test_consistency_MenuDetect () {
- consistencyEvent(27, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
+ consistencyEvent(27, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
}
@Test
public void test_consistency_DragDetect () {
- consistencyEvent(9, 5, 30, 10, ConsistencyUtility.MOUSE_DRAG);
+ consistencyEvent(9, 5, 30, 10, ConsistencyUtility.MOUSE_DRAG);
}
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Shell.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Shell.java
index 872b54750c..0f673cb1da 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Shell.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Shell.java
@@ -826,93 +826,93 @@ public void test_setSizeLorg_eclipse_swt_graphics_Point() {
Shell testShell;
private void createShell() {
- tearDown();
- shell = new Shell();
- testShell = new Shell(shell, SWT.DIALOG_TRIM | SWT.MIN);
+ tearDown();
+ shell = new Shell();
+ testShell = new Shell(shell, SWT.DIALOG_TRIM | SWT.MIN);
testShell.setSize(100,300);
testShell.setText("Shell");
- testShell.setLayout(new FillLayout());
- setWidget(testShell);
+ testShell.setLayout(new FillLayout());
+ setWidget(testShell);
}
@Test
public void test_consistency_Open() {
if (SwtTestUtil.fTestConsistency) {
- createShell();
- final Display display = shell.getDisplay();
- List<String> events = new ArrayList<>();
- String[] temp = hookExpectedEvents(testShell, getTestName(), events);
- shell.pack();
- shell.open();
- testShell.pack();
- testShell.open();
- new Thread() {
- @Override
+ createShell();
+ final Display display = shell.getDisplay();
+ List<String> events = new ArrayList<>();
+ String[] temp = hookExpectedEvents(testShell, getTestName(), events);
+ shell.pack();
+ shell.open();
+ testShell.pack();
+ testShell.open();
+ new Thread() {
+ @Override
public void run() {
- display.asyncExec(new Thread() {
- @Override
+ display.asyncExec(new Thread() {
+ @Override
public void run() {
- shell.dispose();
- }
+ shell.dispose();
+ }
});
- }}.start();
-
- while(!shell.isDisposed()) {
- if(!display.readAndDispatch()) display.sleep();
- }
- setUp();
- String[] results = events.toArray(new String[events.size()]);
- assertArrayEquals(getTestName() + " event ordering", temp, results);
+ }}.start();
+
+ while(!shell.isDisposed()) {
+ if(!display.readAndDispatch()) display.sleep();
+ }
+ setUp();
+ String[] results = events.toArray(new String[events.size()]);
+ assertArrayEquals(getTestName() + " event ordering", temp, results);
}
}
@Test
public void test_consistency_Iconify() {
- createShell();
- consistencyEvent(1, 0, 0, 0, ConsistencyUtility.SHELL_ICONIFY, null, false);
+ createShell();
+ consistencyEvent(1, 0, 0, 0, ConsistencyUtility.SHELL_ICONIFY, null, false);
}
@Test
public void test_consistency_Close() {
- createShell();
- consistencyPrePackShell();
- consistencyEvent(0, SWT.ALT, 0, SWT.F4, ConsistencyUtility.DOUBLE_KEY_PRESS);
- createShell();
+ createShell();
+ consistencyPrePackShell();
+ consistencyEvent(0, SWT.ALT, 0, SWT.F4, ConsistencyUtility.DOUBLE_KEY_PRESS);
+ createShell();
}
@Test
public void test_consistency_Dispose() {
- createShell();
+ createShell();
- final Button button = new Button(testShell, SWT.PUSH);
- button.setText("dispose");
- button.addSelectionListener( new SelectionAdapter() {
- @Override
+ final Button button = new Button(testShell, SWT.PUSH);
+ button.setText("dispose");
+ button.addSelectionListener( new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent se) {
- button.dispose();
- testShell.dispose();
- }
- });
- List<String> events = new ArrayList<>();
- consistencyPrePackShell(testShell);
- Point pt = button.getLocation();
- consistencyEvent(pt.x, pt.y, 1, 0, ConsistencyUtility.MOUSE_CLICK, events);
- createShell();
+ button.dispose();
+ testShell.dispose();
+ }
+ });
+ List<String> events = new ArrayList<>();
+ consistencyPrePackShell(testShell);
+ Point pt = button.getLocation();
+ consistencyEvent(pt.x, pt.y, 1, 0, ConsistencyUtility.MOUSE_CLICK, events);
+ createShell();
}
@Test
public void test_setAlpha() {
- createShell();
- testShell.setAlpha(128);
- int alpha = testShell.getAlpha();
- if (SwtTestUtil.isGTK && alpha == 255) {
- System.out.println("Test_org_eclipse_swt_widgets_Shell.test_setAlpha(): expected 128, but was 255. "
- + "Probably missing window manager functionality, see bug 498208.");
- } else {
- assertEquals(128, alpha);
- }
- testShell.setAlpha(255);
- assertEquals(255, testShell.getAlpha());
+ createShell();
+ testShell.setAlpha(128);
+ int alpha = testShell.getAlpha();
+ if (SwtTestUtil.isGTK && alpha == 255) {
+ System.out.println("Test_org_eclipse_swt_widgets_Shell.test_setAlpha(): expected 128, but was 255. "
+ + "Probably missing window manager functionality, see bug 498208.");
+ } else {
+ assertEquals(128, alpha);
+ }
+ testShell.setAlpha(255);
+ assertEquals(255, testShell.getAlpha());
}
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Slider.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Slider.java
index 2d387ccf63..4aada03d62 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Slider.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Slider.java
@@ -115,8 +115,8 @@ public void test_getIncrement() {
int[] cases = {1, 10, 10000};
for (int i=0; i<cases.length; i++)
{
- slider.setIncrement(cases[i]);
- assertTrue("case: " + String.valueOf(i), slider.getIncrement()==cases[i]);
+ slider.setIncrement(cases[i]);
+ assertTrue("case: " + String.valueOf(i), slider.getIncrement()==cases[i]);
}
}
@@ -153,8 +153,8 @@ public void test_getPageIncrement() {
int[] cases = {1, 10, 10000};
for (int i=0; i<cases.length; i++)
{
- slider.setPageIncrement(cases[i]);
- assertTrue("case: " + String.valueOf(i), slider.getPageIncrement()==cases[i]);
+ slider.setPageIncrement(cases[i]);
+ assertTrue("case: " + String.valueOf(i), slider.getPageIncrement()==cases[i]);
}
}
@@ -204,8 +204,8 @@ public void test_setMinimumI() {
@Test
public void test_setPageIncrementI() {
- slider.setPageIncrement(3);
- assertTrue(":a:", slider.getPageIncrement()== 3);
+ slider.setPageIncrement(3);
+ assertTrue(":a:", slider.getPageIncrement()== 3);
}
@Test
@@ -873,32 +873,32 @@ return new int[][] {
@Test
public void test_consistency_ArrowSelection() {
- consistencyPrePackShell();
- consistencyEvent(slider.getSize().x-10, 5, 1, 0, ConsistencyUtility.MOUSE_CLICK);
+ consistencyPrePackShell();
+ consistencyEvent(slider.getSize().x-10, 5, 1, 0, ConsistencyUtility.MOUSE_CLICK);
}
@Test
public void test_consistency_KeySelection () {
- consistencyEvent(0, SWT.ARROW_RIGHT, 0, 0, ConsistencyUtility.KEY_PRESS);
+ consistencyEvent(0, SWT.ARROW_RIGHT, 0, 0, ConsistencyUtility.KEY_PRESS);
}
@Test
public void test_consistency_ThumbSelection () {
- consistencyEvent(25, 10, 1, 0, ConsistencyUtility.MOUSE_CLICK);
+ consistencyEvent(25, 10, 1, 0, ConsistencyUtility.MOUSE_CLICK);
}
@Test
public void test_consistency_TroughSelection () {
- consistencyEvent(45, 10, 1, 0, ConsistencyUtility.MOUSE_CLICK);
+ consistencyEvent(45, 10, 1, 0, ConsistencyUtility.MOUSE_CLICK);
}
@Test
public void test_consistency_MenuDetect () {
- consistencyEvent(27, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
+ consistencyEvent(27, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
}
@Test
public void test_consistency_DragDetect () {
- consistencyEvent(9, 5, 30, 10, ConsistencyUtility.MOUSE_DRAG);
+ consistencyEvent(9, 5, 30, 10, ConsistencyUtility.MOUSE_DRAG);
}
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TabFolder.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TabFolder.java
index 8abdedf5a8..7a757ea839 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TabFolder.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TabFolder.java
@@ -93,7 +93,7 @@ public void test_getItemCount() {
int number = 10;
for (int i = 0; i<number ; i++){
assertTrue(":a:" + i, tabFolder.getItemCount()==i);
- new TabItem(tabFolder, 0);
+ new TabItem(tabFolder, 0);
}
}
@@ -138,7 +138,7 @@ public void test_getItems() {
assertEquals(0, tabFolder.getItems().length);
for (int i = 0; i<number ; i++){
- items[i] = new TabItem(tabFolder, 0);
+ items[i] = new TabItem(tabFolder, 0);
}
assertArrayEquals(items, tabFolder.getItems());
@@ -158,21 +158,21 @@ public void test_getItems() {
*/
@Test
public void test_setControl() {
- int number = 5;
- TabItem[] items = new TabItem[number];
-
- final Button setControlButton = new Button (tabFolder, SWT.None);
- setControlButton.setText ("test button");
-
- for (int i = 0; i < number; i++) {
- items[i] = new TabItem(tabFolder, 0);
- items[i].setControl (setControlButton);
- assertEquals (items[i].getControl (), setControlButton);
- assertTrue(setControlButton.getVisible());
- }
- items[0].setControl (setControlButton);
- assertEquals (items[0].getControl (), setControlButton);
- assertTrue(setControlButton.getVisible());
+ int number = 5;
+ TabItem[] items = new TabItem[number];
+
+ final Button setControlButton = new Button (tabFolder, SWT.None);
+ setControlButton.setText ("test button");
+
+ for (int i = 0; i < number; i++) {
+ items[i] = new TabItem(tabFolder, 0);
+ items[i].setControl (setControlButton);
+ assertEquals (items[i].getControl (), setControlButton);
+ assertTrue(setControlButton.getVisible());
+ }
+ items[0].setControl (setControlButton);
+ assertEquals (items[0].getControl (), setControlButton);
+ assertTrue(setControlButton.getVisible());
}
@Test
@@ -180,7 +180,7 @@ public void test_getSelection() {
int number = 10;
TabItem[] tis = new TabItem[number];
for (int i = 0; i<number ; i++){
- tis[i] = new TabItem(tabFolder, 0);
+ tis[i] = new TabItem(tabFolder, 0);
}
assertTrue(":a:", tabFolder.getSelection()[0] == tis[0]);
for (int i = 0; i<number ; i++){
@@ -213,7 +213,7 @@ public void test_indexOfLorg_eclipse_swt_widgets_TabItem() {
int number = 10;
TabItem[] tis = new TabItem[number];
for (int i = 0; i<number ; i++){
- tis[i] = new TabItem(tabFolder, 0);
+ tis[i] = new TabItem(tabFolder, 0);
}
for (int i = 0; i<number ; i++){
assertTrue(":a:" + i, tabFolder.indexOf(tis[i])==i);
@@ -223,7 +223,7 @@ public void test_indexOfLorg_eclipse_swt_widgets_TabItem() {
makeCleanEnvironment();
for (int i = 0; i<number ; i++){
- tis[i] = new TabItem(tabFolder, 0);
+ tis[i] = new TabItem(tabFolder, 0);
}
for (int i = 0; i<number ; i++){
try {
@@ -274,7 +274,7 @@ public void test_setSelectionEmpty() {
}
int number = 10;
for (int i = 0; i<number ; i++){
- new TabItem(tabFolder, 0);
+ new TabItem(tabFolder, 0);
}
for (int i = 0; i<number ; i++){
tabFolder.setSelection(i);
@@ -290,7 +290,7 @@ public void test_setSelectionEmpty() {
public void test_setSelectionI() {
int number = 10;
for (int i = 0; i<number ; i++){
- new TabItem(tabFolder, 0);
+ new TabItem(tabFolder, 0);
}
for (int i = 0; i<number ; i++){
tabFolder.setSelection(i);
@@ -301,8 +301,8 @@ public void test_setSelectionI() {
makeCleanEnvironment();
for (int i = 0; i<number ; i++){
- new TabItem(tabFolder, 0);
- assertEquals("i=" + i, 0, tabFolder.getSelectionIndex());
+ new TabItem(tabFolder, 0);
+ assertEquals("i=" + i, 0, tabFolder.getSelectionIndex());
}
//
@@ -430,47 +430,47 @@ private void createTabFolder(List<String> events) {
@Test
public void test_consistency_KeySelection() {
- List<String> events = new ArrayList<>();
- createTabFolder(events);
- consistencyEvent(0, SWT.ARROW_RIGHT, 0, 0, ConsistencyUtility.KEY_PRESS, events, false);
+ List<String> events = new ArrayList<>();
+ createTabFolder(events);
+ consistencyEvent(0, SWT.ARROW_RIGHT, 0, 0, ConsistencyUtility.KEY_PRESS, events, false);
}
@Test
public void test_consistency_MouseSelection() {
- List<String> events = new ArrayList<>();
- createTabFolder(events);
- consistencyPrePackShell();
- consistencyEvent(tabFolder.getSize().x/2, 5, 1, 0, ConsistencyUtility.MOUSE_CLICK, events);
+ List<String> events = new ArrayList<>();
+ createTabFolder(events);
+ consistencyPrePackShell();
+ consistencyEvent(tabFolder.getSize().x/2, 5, 1, 0, ConsistencyUtility.MOUSE_CLICK, events);
}
@Test
public void test_consistency_PgdwnSelection () {
- List<String> events = new ArrayList<>();
- createTabFolder(events);
- consistencyEvent(0, SWT.CTRL, 0, SWT.PAGE_DOWN, ConsistencyUtility.DOUBLE_KEY_PRESS, events, false);
+ List<String> events = new ArrayList<>();
+ createTabFolder(events);
+ consistencyEvent(0, SWT.CTRL, 0, SWT.PAGE_DOWN, ConsistencyUtility.DOUBLE_KEY_PRESS, events, false);
}
@Test
public void test_consistency_PgupSelection () {
- List<String> events = new ArrayList<>();
- createTabFolder(events);
- tabFolder.setSelection(2);
- consistencyEvent(0, SWT.CTRL, 0, SWT.PAGE_UP, ConsistencyUtility.DOUBLE_KEY_PRESS, events, false);
+ List<String> events = new ArrayList<>();
+ createTabFolder(events);
+ tabFolder.setSelection(2);
+ consistencyEvent(0, SWT.CTRL, 0, SWT.PAGE_UP, ConsistencyUtility.DOUBLE_KEY_PRESS, events, false);
}
@Test
public void test_consistency_MenuDetect () {
- List<String> events = new ArrayList<>();
- createTabFolder(events);
- tabFolder.setSelection(1);
- consistencyEvent(50, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK, events);
+ List<String> events = new ArrayList<>();
+ createTabFolder(events);
+ tabFolder.setSelection(1);
+ consistencyEvent(50, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK, events);
}
@Test
public void test_consistency_DragDetect () {
- List<String> events = new ArrayList<>();
- createTabFolder(events);
- tabFolder.setSelection(1);
- consistencyEvent(50, 5, 70, 10, ConsistencyUtility.MOUSE_DRAG, events);
+ List<String> events = new ArrayList<>();
+ createTabFolder(events);
+ tabFolder.setSelection(1);
+ consistencyEvent(50, 5, 70, 10, ConsistencyUtility.MOUSE_DRAG, events);
}
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Table.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Table.java
index 03f72088c7..cfb4de6952 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Table.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Table.java
@@ -1818,48 +1818,48 @@ private void createTable(List<String> events) {
@Test
public void test_consistency_KeySelection() {
- List<String> events = new ArrayList<>();
- createTable(events);
- consistencyEvent(0, SWT.ARROW_DOWN, 0, 0, ConsistencyUtility.KEY_PRESS, events);
+ List<String> events = new ArrayList<>();
+ createTable(events);
+ consistencyEvent(0, SWT.ARROW_DOWN, 0, 0, ConsistencyUtility.KEY_PRESS, events);
}
@Test
public void test_consistency_MouseSelection() {
- List<String> events = new ArrayList<>();
- createTable(events);
- consistencyPrePackShell();
- consistencyEvent(20, table.getHeaderHeight() + table.getItemHeight()*2,
- 1, 0, ConsistencyUtility.MOUSE_CLICK, events);
+ List<String> events = new ArrayList<>();
+ createTable(events);
+ consistencyPrePackShell();
+ consistencyEvent(20, table.getHeaderHeight() + table.getItemHeight()*2,
+ 1, 0, ConsistencyUtility.MOUSE_CLICK, events);
}
@Test
public void test_consistency_DoubleClick () {
- List<String> events = new ArrayList<>();
- createTable(events);
- consistencyPrePackShell();
- consistencyEvent(20, table.getHeaderHeight()+ table.getItemHeight() + 5, 1, 0,
- ConsistencyUtility.MOUSE_DOUBLECLICK, events);
+ List<String> events = new ArrayList<>();
+ createTable(events);
+ consistencyPrePackShell();
+ consistencyEvent(20, table.getHeaderHeight()+ table.getItemHeight() + 5, 1, 0,
+ ConsistencyUtility.MOUSE_DOUBLECLICK, events);
}
@Test
public void test_consistency_EnterSelection () {
- List<String> events = new ArrayList<>();
- createTable(events);
- consistencyEvent(13, 10, 0, 0, ConsistencyUtility.KEY_PRESS, events);
+ List<String> events = new ArrayList<>();
+ createTable(events);
+ consistencyEvent(13, 10, 0, 0, ConsistencyUtility.KEY_PRESS, events);
}
@Test
public void test_consistency_MenuDetect () {
- List<String> events = new ArrayList<>();
- createTable(events);
- consistencyEvent(20, 25, 3, 0, ConsistencyUtility.MOUSE_CLICK, events);
+ List<String> events = new ArrayList<>();
+ createTable(events);
+ consistencyEvent(20, 25, 3, 0, ConsistencyUtility.MOUSE_CLICK, events);
}
@Test
public void test_consistency_DragDetect () {
- List<String> events = new ArrayList<>();
- createTable(events);
- consistencyEvent(30, 20, 50, 30, ConsistencyUtility.MOUSE_DRAG, events);
+ List<String> events = new ArrayList<>();
+ createTable(events);
+ consistencyEvent(30, 20, 50, 30, ConsistencyUtility.MOUSE_DRAG, events);
}
@Test
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableItem.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableItem.java
index 46870a0956..784a155364 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableItem.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableItem.java
@@ -86,11 +86,11 @@ public void test_getBoundsI() {
Rectangle bounds2;
// no columns
- bounds = tableItem.getBounds(0);
+ bounds = tableItem.getBounds(0);
assertTrue(":1a:", bounds.x > 0 && bounds.height > 0);
bounds = tableItem.getBounds(-1);
assertTrue(":1b:", bounds.equals(new Rectangle(0, 0, 0, 0)));
- bounds = tableItem.getBounds(1);
+ bounds = tableItem.getBounds(1);
assertTrue(":1c:", bounds.equals(new Rectangle(0, 0, 0, 0)));
tableItem.setText("hello");
@@ -130,7 +130,7 @@ public void test_getBoundsI() {
assertTrue(":2a:", bounds.x > 0 && bounds.height > 0);
bounds = tableItem2.getBounds(-1);
assertTrue(":2b:", bounds.equals(new Rectangle(0, 0, 0, 0)));
- bounds = tableItem2.getBounds(1);
+ bounds = tableItem2.getBounds(1);
assertTrue(":2c:", bounds.equals(new Rectangle(0, 0, 0, 0)));
tableItem2.setText("hello");
@@ -178,7 +178,7 @@ public void test_getBoundsI() {
assertTrue(":3b:", /*bounds.x > 0 &&*/ bounds.height > 0 && bounds.width == 0); // TODO bounds.x == 0 Is this right?
bounds = tableItem.getBounds(-1);
assertTrue(":3c:", bounds.equals(new Rectangle(0, 0, 0, 0)));
- bounds = tableItem.getBounds(2);
+ bounds = tableItem.getBounds(2);
assertTrue(":3d:", bounds.equals(new Rectangle(0, 0, 0, 0)));
column0.setWidth(100);
@@ -216,7 +216,7 @@ public void test_getBoundsI() {
assertTrue(":3m:", bounds.x > 0 && bounds.height > 0 && bounds.width > 0 && bounds.width < 100);
bounds = tableItem.getBounds(1);
assertTrue(":3n:", bounds.x >= 100 && bounds.height > 0 && bounds.width == 200);
- tableItem.setImage(new Image[] {null, null});
+ tableItem.setImage(new Image[] {null, null});
bounds = tableItem.getBounds(0);
assertTrue(":3o:", bounds.x > 0 && bounds.height > 0 && bounds.width > 0 && bounds.width < 100);
bounds = tableItem.getBounds(1);
@@ -257,7 +257,7 @@ public void test_getBoundsI() {
assertTrue(":4b:", /*bounds.x > 0 &&*/ bounds.height > 0 && bounds.width == 0); // TODO bounds.x == 0 Is this right?
bounds = tableItem2.getBounds(-1);
assertTrue(":4c:", bounds.equals(new Rectangle(0, 0, 0, 0)));
- bounds = tableItem2.getBounds(2);
+ bounds = tableItem2.getBounds(2);
assertTrue(":4d:", bounds.equals(new Rectangle(0, 0, 0, 0)));
column0.setWidth(100);
@@ -297,7 +297,7 @@ public void test_getBoundsI() {
assertTrue(":4m:", bounds.x > 0 && bounds.height > 0 && bounds.width > 0 && bounds.width < 100);
bounds = tableItem2.getBounds(1);
assertTrue(":4n:", bounds.x >= 100 && bounds.height > 0 && bounds.width == 200);
- tableItem2.setImage(new Image[] {null, null});
+ tableItem2.setImage(new Image[] {null, null});
bounds = tableItem2.getBounds(0);
assertTrue(":4o:", bounds.x > 0 && bounds.height > 0 && bounds.width > 0 && bounds.width < 100);
bounds = tableItem2.getBounds(1);
@@ -352,7 +352,7 @@ public void test_getImageBoundsI() {
assertTrue(":e:", bounds.width == 0);
assertEquals(new Rectangle(0, 0, 0, 0), tableItem2.getImageBounds(1));
- //
+ //
makeCleanEnvironment();
Image image = images[0];
@@ -395,12 +395,12 @@ public void test_getImageBoundsI() {
image = images[1];
// imageBounds = image.getBounds();
// imageWidth = imageBounds.width;
- tableItem2.setImage(0, image);
+ tableItem2.setImage(0, image);
// imageHeight = table2.getItemHeight() - table2.getGridLineWidth();
assertEquals(new Rectangle(0, 0, 0, 0), tableItem2.getImageBounds(-1));
- bounds = tableItem2.getImageBounds(0); // bounds.width should be check box width if check box is wider than image
+ bounds = tableItem2.getImageBounds(0); // bounds.width should be check box width if check box is wider than image
// assertTrue(":b:", bounds.x > 0 && bounds.width > 0 && bounds.height == imageHeight);
- assertEquals(new Rectangle(0, 0, 0, 0), tableItem2.getImageBounds(1));
+ assertEquals(new Rectangle(0, 0, 0, 0), tableItem2.getImageBounds(1));
}
@Test
@@ -477,7 +477,7 @@ public void test_setCheckedZ() {
tableItem.setChecked(true);
assertFalse(tableItem.getChecked());
- Table t = new Table(shell, SWT.CHECK);
+ Table t = new Table(shell, SWT.CHECK);
TableItem ti = new TableItem(t, SWT.NULL);
ti.setChecked(true);
assertTrue(ti.getChecked());
@@ -639,12 +639,12 @@ public void test_setGrayedZ() {
@Test
public void test_setImage$Lorg_eclipse_swt_graphics_Image() {
assertNull(tableItem.getImage(1));
- tableItem.setImage(-1, null);
+ tableItem.setImage(-1, null);
assertNull(tableItem.getImage(-1));
tableItem.setImage(0, images[0]);
assertEquals(images[0], tableItem.getImage(0));
- String texts[] = new String[images.length];
+ String texts[] = new String[images.length];
for (int i = 0; i < texts.length; i++) {
texts[i] = String.valueOf(i);
}
@@ -662,7 +662,7 @@ public void test_setImage$Lorg_eclipse_swt_graphics_Image() {
}
tableItem.setImage(1, images[1]);
assertEquals(images[1], tableItem.getImage(1));
- tableItem.setImage(images);
+ tableItem.setImage(images);
for (int i = 0; i < images.length; i++) {
assertEquals(images[i], tableItem.getImage(i));
}
@@ -723,9 +723,9 @@ public void test_setImageIndentI() {
return;
}
assertEquals(0, tableItem.getImageIndent());
- tableItem.setImageIndent(1);
+ tableItem.setImageIndent(1);
assertEquals(1, tableItem.getImageIndent());
- tableItem.setImageIndent(-1);
+ tableItem.setImageIndent(-1);
assertEquals(1, tableItem.getImageIndent());
}
@@ -741,10 +741,10 @@ public void test_setText$Ljava_lang_String() {
catch (IllegalArgumentException e) {
}
- /*
- * Test the getText/setText API with a Table that has only
- * the default column.
- */
+ /*
+ * Test the getText/setText API with a Table that has only
+ * the default column.
+ */
assertEquals(0, tableItem.getText(1).length());
@@ -755,10 +755,10 @@ public void test_setText$Ljava_lang_String() {
}
- /*
- * Test the getText/setText API with a Table that enough
- * columns to fit all test item texts.
- */
+ /*
+ * Test the getText/setText API with a Table that enough
+ * columns to fit all test item texts.
+ */
int columnCount = table.getColumnCount();
if (columnCount < images.length) {
@@ -779,25 +779,25 @@ public void test_setTextILjava_lang_String(){
final String TestString = "test";
final String TestStrings[] = new String[] {TestString, TestString + "1", TestString + "2"};
- /*
- * Test the getText/setText API with a Table that has only
- * the default column.
- */
+ /*
+ * Test the getText/setText API with a Table that has only
+ * the default column.
+ */
assertEquals(0, tableItem.getText(1).length());
- tableItem.setText(1, TestString);
+ tableItem.setText(1, TestString);
assertEquals(0, tableItem.getText(1).length());
assertEquals(0, tableItem.getText(0).length());
tableItem.setText(0, TestString);
assertEquals(TestString, tableItem.getText(0));
- tableItem.setText(-1, TestStrings[1]);
+ tableItem.setText(-1, TestStrings[1]);
assertEquals(0, tableItem.getText(-1).length());
- /*
- * Test the getText/setText API with a Table that enough
- * columns to fit all test item texts.
- */
+ /*
+ * Test the getText/setText API with a Table that enough
+ * columns to fit all test item texts.
+ */
makeCleanEnvironment();
@@ -843,12 +843,12 @@ public void test_setTextILjava_lang_String(){
/*
- * Test the getText/setText API with a small table that
- * will be extended by a column:
- * First the table has only one column and one row (TableItem) with text.
+ * Test the getText/setText API with a small table that
+ * will be extended by a column:
+ * First the table has only one column and one row (TableItem) with text.
* Then it is extended by one more column.
* After this the existing row gets one more text for the new column.
- */
+ */
makeCleanEnvironment();
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Text.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Text.java
index 8c83fdc414..4c025fd199 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Text.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Text.java
@@ -1485,26 +1485,26 @@ protected void setWidget(Widget w) {
@Test
public void test_consistency_EnterSelection () {
- makeCleanEnvironment(true);
- consistencyEvent(13, 10, 0, 0, ConsistencyUtility.KEY_PRESS);
+ makeCleanEnvironment(true);
+ consistencyEvent(13, 10, 0, 0, ConsistencyUtility.KEY_PRESS);
}
@Test
public void test_consistency_Modify() {
- makeCleanEnvironment(true);
- consistencyEvent('a', 0, 0, 0, ConsistencyUtility.KEY_PRESS);
+ makeCleanEnvironment(true);
+ consistencyEvent('a', 0, 0, 0, ConsistencyUtility.KEY_PRESS);
}
@Test
public void test_consistency_MenuDetect () {
- makeCleanEnvironment(true);
- consistencyEvent(10, 10, 3, ConsistencyUtility.ESCAPE_MENU, ConsistencyUtility.MOUSE_CLICK);
+ makeCleanEnvironment(true);
+ consistencyEvent(10, 10, 3, ConsistencyUtility.ESCAPE_MENU, ConsistencyUtility.MOUSE_CLICK);
}
@Test
public void test_consistency_DragDetect () {
- makeCleanEnvironment(true);
- consistencyEvent(30, 10, 50, 0, ConsistencyUtility.MOUSE_DRAG);
+ makeCleanEnvironment(true);
+ consistencyEvent(30, 10, 50, 0, ConsistencyUtility.MOUSE_DRAG);
}
@Test
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ToolBar.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ToolBar.java
index cf252f917f..1773391438 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ToolBar.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ToolBar.java
@@ -67,7 +67,7 @@ public void test_getItemCount() {
int number = 10;
for (int i = 0; i<number ; i++){
assertTrue(":a:" + i, toolBar.getItemCount()==i);
- new ToolItem(toolBar, 0);
+ new ToolItem(toolBar, 0);
}
}
@@ -76,7 +76,7 @@ public void test_getItemI() {
int number = 5;
ToolItem[] items = new ToolItem[number];
for (int i = 0; i<number ; i++){
- items[i] = new ToolItem(toolBar, 0);
+ items[i] = new ToolItem(toolBar, 0);
}
for (int i = 0; i<number ; i++){
assertTrue(":a:", toolBar.getItem(i)==items[i]);
@@ -86,7 +86,7 @@ public void test_getItemI() {
number = 5;
items = new ToolItem[number];
for (int i = 0; i<number ; i++){
- items[i] = new ToolItem(toolBar, 0);
+ items[i] = new ToolItem(toolBar, 0);
}
try {
toolBar.getItem(number);
@@ -101,7 +101,7 @@ public void test_getItems() {
int number = 5;
ToolItem[] items = new ToolItem[number];
for (int i = 0; i<number ; i++){
- items[i] = new ToolItem(toolBar, 0);
+ items[i] = new ToolItem(toolBar, 0);
}
assertArrayEquals(items, toolBar.getItems());
@@ -128,7 +128,7 @@ public void test_getRowCount() {
int number = 5;
ToolItem[] items = new ToolItem[number];
for (int i = 0; i<number ; i++){
- items[i] = new ToolItem(toolBar, 0);
+ items[i] = new ToolItem(toolBar, 0);
}
assertTrue(":a:" + toolBar.getRowCount(), toolBar.getRowCount()==number); //???? because of Size(0, 0)
@@ -136,7 +136,7 @@ public void test_getRowCount() {
number = 5;
items = new ToolItem[number];
for (int i = 0; i<number ; i++){
- items[i] = new ToolItem(toolBar, 0);
+ items[i] = new ToolItem(toolBar, 0);
}
assertTrue(":a:", toolBar.getRowCount()==1);
}
@@ -146,7 +146,7 @@ public void test_indexOfLorg_eclipse_swt_widgets_ToolItem() {
int number = 10;
ToolItem[] tis = new ToolItem[number];
for (int i = 0; i<number ; i++){
- tis[i] = new ToolItem(toolBar, 0);
+ tis[i] = new ToolItem(toolBar, 0);
}
for (int i = 0; i<number ; i++){
assertTrue(":a:" + i, toolBar.indexOf(tis[i])==i);
@@ -155,7 +155,7 @@ public void test_indexOfLorg_eclipse_swt_widgets_ToolItem() {
number = 10;
tis = new ToolItem[number];
for (int i = 0; i<number ; i++){
- tis[i] = new ToolItem(toolBar, 0);
+ tis[i] = new ToolItem(toolBar, 0);
}
for (int i = 0; i<number ; i++){
try {
@@ -183,36 +183,36 @@ private void createToolBar(List<String> events) {
@Test
public void test_consistency_MouseSelection() {
- List<String> events = new ArrayList<>();
- createToolBar(events);
- consistencyEvent(30, 10, 1, 0, ConsistencyUtility.MOUSE_CLICK, events);
+ List<String> events = new ArrayList<>();
+ createToolBar(events);
+ consistencyEvent(30, 10, 1, 0, ConsistencyUtility.MOUSE_CLICK, events);
}
@Test
public void test_consistency_EnterSelection () {
- List<String> events = new ArrayList<>();
- createToolBar(events);
- consistencyEvent(13, 10, 0, 0, ConsistencyUtility.KEY_PRESS, events);
+ List<String> events = new ArrayList<>();
+ createToolBar(events);
+ consistencyEvent(13, 10, 0, 0, ConsistencyUtility.KEY_PRESS, events);
}
@Test
public void test_consistency_SpaceSelection () {
- List<String> events = new ArrayList<>();
- createToolBar(events);
- consistencyEvent(' ', 32, 0, 0, ConsistencyUtility.KEY_PRESS, events);
+ List<String> events = new ArrayList<>();
+ createToolBar(events);
+ consistencyEvent(' ', 32, 0, 0, ConsistencyUtility.KEY_PRESS, events);
}
@Test
public void test_consistency_MenuDetect () {
- List<String> events = new ArrayList<>();
- createToolBar(events);
- consistencyEvent(50, 15, 3, 0, ConsistencyUtility.MOUSE_CLICK, events);
+ List<String> events = new ArrayList<>();
+ createToolBar(events);
+ consistencyEvent(50, 15, 3, 0, ConsistencyUtility.MOUSE_CLICK, events);
}
@Test
public void test_consistency_DragDetect () {
- List<String> events = new ArrayList<>();
- createToolBar(events);
- consistencyEvent(30, 20, 50, 20, ConsistencyUtility.MOUSE_DRAG, events);
+ List<String> events = new ArrayList<>();
+ createToolBar(events);
+ consistencyEvent(30, 20, 50, 20, ConsistencyUtility.MOUSE_DRAG, events);
}
}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Tree.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Tree.java
index 2bf79fff7f..3485390f67 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Tree.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Tree.java
@@ -762,7 +762,7 @@ private void makeCleanEnvironment(boolean single) {
}
private void createTree(List<String> events) {
- makeCleanEnvironment(true);
+ makeCleanEnvironment(true);
for (int i = 0; i < 3; i++) {
TreeItem item = new TreeItem(tree, SWT.NONE);
item.setText("TreeItem" + i);
@@ -777,70 +777,70 @@ private void createTree(List<String> events) {
@Test
public void test_consistency_KeySelection() {
- List<String> events = new ArrayList<>();
- createTree(events);
- consistencyEvent(0, SWT.ARROW_DOWN, 0, 0, ConsistencyUtility.KEY_PRESS, events);
+ List<String> events = new ArrayList<>();
+ createTree(events);
+ consistencyEvent(0, SWT.ARROW_DOWN, 0, 0, ConsistencyUtility.KEY_PRESS, events);
}
@Test
public void test_consistency_MouseSelection() {
- List<String> events = new ArrayList<>();
- createTree(events);
- consistencyEvent(30, 30, 1, 0, ConsistencyUtility.MOUSE_CLICK, events);
+ List<String> events = new ArrayList<>();
+ createTree(events);
+ consistencyEvent(30, 30, 1, 0, ConsistencyUtility.MOUSE_CLICK, events);
}
@Test
public void test_consistency_MouseExpand() {
- List<String> events = new ArrayList<>();
- createTree(events);
- consistencyEvent(11, 10, 1, 0, ConsistencyUtility.MOUSE_CLICK, events);
+ List<String> events = new ArrayList<>();
+ createTree(events);
+ consistencyEvent(11, 10, 1, 0, ConsistencyUtility.MOUSE_CLICK, events);
}
@Test
public void test_consistency_KeyExpand() {
- List<String> events = new ArrayList<>();
- createTree(events);
- int code=SWT.ARROW_RIGHT;
- if(SwtTestUtil.isGTK)
- code = SWT.KEYPAD_ADD;
- consistencyEvent(0, code, 0, 0, ConsistencyUtility.KEY_PRESS, events);
+ List<String> events = new ArrayList<>();
+ createTree(events);
+ int code=SWT.ARROW_RIGHT;
+ if(SwtTestUtil.isGTK)
+ code = SWT.KEYPAD_ADD;
+ consistencyEvent(0, code, 0, 0, ConsistencyUtility.KEY_PRESS, events);
}
@Test
public void test_consistency_DoubleClick () {
- List<String> events = new ArrayList<>();
- createTree(events);
- consistencyPrePackShell();
- consistencyEvent(20, tree.getItemHeight()*2, 1, 0,
- ConsistencyUtility.MOUSE_DOUBLECLICK, events);
+ List<String> events = new ArrayList<>();
+ createTree(events);
+ consistencyPrePackShell();
+ consistencyEvent(20, tree.getItemHeight()*2, 1, 0,
+ ConsistencyUtility.MOUSE_DOUBLECLICK, events);
}
@Test
public void test_consistency_EnterSelection () {
- List<String> events = new ArrayList<>();
- createTree(events);
- consistencyEvent(13, 10, 0, 0, ConsistencyUtility.KEY_PRESS, events);
+ List<String> events = new ArrayList<>();
+ createTree(events);
+ consistencyEvent(13, 10, 0, 0, ConsistencyUtility.KEY_PRESS, events);
}
@Test
public void test_consistency_SpaceSelection () {
- List<String> events = new ArrayList<>();
- createTree(events);
- consistencyEvent(' ', 32, 0, 0, ConsistencyUtility.KEY_PRESS, events);
+ List<String> events = new ArrayList<>();
+ createTree(events);
+ consistencyEvent(' ', 32, 0, 0, ConsistencyUtility.KEY_PRESS, events);
}
@Test
public void test_consistency_MenuDetect () {
- List<String> events = new ArrayList<>();
- createTree(events);
- consistencyEvent(50, 25, 3, 0, ConsistencyUtility.MOUSE_CLICK, events);
+ List<String> events = new ArrayList<>();
+ createTree(events);
+ consistencyEvent(50, 25, 3, 0, ConsistencyUtility.MOUSE_CLICK, events);
}
@Test
public void test_consistency_DragDetect () {
- List<String> events = new ArrayList<>();
- createTree(events);
- consistencyEvent(30, 20, 50, 30, ConsistencyUtility.MOUSE_DRAG, events);
+ List<String> events = new ArrayList<>();
+ createTree(events);
+ consistencyEvent(30, 20, 50, 30, ConsistencyUtility.MOUSE_DRAG, events);
}
@Test
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeItem.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeItem.java
index ccb5991cc4..01cf2ca5da 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeItem.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeItem.java
@@ -110,7 +110,7 @@ public void test_getBounds() {
String string = "hello";
// no columns
- bounds = treeItem.getBounds();
+ bounds = treeItem.getBounds();
assertTrue(":1a:", bounds.x > 0 && bounds.height > 0);
treeItem.setText(string);
@@ -179,11 +179,11 @@ void getBoundsIA() {
//
makeCleanEnvironment();
- bounds = treeItem.getBounds(0);
+ bounds = treeItem.getBounds(0);
assertTrue(":1a:", bounds.x > 0 && bounds.height > 0);
bounds = treeItem.getBounds(-1);
assertTrue(":1b:", bounds.equals(new Rectangle(0, 0, 0, 0)));
- bounds = treeItem.getBounds(1);
+ bounds = treeItem.getBounds(1);
assertTrue(":1c:", bounds.equals(new Rectangle(0, 0, 0, 0)));
// unexpanded item
TreeItem subItem = new TreeItem(treeItem, SWT.NONE);
@@ -252,7 +252,7 @@ void getBoundsIB() {
assertTrue(":2a:", bounds.x > 0 && bounds.height > 0);
bounds = treeItem2.getBounds(-1);
assertTrue(":2b:", bounds.equals(new Rectangle(0, 0, 0, 0)));
- bounds = treeItem2.getBounds(1);
+ bounds = treeItem2.getBounds(1);
assertTrue(":2c:", bounds.equals(new Rectangle(0, 0, 0, 0)));
// unexpanded item
TreeItem subItem2 = new TreeItem(treeItem2, SWT.NONE);
@@ -331,7 +331,7 @@ void getBoundsIC() {
assertTrue(":3b:", /*bounds.x > 0 &&*/ bounds.height > 0 && bounds.width == 0); // TODO bounds.x == 0 Is this right?
bounds = treeItem.getBounds(-1);
assertTrue(":3c:", bounds.equals(new Rectangle(0, 0, 0, 0)));
- bounds = treeItem.getBounds(2);
+ bounds = treeItem.getBounds(2);
assertTrue(":3d:", bounds.equals(new Rectangle(0, 0, 0, 0)));
// unexpanded item
TreeItem subItem = new TreeItem(treeItem, SWT.NONE);
@@ -387,7 +387,7 @@ void getBoundsIC() {
assertTrue(":3r:", bounds.x > 0 && bounds.height >= imageBounds.height && bounds.width > 0 && bounds.width < 100);
bounds = treeItem.getBounds(1);
assertTrue(":3s:", bounds.x >= 100 && bounds.height >= imageBounds.height && bounds.width == 200);
- treeItem.setImage(new Image[] {null, null});
+ treeItem.setImage(new Image[] {null, null});
bounds = treeItem.getBounds(0);
assertTrue(":3t:", bounds.x > 0 && bounds.height > 0 && bounds.width > 0 && bounds.width < 100);
bounds = treeItem.getBounds(1);
@@ -441,7 +441,7 @@ void getBoundsID() {
assertTrue(":4b:", /*bounds.x > 0 &&*/ bounds.height > 0 && bounds.width == 0); // TODO bounds.x == 0 Is this right?
bounds = treeItem2.getBounds(-1);
assertTrue(":4c:", bounds.equals(new Rectangle(0, 0, 0, 0)));
- bounds = treeItem2.getBounds(2);
+ bounds = treeItem2.getBounds(2);
assertTrue(":4d:", bounds.equals(new Rectangle(0, 0, 0, 0)));
// unexpanded item
TreeItem subItem2 = new TreeItem(treeItem2, SWT.NONE);
@@ -500,7 +500,7 @@ void getBoundsID() {
assertTrue(":4r:", bounds.x > 0 && bounds.height >= imageBounds.height && bounds.width > 0 && bounds.width < 100);
bounds = treeItem2.getBounds(1);
assertTrue(":4s:", bounds.x >= 100 && bounds.height >= imageBounds.height && bounds.width == 200);
- treeItem2.setImage(new Image[] {null, null});
+ treeItem2.setImage(new Image[] {null, null});
bounds = treeItem2.getBounds(0);
assertTrue(":4t:", bounds.x > 0 && bounds.height > 0 && bounds.width > 0 && bounds.width < 100);
bounds = treeItem2.getBounds(1);
@@ -583,7 +583,7 @@ public void test_getImageBoundsI() {
//assertTrue(":e:", bounds.width == 0);
assertEquals(new Rectangle(0, 0, 0, 0), treeItem2.getImageBounds(1));
- //
+ //
makeCleanEnvironment();
Image image = images[0];
@@ -626,12 +626,12 @@ public void test_getImageBoundsI() {
image = images[1];
// imageBounds = image.getBounds();
// imageWidth = imageBounds.width;
- treeItem2.setImage(0, image);
+ treeItem2.setImage(0, image);
// imageHeight = tree2.getItemHeight() - tree2.getGridLineWidth();
assertEquals(new Rectangle(0, 0, 0, 0), treeItem2.getImageBounds(-1));
- bounds = treeItem2.getImageBounds(0); // bounds.width should be check box width if check box is wider than image
+ bounds = treeItem2.getImageBounds(0); // bounds.width should be check box width if check box is wider than image
// assertTrue(":b:", bounds.x > 0 && bounds.width > 0 && bounds.height == imageHeight);
- assertEquals(new Rectangle(0, 0, 0, 0), treeItem2.getImageBounds(1));
+ assertEquals(new Rectangle(0, 0, 0, 0), treeItem2.getImageBounds(1));
}
@Test
@@ -957,12 +957,12 @@ public void test_setGrayedZ() {
@Test
public void test_setImage$Lorg_eclipse_swt_graphics_Image() {
assertNull(treeItem.getImage(1));
- treeItem.setImage(-1, null);
+ treeItem.setImage(-1, null);
assertNull(treeItem.getImage(-1));
treeItem.setImage(0, images[0]);
assertEquals(images[0], treeItem.getImage(0));
- String texts[] = new String[images.length];
+ String texts[] = new String[images.length];
for (int i = 0; i < texts.length; i++) {
texts[i] = String.valueOf(i);
}
@@ -980,7 +980,7 @@ public void test_setImage$Lorg_eclipse_swt_graphics_Image() {
}
treeItem.setImage(1, images[1]);
assertEquals(images[1], treeItem.getImage(1));
- treeItem.setImage(images);
+ treeItem.setImage(images);
for (int i = 0; i < images.length; i++) {
assertEquals(images[i], treeItem.getImage(i));
}
@@ -1045,10 +1045,10 @@ public void test_setText$Ljava_lang_String() {
catch (IllegalArgumentException e) {
}
- /*
- * Test the getText/setText API with a Tree that has only
- * the default column.
- */
+ /*
+ * Test the getText/setText API with a Tree that has only
+ * the default column.
+ */
assertEquals(0, treeItem.getText(1).length());
@@ -1059,10 +1059,10 @@ public void test_setText$Ljava_lang_String() {
}
- /*
- * Test the getText/setText API with a Tree that enough
- * columns to fit all test item texts.
- */
+ /*
+ * Test the getText/setText API with a Tree that enough
+ * columns to fit all test item texts.
+ */
int columnCount = tree.getColumnCount();
if (columnCount < images.length) {
@@ -1083,25 +1083,25 @@ public void test_setTextILjava_lang_String(){
final String TestString = "test";
final String TestStrings[] = new String[] {TestString, TestString + "1", TestString + "2"};
- /*
- * Test the getText/setText API with a Tree that has only
- * the default column.
- */
+ /*
+ * Test the getText/setText API with a Tree that has only
+ * the default column.
+ */
assertEquals(0, treeItem.getText(1).length());
- treeItem.setText(1, TestString);
+ treeItem.setText(1, TestString);
assertEquals(0, treeItem.getText(1).length());
assertEquals(0, treeItem.getText(0).length());
treeItem.setText(0, TestString);
assertEquals(TestString, treeItem.getText(0));
- treeItem.setText(-1, TestStrings[1]);
+ treeItem.setText(-1, TestStrings[1]);
assertEquals(0, treeItem.getText(-1).length());
- /*
- * Test the getText/setText API with a Tree that enough
- * columns to fit all test item texts.
- */
+ /*
+ * Test the getText/setText API with a Tree that enough
+ * columns to fit all test item texts.
+ */
makeCleanEnvironment();
@@ -1146,12 +1146,12 @@ public void test_setTextILjava_lang_String(){
}
/*
- * Test the getText/setText API with a small table that
- * will be extended by a column:
- * First the table has only one column and one row (TableItem) with text.
+ * Test the getText/setText API with a small table that
+ * will be extended by a column:
+ * First the table has only one column and one row (TableItem) with text.
* Then it is extended by one more column.
* After this the existing row gets one more text for the new column.
- */
+ */
makeCleanEnvironment();
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Widget.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Widget.java
index 53346acdab..4ad2b35a9b 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Widget.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Widget.java
@@ -177,55 +177,55 @@ protected void setWidget(Widget w) {
}
protected void hookListeners(Widget w, int[] types, Listener listener) {
- for (int i = 0; i < types.length; i++) {
- w.addListener(types[i], listener);
- }
+ for (int i = 0; i < types.length; i++) {
+ w.addListener(types[i], listener);
+ }
}
protected String[] hookExpectedEvents(String type, final java.util.List<String> events) {
- return hookExpectedEvents(widget, type, events);
+ return hookExpectedEvents(widget, type, events);
}
protected String[] hookExpectedEvents(Widget w, String type, final java.util.List<String> events) {
- String[] expectedEvents = ConsistencyUtility.eventOrdering.get(type);
- hookExpectedEvents(w, expectedEvents, events);
- return expectedEvents;
+ String[] expectedEvents = ConsistencyUtility.eventOrdering.get(type);
+ hookExpectedEvents(w, expectedEvents, events);
+ return expectedEvents;
}
protected void hookExpectedEvents(Widget w, String[] types, final java.util.List<String> events) {
- hookListeners(w, ConsistencyUtility.convertEventNames(types),
- e -> {
- String temp = ConsistencyUtility.eventNames[e.type];
- if(e.type == SWT.Traverse)
- temp += ":"+ConsistencyUtility.getTraversalType(e.detail);
- else if(e.type == SWT.Selection)
- temp += ":"+ConsistencyUtility.getSelectionType(e.detail);
- events.add(temp);
- System.out.println(temp + e.widget);
+ hookListeners(w, ConsistencyUtility.convertEventNames(types),
+ e -> {
+ String temp = ConsistencyUtility.eventNames[e.type];
+ if(e.type == SWT.Traverse)
+ temp += ":"+ConsistencyUtility.getTraversalType(e.detail);
+ else if(e.type == SWT.Selection)
+ temp += ":"+ConsistencyUtility.getSelectionType(e.detail);
+ events.add(temp);
+ System.out.println(temp + e.widget);
});
}
protected String getTestName() {
- String test = name.getMethodName();
- int index = test.lastIndexOf('_');
- if(index != -1)
- test = test.substring(index+1, test.length());
- String clss = getClassName();
- if((!test.equals("MenuDetect") || clss.equals("Table") || test.startsWith("Chevron")) &&
- (!test.equals("DragDetect") || clss.equals("Tree") || test.startsWith("Chevron")) &&
- (!test.equals("DoubleClick") || clss.equals("List")) &&
- (!test.equals("KeySelection") || clss.equals("Slider") || clss.equals("Combo") || clss.equals("CCombo") || clss.equals("CTabFolder")) &&
- (!test.equals("EnterSelection") || clss.equals("Button") || clss.equals("ToolBar") || clss.equals("CCombo") || clss.equals("ExpandBar")))
- test = clss + test;
- return test;
+ String test = name.getMethodName();
+ int index = test.lastIndexOf('_');
+ if(index != -1)
+ test = test.substring(index+1, test.length());
+ String clss = getClassName();
+ if((!test.equals("MenuDetect") || clss.equals("Table") || test.startsWith("Chevron")) &&
+ (!test.equals("DragDetect") || clss.equals("Tree") || test.startsWith("Chevron")) &&
+ (!test.equals("DoubleClick") || clss.equals("List")) &&
+ (!test.equals("KeySelection") || clss.equals("Slider") || clss.equals("Combo") || clss.equals("CCombo") || clss.equals("CTabFolder")) &&
+ (!test.equals("EnterSelection") || clss.equals("Button") || clss.equals("ToolBar") || clss.equals("CCombo") || clss.equals("ExpandBar")))
+ test = clss + test;
+ return test;
}
protected String getClassName() {
- String clazz = getClass().getName();
- int index = clazz.lastIndexOf('_');
- if(index != -1)
- clazz = clazz.substring(index+1, clazz.length());
- return clazz;
+ String clazz = getClass().getName();
+ int index = clazz.lastIndexOf('_');
+ if(index != -1)
+ clazz = clazz.substring(index+1, clazz.length());
+ return clazz;
}
protected void processEvents(int timeoutMs, BooleanSupplier condition) throws InterruptedException {
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/performance/Test_situational.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/performance/Test_situational.java
index e73315e293..e7be963c46 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/performance/Test_situational.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/performance/Test_situational.java
@@ -84,7 +84,7 @@ public void test_createComposites() {
PerformanceMeter meter = createMeter("Create composites");
int samples;
- Performance.getDefault();
+ Performance.getDefault();
// Warm up.
for(samples = 0; samples < 2; samples++) {
@@ -119,8 +119,8 @@ public void test_createWidgets() {
PerformanceMeter meter = createMeter("Create composites and widgets");
int samples;
- Performance performance = Performance.getDefault();
- performance.tagAsGlobalSummary(meter, "Create composites and widgets", Dimension.ELAPSED_PROCESS);
+ Performance performance = Performance.getDefault();
+ performance.tagAsGlobalSummary(meter, "Create composites and widgets", Dimension.ELAPSED_PROCESS);
for(samples = 0; samples < 10; samples++) {
Shell shell = new Shell(display);

Back to the top