Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.swt/.classpath_motif_j2me44
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT AWT/win32/org/eclipse/swt/internal/awt/win32/SWT_AWT.java302
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/ACC.java120
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleAdapter.java242
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleControlAdapter.java488
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleControlEvent.java96
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleControlListener.java452
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleEvent.java92
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleListener.java238
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Accessibility/emulated/org/eclipse/swt/accessibility/Accessible.java362
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java2320
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/AnimatedProgress.java424
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/BidiSegmentEvent.java132
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/BidiSegmentListener.java58
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/BusyIndicator.java152
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java2352
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CLabel.java1216
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java4198
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderAdapter.java16
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderEvent.java32
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderListener.java16
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabItem.java1028
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ControlEditor.java476
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/DefaultContent.java1750
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/DefaultLineStyler.java1354
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ExtendedModifyEvent.java42
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ExtendedModifyListener.java40
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/LineBackgroundEvent.java48
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/LineBackgroundListener.java38
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/LineStyleEvent.java42
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/LineStyleListener.java36
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/PopupList.java494
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ST.java118
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/SashForm.java892
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ScrolledComposite.java1160
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StackLayout.java222
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyleRange.java302
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java16526
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextBidi.java2106
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextContent.java396
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextEvent.java62
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextListener.java140
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TableCursor.java1022
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TableEditor.java380
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TableTree.java1478
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TableTreeEditor.java454
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TableTreeItem.java1600
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TextChangeListener.java108
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TextChangedEvent.java44
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TextChangingEvent.java118
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TreeEditor.java318
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/VerifyKeyListener.java32
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ViewForm.java1222
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/WrappedContent.java1326
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common/org/eclipse/swt/dnd/DND.java452
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common/org/eclipse/swt/dnd/DNDEvent.java30
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common/org/eclipse/swt/dnd/DNDListener.java154
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common/org/eclipse/swt/dnd/DragSourceAdapter.java66
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common/org/eclipse/swt/dnd/DragSourceEvent.java126
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common/org/eclipse/swt/dnd/DragSourceListener.java146
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common/org/eclipse/swt/dnd/DragUnderEffect.java20
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common/org/eclipse/swt/dnd/DropTargetAdapter.java118
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common/org/eclipse/swt/dnd/DropTargetEvent.java210
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common/org/eclipse/swt/dnd/DropTargetListener.java486
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common/org/eclipse/swt/dnd/NoDragUnderEffect.java24
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/motif/org/eclipse/swt/dnd/ByteArrayTransfer.java348
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/motif/org/eclipse/swt/dnd/Clipboard.java652
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/motif/org/eclipse/swt/dnd/DragSource.java1044
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/motif/org/eclipse/swt/dnd/DropTarget.java1610
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/motif/org/eclipse/swt/dnd/FileTransfer.java216
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/motif/org/eclipse/swt/dnd/RTFTransfer.java156
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/motif/org/eclipse/swt/dnd/TableDragUnderEffect.java200
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/motif/org/eclipse/swt/dnd/TextTransfer.java254
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/motif/org/eclipse/swt/dnd/Transfer.java248
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/motif/org/eclipse/swt/dnd/TransferData.java114
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/motif/org/eclipse/swt/dnd/TreeDragUnderEffect.java426
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/ByteArrayTransfer.java352
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/Clipboard.java566
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/DragSource.java516
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/DropTarget.java514
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/FileTransfer.java216
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/RTFTransfer.java154
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/TableDragUnderEffect.java122
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/TextTransfer.java154
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/Transfer.java236
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/TransferData.java94
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/TreeDragUnderEffect.java200
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/ByteArrayTransfer.java448
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/Clipboard.java1000
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/DragSource.java1038
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/DropTarget.java1320
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/FileTransfer.java314
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/OleEnumFORMATETC.java306
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/RTFTransfer.java256
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/TableDragUnderEffect.java230
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/TextTransfer.java240
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/Transfer.java254
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/TransferData.java116
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/TreeDragUnderEffect.java422
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/internal/ole/win32/COMObject.java2046
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OLE.java854
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleAutomation.java1192
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleClientSite.java2672
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleControlSite.java1616
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleEvent.java30
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleEventSink.java348
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleEventTable.java136
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleFile.java250
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleFrame.java1372
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleFunctionDescription.java40
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleListener.java30
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleParameterDescription.java20
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OlePropertyChangeSink.java368
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OlePropertyDescription.java28
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/Variant.java1476
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/common_j2me/org/eclipse/swt/internal/Library.java124
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/common_j2se/org/eclipse/swt/internal/Library.java224
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkColor.java42
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkEventExpose.java52
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkGCValues.java82
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkImage.java56
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkRectangle.java42
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkVisual.java60
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkAdjustment.java44
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkAllocation.java42
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkRequisition.java38
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/GdkColor.java46
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/GdkEvent.java44
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/GdkEventButton.java60
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/GdkEventExpose.java46
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/GdkEventKey.java46
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/GdkEventMotion.java60
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/GdkFont.java44
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/GdkGCValues.java86
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/GdkRectangle.java46
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/GdkVisual.java66
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/GtkAdjustment.java50
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/GtkAllocation.java46
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/GtkBox.java44
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/GtkCListColumn.java68
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/GtkCListRow.java70
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/GtkCTreeRow.java58
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/GtkCheckMenuItem.java42
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/GtkColorSelectionDialog.java50
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/GtkFileSelection.java78
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/GtkFontSelectionDialog.java54
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/GtkHBox.java38
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/GtkItem.java38
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/GtkMenuItem.java58
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/GtkRequisition.java42
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/GtkStyleClass.java40
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk1x/org/eclipse/swt/internal/gtk/GtkText.java50
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/GNOME.java32
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/KDE.java112
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/OS.java2878
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/Visual.java30
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/XAnyEvent.java20
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/XButtonEvent.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/XCharStruct.java30
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/XColor.java26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/XConfigureEvent.java30
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/XCrossingEvent.java36
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/XEvent.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/XExposeEvent.java26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/XFocusChangeEvent.java34
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/XFontStruct.java70
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/XGCValues.java64
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/XImage.java48
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/XInputEvent.java18
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/XKeyEvent.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/XMotionEvent.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/XRectangle.java26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/XSetWindowAttributes.java48
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/XWindowAttributes.java60
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/XWindowChanges.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/XWindowEvent.java26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/XmAnyCallbackStruct.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/XmDragProcCallback.java40
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/XmDropFinishCallback.java36
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/XmDropProcCallback.java40
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/XmTextBlockRec.java24
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/XmTextVerifyCallbackStruct.java30
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/XtWidgetGeometry.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/swt.c268
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/FontDetails.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/FontQueryInfo.java36
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/OS.java5956
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PgAlpha_t.java44
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PgDisplaySettings_t.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PgMap_t.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PgVideoModeInfo_t.java40
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PhArea_t.java24
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PhClipHeader.java48
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PhCursorDef_t.java70
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PhCursorInfo_t.java72
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PhDim_t.java20
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PhEvent_t.java50
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PhImage_t.java52
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PhKeyEvent_t.java36
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PhPoint_t.java20
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PhPointerEvent_t.java36
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PhRect_t.java24
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PhRegion_t.java60
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PhTile_t.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PhWindowEvent_t.java40
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PtCallbackInfo_t.java24
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PtColorSelectInfo_t.java50
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PtContainerCallback_t.java40
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PtFileSelectionInfo_t.java46
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PtScrollbarCallback_t.java20
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/PtTextCallback_t.java32
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/build-ce.bat122
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/build.bat52
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/defines.h42
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/make_win32.mak112
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/make_wince.mak214
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/structs.c10026
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/structs.h1634
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/swt.c14640
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/CAUUID.java24
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/COM.java1334
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/CONTROLINFO.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/COSERVERINFO.java26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/DISPPARAMS.java30
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/DVTARGETDEVICE.java32
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/EXCEPINFO.java38
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/FORMATETC.java30
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/FUNCDESC1.java56
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/FUNCDESC2.java56
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/GUID.java42
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IAccessible.java154
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IClassFactory2.java40
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IConnectionPoint.java34
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IConnectionPointContainer.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IDataObject.java72
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IDispatch.java118
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IEnum.java46
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IEnumFORMATETC.java20
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IEnumSTATSTG.java20
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IFont.java26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IMoniker.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IOleCommandTarget.java58
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IOleControl.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IOleInPlaceActiveObject.java40
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IOleInPlaceObject.java50
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IOleLink.java34
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IOleObject.java106
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IOleWindow.java26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IPersist.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IPersistStorage.java58
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IProvideClassInfo.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IProvideClassInfo2.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/ISpecifyPropertyPages.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IStorage.java284
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IStream.java56
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/ITypeInfo.java306
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IUnknown.java48
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/IViewObject2.java38
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/LICINFO.java26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/OLECMD.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/OLECMDTEXT.java30
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/OLEINPLACEFRAMEINFO.java34
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/STATSTG.java74
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/STGMEDIUM.java26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/TYPEATTR.java92
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/VARDESC1.java42
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/ole/win32/VARDESC2.java42
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/ACCEL.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/BITMAP.java30
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/BROWSEINFO.java32
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/CHOOSECOLOR.java34
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/CHOOSEFONT.java46
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/COMPOSITIONFORM.java26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/CREATESTRUCT.java40
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/DIBSECTION.java48
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/DLLVERSIONINFO.java26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/DOCINFO.java24
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/DRAWITEMSTRUCT.java36
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/DROPFILES.java38
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/FILETIME.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/GCP_RESULTS.java36
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/GRADIENT_RECT.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/HDITEM.java34
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/HELPINFO.java32
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/ICONINFO.java26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/INITCOMMONCONTROLSEX.java20
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/LOGBRUSH.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/LOGFONT.java62
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/LOGPEN.java26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/LRESULT.java26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/LVCOLUMN.java32
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/LVHITTESTINFO.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/LVITEM.java36
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/MEASUREITEMSTRUCT.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/MENUINFO.java30
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/MENUITEMINFO.java62
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/MSG.java30
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/NMHDR.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/NMHEADER.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/NMLISTVIEW.java32
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/NMTOOLBAR.java42
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/NMTTDISPINFO.java32
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/NONCLIENTMETRICS.java60
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OPENFILENAME.java56
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java4856
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OSVERSIONINFO.java36
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/PAINTSTRUCT.java32
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/POINT.java20
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/PRINTDLG.java52
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/REBARBANDINFO.java58
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/RECT.java24
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/SCROLLINFO.java30
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/SHELLEXECUTEINFO.java64
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/SHMENUBARINFO.java30
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/SIZE.java20
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/TBBUTTON.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/TBBUTTONINFO.java36
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/TCHAR.java216
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/TCITEM.java30
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/TEXTMETRIC.java64
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/TOOLINFO.java34
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/TRACKMOUSEEVENT.java26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/TRIVERTEX.java30
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/TVHITTESTINFO.java26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/TVINSERTSTRUCT.java42
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/TVITEM.java36
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/WINDOWPLACEMENT.java44
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/WINDOWPOS.java30
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/WNDCLASS.java36
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Printing/common/org/eclipse/swt/printing/PrinterData.java316
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/PrintDialog.java358
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java176
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Printing/gtk1x/org/eclipse/swt/printing/PrintDialog.java112
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Printing/gtk1x/org/eclipse/swt/printing/Printer.java182
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Printing/motif/org/eclipse/swt/printing/PrintDialog.java358
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Printing/photon/org/eclipse/swt/printing/PrintDialog.java358
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Printing/photon/org/eclipse/swt/printing/Printer.java178
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Printing/win32/org/eclipse/swt/printing/PrintDialog.java586
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Printing/win32/org/eclipse/swt/printing/Printer.java1020
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Program/photon/org/eclipse/swt/program/Program.java614
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Program/win32/org/eclipse/swt/program/Program.java648
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/library/swt.h24
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java4756
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWTError.java220
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWTException.java206
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/ArmEvent.java56
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/ArmListener.java62
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/ControlAdapter.java78
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/ControlEvent.java60
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/ControlListener.java82
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/DisposeEvent.java58
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/DisposeListener.java64
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/FocusAdapter.java76
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/FocusEvent.java58
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/FocusListener.java82
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/HelpEvent.java58
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/HelpListener.java66
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/KeyAdapter.java76
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/KeyEvent.java118
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/KeyListener.java80
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/MenuAdapter.java76
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/MenuEvent.java58
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/MenuListener.java78
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/ModifyEvent.java58
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/ModifyListener.java62
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/MouseAdapter.java102
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/MouseEvent.java134
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/MouseListener.java100
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/MouseMoveListener.java62
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/MouseTrackAdapter.java104
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/MouseTrackListener.java102
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/PaintEvent.java150
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/PaintListener.java64
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/SelectionAdapter.java76
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/SelectionEvent.java192
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/SelectionListener.java98
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/ShellAdapter.java130
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/ShellEvent.java58
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/ShellListener.java120
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/TraverseEvent.java238
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/TraverseListener.java76
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/TreeAdapter.java76
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/TreeEvent.java58
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/TreeListener.java80
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/TypedEvent.java136
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/VerifyEvent.java108
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/VerifyListener.java76
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/Drawable.java86
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageData.java7094
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageLoader.java580
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageLoaderEvent.java152
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageLoaderListener.java74
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/PaletteData.java408
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/Point.java184
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/RGB.java214
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/Rectangle.java544
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/Callback.java372
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/FileFormat.java214
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/GIFFileFormat.java1048
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/JPEGAppn.java42
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/JPEGArithmeticConditioningTable.java32
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/JPEGComment.java40
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/JPEGEndOfImage.java48
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/JPEGFileFormat.java3778
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/JPEGFixedSizeSegment.java74
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/JPEGFrameHeader.java414
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/JPEGHuffmanTable.java522
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/JPEGQuantizationTable.java316
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/JPEGRestartInterval.java48
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/JPEGScanHeader.java232
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/JPEGSegment.java102
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/JPEGStartOfImage.java56
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/JPEGVariableSizeSegment.java62
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/LEDataInputStream.java354
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/LEDataOutputStream.java100
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/LZWCodec.java950
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/LZWNode.java20
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PNGFileFormat.java1060
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngChunk.java664
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngChunkReader.java124
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngDecodingDataStream.java256
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngFileReadState.java36
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngHuffmanTable.java240
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngHuffmanTables.java308
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngIdatChunk.java68
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngIendChunk.java74
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngIhdrChunk.java742
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngLzBlockReader.java330
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngPlteChunk.java172
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/PngTrnsChunk.java262
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/WinBMPFileFormat.java1324
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/WinICOFileFormat.java562
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/FillLayout.java216
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/FormAttachment.java516
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/FormLayout.java10
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/GridData.java384
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/GridLayout.java1376
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/RowData.java100
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/RowLayout.java588
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/Dialog.java500
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/Event.java410
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/EventTable.java254
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/Item.java348
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/Layout.java160
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/Listener.java88
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/RunnableLock.java64
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/Synchronizer.java310
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/TypedListener.java442
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/common/version.txt2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common_j2me/org/eclipse/swt/internal/CloneableCompatibility.java46
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common_j2me/org/eclipse/swt/internal/Compatibility.java778
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common_j2me/org/eclipse/swt/internal/SWTEventListener.java38
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common_j2me/org/eclipse/swt/internal/SWTEventObject.java106
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common_j2me/org/eclipse/swt/internal/SerializableCompatibility.java48
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/CloneableCompatibility.java38
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/Compatibility.java600
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTEventListener.java42
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTEventObject.java60
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SWTMessages.properties82
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/SerializableCompatibility.java44
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/emulated/bidi/org/eclipse/swt/internal/BidiUtil.java164
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/emulated/coolbar/org/eclipse/swt/widgets/CoolBar.java2104
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/emulated/coolbar/org/eclipse/swt/widgets/CoolItem.java1234
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/emulated/tabfolder/org/eclipse/swt/widgets/TabFolder.java2222
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/emulated/tabfolder/org/eclipse/swt/widgets/TabItem.java772
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/emulated/treetable/org/eclipse/swt/widgets/AbstractTreeItem.java620
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/emulated/treetable/org/eclipse/swt/widgets/SelectableItem.java630
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/emulated/treetable/org/eclipse/swt/widgets/SelectableItemWidget.java4126
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/emulated/treetable/org/eclipse/swt/widgets/Table.java5396
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/emulated/treetable/org/eclipse/swt/widgets/TableColumn.java1012
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/emulated/treetable/org/eclipse/swt/widgets/TableItem.java2400
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/emulated/treetable/org/eclipse/swt/widgets/Tree.java3308
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/emulated/treetable/org/eclipse/swt/widgets/TreeItem.java2710
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/emulated/treetable/org/eclipse/swt/widgets/TreeRoots.java312
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Color.java250
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Cursor.java266
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java366
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Font.java200
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/FontData.java488
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/FontMetrics.java92
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java1712
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GCData.java62
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java744
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Region.java528
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/internal/Converter.java100
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java410
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java204
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Caret.java456
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ColorDialog.java276
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java1046
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java288
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java2136
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Decorations.java1074
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java350
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java1074
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FileDialog.java582
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FontDialog.java336
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java150
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java264
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java1212
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java790
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java866
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java940
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java258
-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/Tracker.java710
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java544
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/WidgetTable.java200
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/graphics/DefaultGtkStyle.java230
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/graphics/FontData.java868
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/graphics/FontMetrics.java104
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/graphics/GCData.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/graphics/Region.java210
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/internal/Converter.java112
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/ColorDialog.java164
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/Decorations.java322
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/DirectoryDialog.java100
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/FileDialog.java136
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/FontDialog.java162
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/Menu.java522
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/MenuItem.java702
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/TabFolder.java870
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/TabItem.java184
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/TableColumn.java408
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/TableItem.java740
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/ToolBar.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/Tracker.java778
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/TreeItem.java824
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/WidgetTable.java176
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/Color.java386
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/Cursor.java320
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/Device.java922
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/DeviceData.java44
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/Font.java734
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/FontData.java668
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/FontMetrics.java108
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/GC.java3320
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/GCData.java42
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/Image.java1930
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/Region.java180
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/internal/Converter.java610
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Button.java1260
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Canvas.java432
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Caret.java868
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/ColorDialog.java822
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Combo.java2746
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Composite.java1294
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Control.java5450
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Decorations.java1122
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/DirectoryDialog.java556
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Display.java4454
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/FileDialog.java886
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/FontDialog.java1852
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Group.java540
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Label.java818
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/List.java2862
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Menu.java1380
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/MenuItem.java1524
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/MessageBox.java750
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/ProgressBar.java702
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Sash.java718
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Scale.java586
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/ScrollBar.java1184
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Scrollable.java580
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Shell.java2504
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Slider.java976
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Text.java2612
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/ToolBar.java768
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/ToolDrawable.java72
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/ToolItem.java1976
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Tracker.java1134
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Widget.java2120
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/WidgetTable.java240
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/Color.java202
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/Cursor.java372
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/Device.java568
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/DeviceData.java30
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/Font.java308
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/FontData.java422
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/FontMetrics.java152
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/GC.java3430
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/GCData.java42
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/Image.java1326
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/Region.java298
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/internal/Converter.java92
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Button.java884
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Canvas.java220
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Caret.java526
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/ColorDialog.java106
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Combo.java1348
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Composite.java1248
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Control.java2988
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Decorations.java440
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/DirectoryDialog.java122
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Display.java2778
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/FileDialog.java258
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/FontDialog.java168
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Group.java252
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Label.java610
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/List.java1180
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Menu.java768
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/MenuItem.java1046
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/MessageBox.java222
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/ProgressBar.java242
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Sash.java632
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Scale.java328
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/ScrollBar.java654
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Scrollable.java248
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Shell.java1678
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Slider.java444
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/TabFolder.java890
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/TabItem.java264
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Text.java1460
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/ToolBar.java606
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/ToolItem.java1106
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Tracker.java1210
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Widget.java1580
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/WidgetTable.java212
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Color.java654
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Cursor.java802
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Device.java1420
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/DeviceData.java30
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Font.java506
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/FontData.java1380
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/FontMetrics.java340
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java4604
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GCData.java60
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java3798
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Region.java608
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/BidiUtil.java1056
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/Converter.java366
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Button.java1418
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Canvas.java426
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Caret.java1104
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ColorDialog.java390
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Combo.java2916
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java1654
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java8440
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/CoolBar.java1996
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/CoolItem.java1324
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Decorations.java2722
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/DirectoryDialog.java478
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java4660
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FileDialog.java816
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FontDialog.java468
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Group.java740
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ImageList.java502
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Label.java1160
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/List.java3074
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Menu.java2394
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MenuItem.java1946
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MessageBox.java498
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ProgressBar.java552
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Sash.java802
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scale.java826
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ScrollBar.java2002
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scrollable.java752
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java2718
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Slider.java1592
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TabFolder.java1578
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TabItem.java628
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java5018
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TableColumn.java952
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TableItem.java1416
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java3504
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ToolBar.java1850
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ToolItem.java1656
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tracker.java1446
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java3808
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeItem.java1362
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java2108
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/WidgetTable.java224
-rw-r--r--bundles/org.eclipse.swt/build.properties2
-rw-r--r--bundles/org.eclipse.swt/build.xml74
-rwxr-xr-xbundles/org.eclipse.swt/buildnotes_swt.html4544
-rw-r--r--bundles/org.eclipse.swt/plugin.properties2
-rwxr-xr-xbundles/org.eclipse.swt/plugin.xml32
-rwxr-xr-xbundles/org.eclipse.swt/readme_swt.html232
678 files changed, 205790 insertions, 205790 deletions
diff --git a/bundles/org.eclipse.swt/.classpath_motif_j2me b/bundles/org.eclipse.swt/.classpath_motif_j2me
index 2baed49c5d..5da30731c7 100644
--- a/bundles/org.eclipse.swt/.classpath_motif_j2me
+++ b/bundles/org.eclipse.swt/.classpath_motif_j2me
@@ -1,23 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="var" path="JRE_LIB"/>
- <classpathentry kind="src" path="Eclipse SWT/motif"/>
- <classpathentry kind="src" path="Eclipse SWT/emulated/bidi"/>
- <classpathentry kind="src" path="Eclipse SWT/emulated/coolbar"/>
- <classpathentry kind="src" path="Eclipse SWT/emulated/tabfolder"/>
- <classpathentry kind="src" path="Eclipse SWT/emulated/treetable"/>
- <classpathentry kind="src" path="Eclipse SWT/common"/>
- <classpathentry kind="src" path="Eclipse SWT/common_j2me"/>
- <classpathentry kind="src" path="Eclipse SWT PI/motif"/>
- <classpathentry kind="src" path="Eclipse SWT PI/common_j2me"/>
- <classpathentry kind="src" path="Eclipse SWT Accessibility/emulated"/>
- <classpathentry kind="src" path="Eclipse SWT Accessibility/common"/>
- <classpathentry kind="src" path="Eclipse SWT Drag and Drop/motif"/>
- <classpathentry kind="src" path="Eclipse SWT Drag and Drop/common"/>
- <classpathentry kind="src" path="Eclipse SWT Printing/motif"/>
- <classpathentry kind="src" path="Eclipse SWT Printing/common"/>
- <classpathentry kind="src" path="Eclipse SWT Program/motif"/>
- <classpathentry kind="src" path="Eclipse SWT Program/common"/>
- <classpathentry kind="src" path="Eclipse SWT Custom Widgets/common"/>
- <classpathentry kind="output" path="bin"/>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="var" path="JRE_LIB"/>
+ <classpathentry kind="src" path="Eclipse SWT/motif"/>
+ <classpathentry kind="src" path="Eclipse SWT/emulated/bidi"/>
+ <classpathentry kind="src" path="Eclipse SWT/emulated/coolbar"/>
+ <classpathentry kind="src" path="Eclipse SWT/emulated/tabfolder"/>
+ <classpathentry kind="src" path="Eclipse SWT/emulated/treetable"/>
+ <classpathentry kind="src" path="Eclipse SWT/common"/>
+ <classpathentry kind="src" path="Eclipse SWT/common_j2me"/>
+ <classpathentry kind="src" path="Eclipse SWT PI/motif"/>
+ <classpathentry kind="src" path="Eclipse SWT PI/common_j2me"/>
+ <classpathentry kind="src" path="Eclipse SWT Accessibility/emulated"/>
+ <classpathentry kind="src" path="Eclipse SWT Accessibility/common"/>
+ <classpathentry kind="src" path="Eclipse SWT Drag and Drop/motif"/>
+ <classpathentry kind="src" path="Eclipse SWT Drag and Drop/common"/>
+ <classpathentry kind="src" path="Eclipse SWT Printing/motif"/>
+ <classpathentry kind="src" path="Eclipse SWT Printing/common"/>
+ <classpathentry kind="src" path="Eclipse SWT Program/motif"/>
+ <classpathentry kind="src" path="Eclipse SWT Program/common"/>
+ <classpathentry kind="src" path="Eclipse SWT Custom Widgets/common"/>
+ <classpathentry kind="output" path="bin"/>
</classpath> \ No newline at end of file
diff --git a/bundles/org.eclipse.swt/Eclipse SWT AWT/win32/org/eclipse/swt/internal/awt/win32/SWT_AWT.java b/bundles/org.eclipse.swt/Eclipse SWT AWT/win32/org/eclipse/swt/internal/awt/win32/SWT_AWT.java
index d46ee966f4..47a962cca6 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT AWT/win32/org/eclipse/swt/internal/awt/win32/SWT_AWT.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT AWT/win32/org/eclipse/swt/internal/awt/win32/SWT_AWT.java
@@ -1,155 +1,155 @@
-package org.eclipse.swt.internal.awt.win32;
-
-/*
+package org.eclipse.swt.internal.awt.win32;
+
+/*
* Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
* This file is made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- */
-
-import java.lang.reflect.Method;
-import java.lang.reflect.Constructor;
-
-/* Win32, SUN AWT */
-import sun.awt.windows.WEmbeddedFrame;
-//import sun.awt.DrawingSurface;
-//import sun.awt.windows.WDrawingSurfaceInfo;
-
-/* SWT Imports */
-import org.eclipse.swt.*;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.graphics.Rectangle;
-
-/* AWT Imports */
-import java.awt.Canvas;
-import java.awt.Panel;
-import java.awt.Dimension;
-import java.awt.event.ComponentAdapter;
-import java.awt.event.ComponentEvent;
-import java.awt.event.WindowEvent;
-import java.awt.event.FocusEvent;
-
-public class SWT_AWT {
-
-public static Panel new_Panel (final Composite parent) {
- int handle = parent.handle;
- /*
- * Some JREs have implemented the WEmbeddedFrame constructor to take an integer
- * value for the HWND parameter and other JREs take a long for the HWND parameter.
- * To handle this binary incompatability, we use reflection to perform the equivalent of
- * the following line of code:
- *
- * final WEmbeddedFrame frame = new WEmbeddedFrame(handle);
- */
- Constructor constructor = null;
- try {
- constructor = WEmbeddedFrame.class.getConstructor (new Class [] {int.class});
- } catch (Exception e1) {
- try {
- constructor = WEmbeddedFrame.class.getConstructor (new Class [] {long.class});
- } catch (Exception e2) {
- SWT.error (SWT.ERROR_NOT_IMPLEMENTED, e2);
- }
- }
- WEmbeddedFrame value = null;
- try {
- value = (WEmbeddedFrame) constructor.newInstance (new Object [] {new Integer (handle)});
- } catch (Exception e) {
- SWT.error (SWT.ERROR_NOT_IMPLEMENTED, e);
- }
- final WEmbeddedFrame frame = value;
-
- Panel panel = new Panel ();
- frame.add (panel);
- parent.addListener (SWT.Activate, new Listener () {
- public void handleEvent (Event e) {
- frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_ACTIVATED));
- frame.dispatchEvent (new FocusEvent (frame, FocusEvent.FOCUS_GAINED));
- }
- });
- parent.addListener (SWT.Deactivate, new Listener () {
- public void handleEvent (Event e) {
- frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_DEACTIVATED));
- frame.dispatchEvent (new FocusEvent (frame, FocusEvent.FOCUS_LOST));
- }
- });
- parent.getShell ().addListener (SWT.Move, new Listener () {
- public void handleEvent (Event e) {
- final Rectangle rect = parent.getClientArea ();
- frame.getToolkit ().getSystemEventQueue ().invokeLater(new Runnable () {
- public void run () {
- frame.dispatchEvent (new ComponentEvent (frame, ComponentEvent.COMPONENT_MOVED));
- }
- });
- }
- });
- parent.addListener (SWT.Resize, new Listener () {
- public void handleEvent (Event e) {
- final Rectangle rect = parent.getClientArea ();
- frame.getToolkit ().getSystemEventQueue ().invokeLater(new Runnable () {
- public void run () {
- frame.setSize (rect.width, rect.height);
- frame.validate ();
- }
- });
- }
- });
- parent.addListener (SWT.Dispose, new Listener () {
- public void handleEvent (Event event) {
- parent.setVisible(false);
- frame.dispose ();
- }
- });
- return panel;
-}
-
-public static Shell new_Shell (Display display, final Canvas parent) {
- /*
- * As of JDK 1.4, the DrawingSurface and WDrawingSurfaceInfo no longer exist
- * so that code that references these classes no longer compiles. The fix is
- * to use refection to invoke equivalent code that is commented below. There
- * is no fix at this time for the missing WDrawingSurfaceInfo functionality.
- */
-// DrawingSurface ds = (DrawingSurface)parent.getPeer();
-// WDrawingSurfaceInfo wds = (WDrawingSurfaceInfo)ds.getDrawingSurfaceInfo();
-// wds.lock ();
-// int handle = (int) wds.getHWnd ();
-// wds.unlock ();
- Integer hwnd = null;
- try {
- Object ds = parent.getPeer ();
- Class drawingSurfaceClass = Class.forName ("sun.awt.DrawingSurface"); //$NON-NLS-1$
- Method method = drawingSurfaceClass.getDeclaredMethod ("getDrawingSurfaceInfo", null); //$NON-NLS-1$
- Object wds = method.invoke (ds, null);
- Class wDrawingSurfaceClass = Class.forName ("sun.awt.windows.WDrawingSurfaceInfo"); //$NON-NLS-1$
- method = wDrawingSurfaceClass.getMethod ("lock", null); //$NON-NLS-1$
- method.invoke (wds, null);
- method = wDrawingSurfaceClass.getMethod ("getHWnd", null); //$NON-NLS-1$
- hwnd = (Integer) method.invoke (wds, null);
- method = wDrawingSurfaceClass.getMethod ("unlock", null); //$NON-NLS-1$
- method.invoke (wds, null);
- } catch (Exception e) {
- SWT.error (SWT.ERROR_NOT_IMPLEMENTED, e);
- }
- int handle = hwnd.intValue();
-
- final Shell shell = Shell.win32_new (display, handle);
- final Display newDisplay = shell.getDisplay ();
- parent.addComponentListener(new ComponentAdapter () {
- public void componentResized (ComponentEvent e) {
- newDisplay.syncExec (new Runnable () {
- public void run () {
- Dimension dim = parent.getSize ();
- shell.setSize (dim.width, dim.height);
- }
- });
- }
- });
- shell.setVisible (true);
- return shell;
-}
+ * http://www.eclipse.org/legal/cpl-v10.html
+ */
+
+import java.lang.reflect.Method;
+import java.lang.reflect.Constructor;
+
+/* Win32, SUN AWT */
+import sun.awt.windows.WEmbeddedFrame;
+//import sun.awt.DrawingSurface;
+//import sun.awt.windows.WDrawingSurfaceInfo;
+
+/* SWT Imports */
+import org.eclipse.swt.*;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.graphics.Rectangle;
+
+/* AWT Imports */
+import java.awt.Canvas;
+import java.awt.Panel;
+import java.awt.Dimension;
+import java.awt.event.ComponentAdapter;
+import java.awt.event.ComponentEvent;
+import java.awt.event.WindowEvent;
+import java.awt.event.FocusEvent;
+
+public class SWT_AWT {
+
+public static Panel new_Panel (final Composite parent) {
+ int handle = parent.handle;
+ /*
+ * Some JREs have implemented the WEmbeddedFrame constructor to take an integer
+ * value for the HWND parameter and other JREs take a long for the HWND parameter.
+ * To handle this binary incompatability, we use reflection to perform the equivalent of
+ * the following line of code:
+ *
+ * final WEmbeddedFrame frame = new WEmbeddedFrame(handle);
+ */
+ Constructor constructor = null;
+ try {
+ constructor = WEmbeddedFrame.class.getConstructor (new Class [] {int.class});
+ } catch (Exception e1) {
+ try {
+ constructor = WEmbeddedFrame.class.getConstructor (new Class [] {long.class});
+ } catch (Exception e2) {
+ SWT.error (SWT.ERROR_NOT_IMPLEMENTED, e2);
+ }
+ }
+ WEmbeddedFrame value = null;
+ try {
+ value = (WEmbeddedFrame) constructor.newInstance (new Object [] {new Integer (handle)});
+ } catch (Exception e) {
+ SWT.error (SWT.ERROR_NOT_IMPLEMENTED, e);
+ }
+ final WEmbeddedFrame frame = value;
+
+ Panel panel = new Panel ();
+ frame.add (panel);
+ parent.addListener (SWT.Activate, new Listener () {
+ public void handleEvent (Event e) {
+ frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_ACTIVATED));
+ frame.dispatchEvent (new FocusEvent (frame, FocusEvent.FOCUS_GAINED));
+ }
+ });
+ parent.addListener (SWT.Deactivate, new Listener () {
+ public void handleEvent (Event e) {
+ frame.dispatchEvent (new WindowEvent (frame, WindowEvent.WINDOW_DEACTIVATED));
+ frame.dispatchEvent (new FocusEvent (frame, FocusEvent.FOCUS_LOST));
+ }
+ });
+ parent.getShell ().addListener (SWT.Move, new Listener () {
+ public void handleEvent (Event e) {
+ final Rectangle rect = parent.getClientArea ();
+ frame.getToolkit ().getSystemEventQueue ().invokeLater(new Runnable () {
+ public void run () {
+ frame.dispatchEvent (new ComponentEvent (frame, ComponentEvent.COMPONENT_MOVED));
+ }
+ });
+ }
+ });
+ parent.addListener (SWT.Resize, new Listener () {
+ public void handleEvent (Event e) {
+ final Rectangle rect = parent.getClientArea ();
+ frame.getToolkit ().getSystemEventQueue ().invokeLater(new Runnable () {
+ public void run () {
+ frame.setSize (rect.width, rect.height);
+ frame.validate ();
+ }
+ });
+ }
+ });
+ parent.addListener (SWT.Dispose, new Listener () {
+ public void handleEvent (Event event) {
+ parent.setVisible(false);
+ frame.dispose ();
+ }
+ });
+ return panel;
+}
+
+public static Shell new_Shell (Display display, final Canvas parent) {
+ /*
+ * As of JDK 1.4, the DrawingSurface and WDrawingSurfaceInfo no longer exist
+ * so that code that references these classes no longer compiles. The fix is
+ * to use refection to invoke equivalent code that is commented below. There
+ * is no fix at this time for the missing WDrawingSurfaceInfo functionality.
+ */
+// DrawingSurface ds = (DrawingSurface)parent.getPeer();
+// WDrawingSurfaceInfo wds = (WDrawingSurfaceInfo)ds.getDrawingSurfaceInfo();
+// wds.lock ();
+// int handle = (int) wds.getHWnd ();
+// wds.unlock ();
+ Integer hwnd = null;
+ try {
+ Object ds = parent.getPeer ();
+ Class drawingSurfaceClass = Class.forName ("sun.awt.DrawingSurface"); //$NON-NLS-1$
+ Method method = drawingSurfaceClass.getDeclaredMethod ("getDrawingSurfaceInfo", null); //$NON-NLS-1$
+ Object wds = method.invoke (ds, null);
+ Class wDrawingSurfaceClass = Class.forName ("sun.awt.windows.WDrawingSurfaceInfo"); //$NON-NLS-1$
+ method = wDrawingSurfaceClass.getMethod ("lock", null); //$NON-NLS-1$
+ method.invoke (wds, null);
+ method = wDrawingSurfaceClass.getMethod ("getHWnd", null); //$NON-NLS-1$
+ hwnd = (Integer) method.invoke (wds, null);
+ method = wDrawingSurfaceClass.getMethod ("unlock", null); //$NON-NLS-1$
+ method.invoke (wds, null);
+ } catch (Exception e) {
+ SWT.error (SWT.ERROR_NOT_IMPLEMENTED, e);
+ }
+ int handle = hwnd.intValue();
+
+ final Shell shell = Shell.win32_new (display, handle);
+ final Display newDisplay = shell.getDisplay ();
+ parent.addComponentListener(new ComponentAdapter () {
+ public void componentResized (ComponentEvent e) {
+ newDisplay.syncExec (new Runnable () {
+ public void run () {
+ Dimension dim = parent.getSize ();
+ shell.setSize (dim.width, dim.height);
+ }
+ });
+ }
+ });
+ shell.setVisible (true);
+ return shell;
+}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/ACC.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/ACC.java
index f63b03f18f..b6009a9e14 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/ACC.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/ACC.java
@@ -1,63 +1,63 @@
-package org.eclipse.swt.accessibility;
-
-/*
+package org.eclipse.swt.accessibility;
+
+/*
* Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
* This file is made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- */
-
-/**
- * Class ACC contains all the constants used in defining an
- * Accessible object.
- *
- * @since 2.0
- */
-public class ACC {
- public static final int STATE_NORMAL = 0x00000000;
- public static final int STATE_SELECTED = 0x00000002;
- public static final int STATE_SELECTABLE = 0x00200000;
- public static final int STATE_MULTISELECTABLE = 0x1000000;
- public static final int STATE_FOCUSED = 0x00000004;
- public static final int STATE_FOCUSABLE = 0x00100000;
- public static final int STATE_PRESSED = 0x8;
- public static final int STATE_CHECKED = 0x10;
- public static final int STATE_EXPANDED = 0x200;
- public static final int STATE_COLLAPSED = 0x400;
- public static final int STATE_HOTTRACKED = 0x80;
- public static final int STATE_BUSY = 0x800;
- public static final int STATE_READONLY = 0x40;
- public static final int STATE_INVISIBLE = 0x8000;
- public static final int STATE_OFFSCREEN = 0x10000;
- public static final int STATE_SIZEABLE = 0x20000;
-
- public static final int ROLE_CLIENT_AREA = 0xa;
- public static final int ROLE_WINDOW = 0x9;
- public static final int ROLE_MENUBAR = 0x2;
- public static final int ROLE_MENU = 0xb;
- public static final int ROLE_MENUITEM = 0xc;
- public static final int ROLE_SEPARATOR = 0x15;
- public static final int ROLE_TOOLTIP = 0xd;
- public static final int ROLE_SCROLLBAR = 0x3;
- public static final int ROLE_DIALOG = 0x12;
- public static final int ROLE_LABEL = 0x29;
- public static final int ROLE_PUSHBUTTON = 0x2b;
- public static final int ROLE_CHECKBUTTON = 0x2c;
- public static final int ROLE_RADIOBUTTON = 0x2d;
- public static final int ROLE_COMBOBOX = 0x2e;
- public static final int ROLE_TEXT = 0x2a;
- public static final int ROLE_TOOLBAR = 0x16;
- public static final int ROLE_LIST = 0x21;
- public static final int ROLE_LISTITEM = 0x22;
- public static final int ROLE_TABLE = 0x18;
- public static final int ROLE_TABLECOLUMN = 0x19;
- public static final int ROLE_TREE = 0x23;
- public static final int ROLE_TABFOLDER = 0x3c;
- public static final int ROLE_TABITEM = 0x25;
- public static final int ROLE_PROGRESSBAR = 0x30;
- public static final int ROLE_SLIDER = 0x33;
-
- public static final int CHILDID_SELF = -1;
- public static final int CHILDID_NONE = -2;
- public static final int CHILDID_MULTIPLE = -3;
-}
+ * http://www.eclipse.org/legal/cpl-v10.html
+ */
+
+/**
+ * Class ACC contains all the constants used in defining an
+ * Accessible object.
+ *
+ * @since 2.0
+ */
+public class ACC {
+ public static final int STATE_NORMAL = 0x00000000;
+ public static final int STATE_SELECTED = 0x00000002;
+ public static final int STATE_SELECTABLE = 0x00200000;
+ public static final int STATE_MULTISELECTABLE = 0x1000000;
+ public static final int STATE_FOCUSED = 0x00000004;
+ public static final int STATE_FOCUSABLE = 0x00100000;
+ public static final int STATE_PRESSED = 0x8;
+ public static final int STATE_CHECKED = 0x10;
+ public static final int STATE_EXPANDED = 0x200;
+ public static final int STATE_COLLAPSED = 0x400;
+ public static final int STATE_HOTTRACKED = 0x80;
+ public static final int STATE_BUSY = 0x800;
+ public static final int STATE_READONLY = 0x40;
+ public static final int STATE_INVISIBLE = 0x8000;
+ public static final int STATE_OFFSCREEN = 0x10000;
+ public static final int STATE_SIZEABLE = 0x20000;
+
+ public static final int ROLE_CLIENT_AREA = 0xa;
+ public static final int ROLE_WINDOW = 0x9;
+ public static final int ROLE_MENUBAR = 0x2;
+ public static final int ROLE_MENU = 0xb;
+ public static final int ROLE_MENUITEM = 0xc;
+ public static final int ROLE_SEPARATOR = 0x15;
+ public static final int ROLE_TOOLTIP = 0xd;
+ public static final int ROLE_SCROLLBAR = 0x3;
+ public static final int ROLE_DIALOG = 0x12;
+ public static final int ROLE_LABEL = 0x29;
+ public static final int ROLE_PUSHBUTTON = 0x2b;
+ public static final int ROLE_CHECKBUTTON = 0x2c;
+ public static final int ROLE_RADIOBUTTON = 0x2d;
+ public static final int ROLE_COMBOBOX = 0x2e;
+ public static final int ROLE_TEXT = 0x2a;
+ public static final int ROLE_TOOLBAR = 0x16;
+ public static final int ROLE_LIST = 0x21;
+ public static final int ROLE_LISTITEM = 0x22;
+ public static final int ROLE_TABLE = 0x18;
+ public static final int ROLE_TABLECOLUMN = 0x19;
+ public static final int ROLE_TREE = 0x23;
+ public static final int ROLE_TABFOLDER = 0x3c;
+ public static final int ROLE_TABITEM = 0x25;
+ public static final int ROLE_PROGRESSBAR = 0x30;
+ public static final int ROLE_SLIDER = 0x33;
+
+ public static final int CHILDID_SELF = -1;
+ public static final int CHILDID_NONE = -2;
+ public static final int CHILDID_MULTIPLE = -3;
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleAdapter.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleAdapter.java
index a0fcfd51c7..25682d5ce7 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleAdapter.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleAdapter.java
@@ -1,124 +1,124 @@
-package org.eclipse.swt.accessibility;
-
-/*
+package org.eclipse.swt.accessibility;
+
+/*
* Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
* This file is made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- */
-
-/**
- * This adapter class provides default implementations for the
- * methods described by the <code>AccessibleListener</code> interface.
- * <p>
- * Classes that wish to deal with <code>AccessibleEvent</code>s can
- * extend this class and override only the methods that they are
- * interested in.
- * </p><p>
- * Note: Accessibility clients use child identifiers to specify
- * whether they want information about a control or one of its children.
- * Child identifiers are increasing integers beginning with 0.
- * The identifier CHILDID_SELF represents the control itself.
- * </p>
- *
- * @see AccessibleListener
- * @see AccessibleEvent
- *
- * @since 2.0
- */
-public abstract class AccessibleAdapter implements AccessibleListener {
-
- /**
- * Sent when an accessibility client requests the name
- * of the control, or the name of a child of the control.
- * The default behavior is to do nothing.
- * <p>
- * Return the name of the control or specified child in the
- * <code>result</code> field of the event object. Returning
- * an empty string tells the client that the control or child
- * does not have a name, and returning null tells the client
- * to use the platform name.
- * </p>
- *
- * @param e an event object containing the following fields:<ul>
- * <li>childID [IN] - an identifier specifying the control or one of its children</li>
- * <li>result [OUT] - the requested name string, or null</li>
- * </ul>
- */
- public void getName(AccessibleEvent e) {
- }
-
- /**
- * Sent when an accessibility client requests the help string
- * of the control, or the help string of a child of the control.
- * The default behavior is to do nothing.
- * <p>
- * The information in this property should be similar to the help
- * provided by toolTipText. It describes what the control or child
- * does or how to use it, as opposed to getDescription, which
- * describes appearance.
- * </p><p>
- * Return the help string of the control or specified child in
- * the <code>result</code> field of the event object. Returning
- * an empty string tells the client that the control or child
- * does not have a help string, and returning null tells the
- * client to use the platform help string.
- * </p>
- *
- * @param e an event object containing the following fields:<ul>
- * <li>childID [IN] - an identifier specifying the control or one of its children</li>
- * <li>result [OUT] - the requested help string, or null</li>
- * </ul>
- */
- public void getHelp(AccessibleEvent e) {
- }
-
- /**
- * Sent when an accessibility client requests the keyboard shortcut
- * of the control, or the keyboard shortcut of a child of the control.
- * The default behavior is to do nothing.
- * <p>
- * A keyboard shortcut can either be a mnemonic, or an accelerator.
- * As a general rule, if the control or child can receive keyboard focus,
- * then you should expose its mnemonic, and if it cannot receive keyboard
- * focus, then you should expose its accelerator.
- * </p><p>
- * Return the keyboard shortcut string of the control or specified child
- * in the <code>result</code> field of the event object. Returning an
- * empty string tells the client that the control or child does not
- * have a keyboard shortcut string, and returning null tells the client
- * to use the platform keyboard shortcut string.
- * </p>
- *
- * @param e an event object containing the following fields:<ul>
- * <li>childID [IN] - an identifier specifying the control or one of its children</li>
- * <li>result [OUT] - the requested keyboard shortcut string (example: "ALT+N"), or null</li>
- * </ul>
- */
- public void getKeyboardShortcut(AccessibleEvent e) {
- }
-
- /**
- * Sent when an accessibility client requests a description
- * of the control, or a description of a child of the control.
- * The default behavior is to do nothing.
- * <p>
- * This is a textual description of the control or child's visual
- * appearance, which is typically only necessary if it cannot be
- * determined from other properties such as role.
- * </p><p>
- * Return the description of the control or specified child in
- * the <code>result</code> field of the event object. Returning
- * an empty string tells the client that the control or child
- * does not have a description, and returning null tells the
- * client to use the platform description.
- * </p>
- *
- * @param e an event object containing the following fields:<ul>
- * <li>childID [IN] - an identifier specifying the control or one of its children</li>
- * <li>result [OUT] - the requested description string, or null</li>
- * </ul>
- */
- public void getDescription(AccessibleEvent e) {
- }
-}
+ * http://www.eclipse.org/legal/cpl-v10.html
+ */
+
+/**
+ * This adapter class provides default implementations for the
+ * methods described by the <code>AccessibleListener</code> interface.
+ * <p>
+ * Classes that wish to deal with <code>AccessibleEvent</code>s can
+ * extend this class and override only the methods that they are
+ * interested in.
+ * </p><p>
+ * Note: Accessibility clients use child identifiers to specify
+ * whether they want information about a control or one of its children.
+ * Child identifiers are increasing integers beginning with 0.
+ * The identifier CHILDID_SELF represents the control itself.
+ * </p>
+ *
+ * @see AccessibleListener
+ * @see AccessibleEvent
+ *
+ * @since 2.0
+ */
+public abstract class AccessibleAdapter implements AccessibleListener {
+
+ /**
+ * Sent when an accessibility client requests the name
+ * of the control, or the name of a child of the control.
+ * The default behavior is to do nothing.
+ * <p>
+ * Return the name of the control or specified child in the
+ * <code>result</code> field of the event object. Returning
+ * an empty string tells the client that the control or child
+ * does not have a name, and returning null tells the client
+ * to use the platform name.
+ * </p>
+ *
+ * @param e an event object containing the following fields:<ul>
+ * <li>childID [IN] - an identifier specifying the control or one of its children</li>
+ * <li>result [OUT] - the requested name string, or null</li>
+ * </ul>
+ */
+ public void getName(AccessibleEvent e) {
+ }
+
+ /**
+ * Sent when an accessibility client requests the help string
+ * of the control, or the help string of a child of the control.
+ * The default behavior is to do nothing.
+ * <p>
+ * The information in this property should be similar to the help
+ * provided by toolTipText. It describes what the control or child
+ * does or how to use it, as opposed to getDescription, which
+ * describes appearance.
+ * </p><p>
+ * Return the help string of the control or specified child in
+ * the <code>result</code> field of the event object. Returning
+ * an empty string tells the client that the control or child
+ * does not have a help string, and returning null tells the
+ * client to use the platform help string.
+ * </p>
+ *
+ * @param e an event object containing the following fields:<ul>
+ * <li>childID [IN] - an identifier specifying the control or one of its children</li>
+ * <li>result [OUT] - the requested help string, or null</li>
+ * </ul>
+ */
+ public void getHelp(AccessibleEvent e) {
+ }
+
+ /**
+ * Sent when an accessibility client requests the keyboard shortcut
+ * of the control, or the keyboard shortcut of a child of the control.
+ * The default behavior is to do nothing.
+ * <p>
+ * A keyboard shortcut can either be a mnemonic, or an accelerator.
+ * As a general rule, if the control or child can receive keyboard focus,
+ * then you should expose its mnemonic, and if it cannot receive keyboard
+ * focus, then you should expose its accelerator.
+ * </p><p>
+ * Return the keyboard shortcut string of the control or specified child
+ * in the <code>result</code> field of the event object. Returning an
+ * empty string tells the client that the control or child does not
+ * have a keyboard shortcut string, and returning null tells the client
+ * to use the platform keyboard shortcut string.
+ * </p>
+ *
+ * @param e an event object containing the following fields:<ul>
+ * <li>childID [IN] - an identifier specifying the control or one of its children</li>
+ * <li>result [OUT] - the requested keyboard shortcut string (example: "ALT+N"), or null</li>
+ * </ul>
+ */
+ public void getKeyboardShortcut(AccessibleEvent e) {
+ }
+
+ /**
+ * Sent when an accessibility client requests a description
+ * of the control, or a description of a child of the control.
+ * The default behavior is to do nothing.
+ * <p>
+ * This is a textual description of the control or child's visual
+ * appearance, which is typically only necessary if it cannot be
+ * determined from other properties such as role.
+ * </p><p>
+ * Return the description of the control or specified child in
+ * the <code>result</code> field of the event object. Returning
+ * an empty string tells the client that the control or child
+ * does not have a description, and returning null tells the
+ * client to use the platform description.
+ * </p>
+ *
+ * @param e an event object containing the following fields:<ul>
+ * <li>childID [IN] - an identifier specifying the control or one of its children</li>
+ * <li>result [OUT] - the requested description string, or null</li>
+ * </ul>
+ */
+ public void getDescription(AccessibleEvent e) {
+ }
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleControlAdapter.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleControlAdapter.java
index 1eeb7e07b0..91db3109b7 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleControlAdapter.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleControlAdapter.java
@@ -1,247 +1,247 @@
-package org.eclipse.swt.accessibility;
-
-/*
+package org.eclipse.swt.accessibility;
+
+/*
* Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
* This file is made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- */
-
-/**
- * This adapter class provides default implementations for the
- * methods described by the <code>AccessibleControlListener</code> interface.
- * <p>
- * Classes that wish to deal with <code>AccessibleControlEvent</code>s can
- * extend this class and override only the methods that they are
- * interested in.
- * </p><p>
- * Note: Accessibility clients use child identifiers to specify
- * whether they want information about a control or one of its children.
- * Child identifiers are increasing integers beginning with 0.
- * The identifier CHILDID_SELF represents the control itself.
- * When returning a child identifier to a client, you may use CHILDID_NONE
- * to indicate that no child or control has the required information.
- * </p><p>
- * Note: This adapter is typically used by implementors of
- * a custom control to provide very detailed information about
- * the control instance to accessibility clients.
- * </p>
- *
- * @see AccessibleControlListener
- * @see AccessibleControlEvent
- *
- * @since 2.0
- */
-public abstract class AccessibleControlAdapter implements AccessibleControlListener {
-
- /**
- * Sent when an accessibility client requests the identifier
- * of the control child at the specified display coordinates.
- * The default behavior is to do nothing.
- * <p>
- * Return the identifier of the child at display point (x, y)
- * in the <code>childID</code> field of the event object.
- * Return CHILDID_SELF if point (x, y) is in the control itself
- * and not in any child. Return CHILDID_NONE if point (x, y)
- * is not contained in either the control or any of its children.
- * </p>
- *
- * @param e an event object containing the following fields:<ul>
- * <li>x, y [IN] - the specified point in display coordinates</li>
- * <li>childID [Typical OUT] - the ID of the child at point, or CHILDID_SELF, or CHILDID_NONE</li>
- * <li>accessible [Optional OUT] - the accessible object for the control or child may be returned instead of the childID</li>
- * </ul>
- */
- public void getChildAtPoint(AccessibleControlEvent e) {
- }
-
- /**
- * Sent when an accessibility client requests the location
- * of the control, or the location of a child of the control.
- * The default behavior is to do nothing.
- * <p>
- * Return a rectangle describing the location of the specified
- * control or child in the <code>x, y, width, and height</code>
- * fields of the event object.
- * </p>
- *
- * @param e an event object containing the following fields:<ul>
- * <li>childID [IN] - an identifier specifying the control or one of its children</li>
- * <li>x, y, width, height [OUT] - the control or child location in display coordinates</li>
- * </ul>
- */
- public void getLocation(AccessibleControlEvent e) {
- }
-
- /**
- * Sent when an accessibility client requests the accessible object
- * for a child of the control.
- * The default behavior is to do nothing.
- * <p>
- * Return an <code>Accessible</code> for the specified control or
- * child in the <code>accessible</code> field of the event object.
- * Return null if the specified child does not have its own
- * <code>Accessible</code>.
- * </p>
- *
- * @param e an event object containing the following fields:<ul>
- * <li>childID [IN] - an identifier specifying a child of the control</li>
- * <li>accessible [OUT] - an Accessible for the specified childID, or null if one does not exist</li>
- * </ul>
- */
- public void getChild(AccessibleControlEvent e) {
- }
-
- /**
- * Sent when an accessibility client requests the number of
- * children in the control.
- * The default behavior is to do nothing.
- * <p>
- * Return the number of child items in the <code>detail</code>
- * field of the event object.
- * </p>
- *
- * @param e an event object containing the following fields:<ul>
- * <li>detail [OUT] - the number of child items in this control</li>
- * </ul>
- */
- public void getChildCount(AccessibleControlEvent e) {
- }
-
- /**
- * Sent when an accessibility client requests the default action
- * of the control, or the default action of a child of the control.
- * The default behavior is to do nothing.
- * <p>
- * This string is typically a verb describing what the user does to it.
- * For example, a Push Button's default action is "Press", a Check Button's
- * is "Check" or "UnCheck", and List items have the default action "Double Click".
- * </p><p>
- * Return a string describing the default action of the specified
- * control or child in the <code>result</code> field of the event object.
- * Returning null tells the client to use the platform default action string.
- * </p>
- *
- * @param e an event object containing the following fields:<ul>
- * <li>childID [IN] - an identifier specifying the control or one of its children</li>
- * <li>result [OUT] - the requested default action string, or null</li>
- * </ul>
- */
- public void getDefaultAction(AccessibleControlEvent e) {
- }
-
- /**
- * Sent when an accessibility client requests the identity of
- * the child or control that has keyboard focus.
- * The default behavior is to do nothing.
- * <p>
- * Return the identifier of the child that has focus in the
- * <code>childID</code> field of the event object.
- * Return CHILDID_SELF if the control itself has keyboard focus.
- * Return CHILDID_NONE if neither the control nor any of its children has focus.
- * </p>
- *
- * @param e an event object containing the following fields:<ul>
- * <li>childID [Typical OUT] - the ID of the child with focus, or CHILDID_SELF, or CHILDID_NONE</li>
- * <li>accessible [Optional OUT] - the accessible object for a child may be returned instead of its childID</li>
- * </ul>
- */
- public void getFocus(AccessibleControlEvent e) {
- }
-
- /**
- * Sent when an accessibility client requests the role
- * of the control, or the role of a child of the control.
- * The default behavior is to do nothing.
- * <p>
- * Return a role constant (constant defined in ACC beginning with ROLE_)
- * that describes the role of the specified control or child in the
- * <code>detail</code> field of the event object.
- * </p>
- *
- * @param e an event object containing the following fields:<ul>
- * <li>childID [IN] - an identifier specifying the control or one of its children</li>
- * <li>detail [OUT] - a role constant describing the role of the control or child</li>
- * </ul>
- */
- public void getRole(AccessibleControlEvent e) {
- }
-
- /**
- * Sent when an accessibility client requests the identity of
- * the child or control that is currently selected.
- * The default behavior is to do nothing.
- * <p>
- * Return the identifier of the selected child in the
- * <code>childID</code> field of the event object.
- * Return CHILDID_SELF if the control itself is selected.
- * Return CHILDID_MULTIPLE if multiple children are selected, and return an array of childIDs in the <code>children</code> field.
- * Return CHILDID_NONE if neither the control nor any of its children are selected.
- * </p>
- *
- * @param e an event object containing the following fields:<ul>
- * <li>childID [Typical OUT] - the ID of the selected child, or CHILDID_SELF, or CHILDID_MULTIPLE, or CHILDID_NONE</li>
- * <li>accessible [Optional OUT] - the accessible object for the control or child may be returned instead of the childID</li>
- * </ul>
- */
- public void getSelection(AccessibleControlEvent e) {
- }
-
- /**
- * Sent when an accessibility client requests the state
- * of the control, or the state of a child of the control.
- * The default behavior is to do nothing.
- * <p>
- * Return a state constant (constant defined in ACC beginning with STATE_)
- * that describes the current state of the specified control or child in the
- * <code>detail</code> field of the event object.
- * </p>
- *
- * @param e an event object containing the following fields:<ul>
- * <li>childID [IN] - an identifier specifying the control or one of its children</li>
- * <li>detail [OUT] - a state constant describing the current state of the control or child</li>
- * </ul>
- */
- public void getState(AccessibleControlEvent e) {
- }
-
- /**
- * Sent when an accessibility client requests the value
- * of the control, or the value of a child of the control.
- * The default behavior is to do nothing.
- * <p>
- * Many controls do not return a value. Examples of controls
- * that do are: Combo returns the text string, Text returns
- * its contents, ProgressBar returns a string representing a
- * percentage, and Tree items return a string representing
- * their level in the tree.
- * </p><p>
- * Return a string describing the value of the specified control
- * or child in the <code>result</code> field of the event object.
- * Returning null tells the client to use the platform value string.
- * </p>
- *
- * @param e an event object containing the following fields:<ul>
- * <li>childID [IN] - an identifier specifying the control or one of its children</li>
- * <li>result [OUT] - the requested value string, or null</li>
- * </ul>
- */
- public void getValue(AccessibleControlEvent e) {
- }
-
- /**
- * Sent when an accessibility client requests the children of the control.
- * The default behavior is to do nothing.
- * <p>
- * Return the children as an array of childIDs in the <code>children</code>
- * field of the event object.
- * </p>
- *
- * @param e an event object containing the following fields:<ul>
- * <li>children [Typical OUT] - an array of childIDs</li>
- * <li>accessible [Optional OUT] - an array of accessible objects for the children may be returned instead of the childIDs</li>
- * </ul>
- */
- public void getChildren(AccessibleControlEvent e) {
- }
-}
+ * http://www.eclipse.org/legal/cpl-v10.html
+ */
+
+/**
+ * This adapter class provides default implementations for the
+ * methods described by the <code>AccessibleControlListener</code> interface.
+ * <p>
+ * Classes that wish to deal with <code>AccessibleControlEvent</code>s can
+ * extend this class and override only the methods that they are
+ * interested in.
+ * </p><p>
+ * Note: Accessibility clients use child identifiers to specify
+ * whether they want information about a control or one of its children.
+ * Child identifiers are increasing integers beginning with 0.
+ * The identifier CHILDID_SELF represents the control itself.
+ * When returning a child identifier to a client, you may use CHILDID_NONE
+ * to indicate that no child or control has the required information.
+ * </p><p>
+ * Note: This adapter is typically used by implementors of
+ * a custom control to provide very detailed information about
+ * the control instance to accessibility clients.
+ * </p>
+ *
+ * @see AccessibleControlListener
+ * @see AccessibleControlEvent
+ *
+ * @since 2.0
+ */
+public abstract class AccessibleControlAdapter implements AccessibleControlListener {
+
+ /**
+ * Sent when an accessibility client requests the identifier
+ * of the control child at the specified display coordinates.
+ * The default behavior is to do nothing.
+ * <p>
+ * Return the identifier of the child at display point (x, y)
+ * in the <code>childID</code> field of the event object.
+ * Return CHILDID_SELF if point (x, y) is in the control itself
+ * and not in any child. Return CHILDID_NONE if point (x, y)
+ * is not contained in either the control or any of its children.
+ * </p>
+ *
+ * @param e an event object containing the following fields:<ul>
+ * <li>x, y [IN] - the specified point in display coordinates</li>
+ * <li>childID [Typical OUT] - the ID of the child at point, or CHILDID_SELF, or CHILDID_NONE</li>
+ * <li>accessible [Optional OUT] - the accessible object for the control or child may be returned instead of the childID</li>
+ * </ul>
+ */
+ public void getChildAtPoint(AccessibleControlEvent e) {
+ }
+
+ /**
+ * Sent when an accessibility client requests the location
+ * of the control, or the location of a child of the control.
+ * The default behavior is to do nothing.
+ * <p>
+ * Return a rectangle describing the location of the specified
+ * control or child in the <code>x, y, width, and height</code>
+ * fields of the event object.
+ * </p>
+ *
+ * @param e an event object containing the following fields:<ul>
+ * <li>childID [IN] - an identifier specifying the control or one of its children</li>
+ * <li>x, y, width, height [OUT] - the control or child location in display coordinates</li>
+ * </ul>
+ */
+ public void getLocation(AccessibleControlEvent e) {
+ }
+
+ /**
+ * Sent when an accessibility client requests the accessible object
+ * for a child of the control.
+ * The default behavior is to do nothing.
+ * <p>
+ * Return an <code>Accessible</code> for the specified control or
+ * child in the <code>accessible</code> field of the event object.
+ * Return null if the specified child does not have its own
+ * <code>Accessible</code>.
+ * </p>
+ *
+ * @param e an event object containing the following fields:<ul>
+ * <li>childID [IN] - an identifier specifying a child of the control</li>
+ * <li>accessible [OUT] - an Accessible for the specified childID, or null if one does not exist</li>
+ * </ul>
+ */
+ public void getChild(AccessibleControlEvent e) {
+ }
+
+ /**
+ * Sent when an accessibility client requests the number of
+ * children in the control.
+ * The default behavior is to do nothing.
+ * <p>
+ * Return the number of child items in the <code>detail</code>
+ * field of the event object.
+ * </p>
+ *
+ * @param e an event object containing the following fields:<ul>
+ * <li>detail [OUT] - the number of child items in this control</li>
+ * </ul>
+ */
+ public void getChildCount(AccessibleControlEvent e) {
+ }
+
+ /**
+ * Sent when an accessibility client requests the default action
+ * of the control, or the default action of a child of the control.
+ * The default behavior is to do nothing.
+ * <p>
+ * This string is typically a verb describing what the user does to it.
+ * For example, a Push Button's default action is "Press", a Check Button's
+ * is "Check" or "UnCheck", and List items have the default action "Double Click".
+ * </p><p>
+ * Return a string describing the default action of the specified
+ * control or child in the <code>result</code> field of the event object.
+ * Returning null tells the client to use the platform default action string.
+ * </p>
+ *
+ * @param e an event object containing the following fields:<ul>
+ * <li>childID [IN] - an identifier specifying the control or one of its children</li>
+ * <li>result [OUT] - the requested default action string, or null</li>
+ * </ul>
+ */
+ public void getDefaultAction(AccessibleControlEvent e) {
+ }
+
+ /**
+ * Sent when an accessibility client requests the identity of
+ * the child or control that has keyboard focus.
+ * The default behavior is to do nothing.
+ * <p>
+ * Return the identifier of the child that has focus in the
+ * <code>childID</code> field of the event object.
+ * Return CHILDID_SELF if the control itself has keyboard focus.
+ * Return CHILDID_NONE if neither the control nor any of its children has focus.
+ * </p>
+ *
+ * @param e an event object containing the following fields:<ul>
+ * <li>childID [Typical OUT] - the ID of the child with focus, or CHILDID_SELF, or CHILDID_NONE</li>
+ * <li>accessible [Optional OUT] - the accessible object for a child may be returned instead of its childID</li>
+ * </ul>
+ */
+ public void getFocus(AccessibleControlEvent e) {
+ }
+
+ /**
+ * Sent when an accessibility client requests the role
+ * of the control, or the role of a child of the control.
+ * The default behavior is to do nothing.
+ * <p>
+ * Return a role constant (constant defined in ACC beginning with ROLE_)
+ * that describes the role of the specified control or child in the
+ * <code>detail</code> field of the event object.
+ * </p>
+ *
+ * @param e an event object containing the following fields:<ul>
+ * <li>childID [IN] - an identifier specifying the control or one of its children</li>
+ * <li>detail [OUT] - a role constant describing the role of the control or child</li>
+ * </ul>
+ */
+ public void getRole(AccessibleControlEvent e) {
+ }
+
+ /**
+ * Sent when an accessibility client requests the identity of
+ * the child or control that is currently selected.
+ * The default behavior is to do nothing.
+ * <p>
+ * Return the identifier of the selected child in the
+ * <code>childID</code> field of the event object.
+ * Return CHILDID_SELF if the control itself is selected.
+ * Return CHILDID_MULTIPLE if multiple children are selected, and return an array of childIDs in the <code>children</code> field.
+ * Return CHILDID_NONE if neither the control nor any of its children are selected.
+ * </p>
+ *
+ * @param e an event object containing the following fields:<ul>
+ * <li>childID [Typical OUT] - the ID of the selected child, or CHILDID_SELF, or CHILDID_MULTIPLE, or CHILDID_NONE</li>
+ * <li>accessible [Optional OUT] - the accessible object for the control or child may be returned instead of the childID</li>
+ * </ul>
+ */
+ public void getSelection(AccessibleControlEvent e) {
+ }
+
+ /**
+ * Sent when an accessibility client requests the state
+ * of the control, or the state of a child of the control.
+ * The default behavior is to do nothing.
+ * <p>
+ * Return a state constant (constant defined in ACC beginning with STATE_)
+ * that describes the current state of the specified control or child in the
+ * <code>detail</code> field of the event object.
+ * </p>
+ *
+ * @param e an event object containing the following fields:<ul>
+ * <li>childID [IN] - an identifier specifying the control or one of its children</li>
+ * <li>detail [OUT] - a state constant describing the current state of the control or child</li>
+ * </ul>
+ */
+ public void getState(AccessibleControlEvent e) {
+ }
+
+ /**
+ * Sent when an accessibility client requests the value
+ * of the control, or the value of a child of the control.
+ * The default behavior is to do nothing.
+ * <p>
+ * Many controls do not return a value. Examples of controls
+ * that do are: Combo returns the text string, Text returns
+ * its contents, ProgressBar returns a string representing a
+ * percentage, and Tree items return a string representing
+ * their level in the tree.
+ * </p><p>
+ * Return a string describing the value of the specified control
+ * or child in the <code>result</code> field of the event object.
+ * Returning null tells the client to use the platform value string.
+ * </p>
+ *
+ * @param e an event object containing the following fields:<ul>
+ * <li>childID [IN] - an identifier specifying the control or one of its children</li>
+ * <li>result [OUT] - the requested value string, or null</li>
+ * </ul>
+ */
+ public void getValue(AccessibleControlEvent e) {
+ }
+
+ /**
+ * Sent when an accessibility client requests the children of the control.
+ * The default behavior is to do nothing.
+ * <p>
+ * Return the children as an array of childIDs in the <code>children</code>
+ * field of the event object.
+ * </p>
+ *
+ * @param e an event object containing the following fields:<ul>
+ * <li>children [Typical OUT] - an array of childIDs</li>
+ * <li>accessible [Optional OUT] - an array of accessible objects for the children may be returned instead of the childIDs</li>
+ * </ul>
+ */
+ public void getChildren(AccessibleControlEvent e) {
+ }
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleControlEvent.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleControlEvent.java
index 634a46db69..b6260bf23e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleControlEvent.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleControlEvent.java
@@ -1,52 +1,52 @@
-package org.eclipse.swt.accessibility;
-
-/*
+package org.eclipse.swt.accessibility;
+
+/*
* Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
* This file is made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- */
-
-import org.eclipse.swt.internal.SWTEventObject;
-
-/**
- * Instances of this class are sent as a result of
- * accessibility clients sending messages to controls
- * asking for detailed information about the implementation
- * of the control instance. Typically, only implementors
- * of custom controls need to listen for this event.
- * <p>
- * Note: The meaning of each field depends on the
- * message that was sent.
- * </p>
- *
- * @see AccessibleControlListener
- * @see AccessibleControlAdapter
- *
- * @since 2.0
- */
-public class AccessibleControlEvent extends SWTEventObject {
- public int childID; // IN/OUT
- public Accessible accessible; // OUT
- public int x, y; // IN/OUT
- public int width, height; // OUT
- public int detail; // IN/OUT
- public String result; // OUT
- public Object children[]; // [OUT]
-
-public AccessibleControlEvent(Object source) {
- super(source);
-}
-
-public String toString () {
- return "AccessibleControlEvent {childID=" + childID +
- " accessible=" + accessible +
- " x=" + x +
- " y=" + y +
- " width=" + width +
- " height=" + height +
- " detail=" + detail +
- " result=" + result +
- "}";
-}
+ * http://www.eclipse.org/legal/cpl-v10.html
+ */
+
+import org.eclipse.swt.internal.SWTEventObject;
+
+/**
+ * Instances of this class are sent as a result of
+ * accessibility clients sending messages to controls
+ * asking for detailed information about the implementation
+ * of the control instance. Typically, only implementors
+ * of custom controls need to listen for this event.
+ * <p>
+ * Note: The meaning of each field depends on the
+ * message that was sent.
+ * </p>
+ *
+ * @see AccessibleControlListener
+ * @see AccessibleControlAdapter
+ *
+ * @since 2.0
+ */
+public class AccessibleControlEvent extends SWTEventObject {
+ public int childID; // IN/OUT
+ public Accessible accessible; // OUT
+ public int x, y; // IN/OUT
+ public int width, height; // OUT
+ public int detail; // IN/OUT
+ public String result; // OUT
+ public Object children[]; // [OUT]
+
+public AccessibleControlEvent(Object source) {
+ super(source);
+}
+
+public String toString () {
+ return "AccessibleControlEvent {childID=" + childID +
+ " accessible=" + accessible +
+ " x=" + x +
+ " y=" + y +
+ " width=" + width +
+ " height=" + height +
+ " detail=" + detail +
+ " result=" + result +
+ "}";
+}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleControlListener.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleControlListener.java
index 1e44fbe4bb..07d187a717 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleControlListener.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleControlListener.java
@@ -1,229 +1,229 @@
-package org.eclipse.swt.accessibility;
-
-/*
+package org.eclipse.swt.accessibility;
+
+/*
* Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
* This file is made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- */
-
-import org.eclipse.swt.internal.SWTEventListener;
-
-/**
- * Classes that implement this interface provide methods
- * that deal with the events that are generated when an
- * accessibility client sends a message to a control.
- * <p>
- * After creating an instance of a class that implements
- * this interface it can be added to a control using the
- * <code>addAccessibleControlListener</code> method and removed
- * using the <code>removeAccessibleControlListener</code> method.
- * When a client requests information the appropriate method
- * will be invoked.
- * </p><p>
- * Note: Accessibility clients use child identifiers to specify
- * whether they want information about a control or one of its children.
- * Child identifiers are increasing integers beginning with 0.
- * The identifier CHILDID_SELF represents the control itself.
- * </p><p>
- * Note: This interface is typically used by implementors of
- * a custom control to provide very detailed information about
- * the control instance to accessibility clients.
- * </p>
- *
- * @see AccessibleControlAdapter
- * @see AccessibleControlEvent
- *
- * @since 2.0
- */
-public interface AccessibleControlListener extends SWTEventListener {
-
- /**
- * Sent when an accessibility client requests the identifier
- * of the control child at the specified display coordinates.
- * <p>
- * Return the identifier of the child at display point (x, y)
- * in the <code>childID</code> field of the event object.
- * Return CHILDID_SELF if point (x, y) is in the control itself
- * and not in any child. Return CHILDID_NONE if point (x, y)
- * is not contained in either the control or any of its children.
- * </p>
- *
- * @param e an event object containing the following fields:<ul>
- * <li>x, y [IN] - the specified point in display coordinates</li>
- * <li>childID [Typical OUT] - the ID of the child at point, or CHILDID_SELF, or CHILDID_NONE</li>
- * <li>accessible [Optional OUT] - the accessible object for the control or child may be returned instead of the childID</li>
- * </ul>
- */
- public void getChildAtPoint(AccessibleControlEvent e);
-
- /**
- * Sent when an accessibility client requests the location
- * of the control, or the location of a child of the control.
- * <p>
- * Return a rectangle describing the location of the specified
- * control or child in the <code>x, y, width, and height</code>
- * fields of the event object.
- * </p>
- *
- * @param e an event object containing the following fields:<ul>
- * <li>childID [IN] - an identifier specifying the control or one of its children</li>
- * <li>x, y, width, height [OUT] - the control or child location in display coordinates</li>
- * </ul>
- */
- public void getLocation(AccessibleControlEvent e);
-
- /**
- * Sent when an accessibility client requests the accessible object
- * for a child of the control.
- * <p>
- * Return an <code>Accessible</code> for the specified control or
- * child in the <code>accessible</code> field of the event object.
- * Return null if the specified child does not have its own
- * <code>Accessible</code>.
- * </p>
- *
- * @param e an event object containing the following fields:<ul>
- * <li>childID [IN] - an identifier specifying a child of the control</li>
- * <li>accessible [OUT] - an Accessible for the specified childID, or null if one does not exist</li>
- * </ul>
- */
- public void getChild(AccessibleControlEvent e);
-
- /**
- * Sent when an accessibility client requests the number of
- * children in the control.
- * <p>
- * Return the number of child items in the <code>detail</code>
- * field of the event object.
- * </p>
- *
- * @param e an event object containing the following fields:<ul>
- * <li>detail [OUT] - the number of child items in this control</li>
- * </ul>
- */
- public void getChildCount(AccessibleControlEvent e);
-
- /**
- * Sent when an accessibility client requests the default action
- * of the control, or the default action of a child of the control.
- * <p>
- * This string is typically a verb describing what the user does to it.
- * For example, a Push Button's default action is "Press", a Check Button's
- * is "Check" or "UnCheck", and List items have the default action "Double Click".
- * </p><p>
- * Return a string describing the default action of the specified
- * control or child in the <code>result</code> field of the event object.
- * Returning null tells the client to use the platform default action string.
- * </p>
- *
- * @param e an event object containing the following fields:<ul>
- * <li>childID [IN] - an identifier specifying the control or one of its children</li>
- * <li>result [OUT] - the requested default action string, or null</li>
- * </ul>
- */
- public void getDefaultAction(AccessibleControlEvent e);
-
- /**
- * Sent when an accessibility client requests the identity of
- * the child or control that has keyboard focus.
- * <p>
- * Return the identifier of the child that has focus in the
- * <code>childID</code> field of the event object.
- * Return CHILDID_SELF if the control itself has keyboard focus.
- * Return CHILDID_NONE if neither the control nor any of its children has focus.
- * </p>
- *
- * @param e an event object containing the following fields:<ul>
- * <li>childID [Typical OUT] - the ID of the child with focus, or CHILDID_SELF, or CHILDID_NONE</li>
- * <li>accessible [Optional OUT] - the accessible object for a child may be returned instead of its childID</li>
- * </ul>
- */
- public void getFocus(AccessibleControlEvent e);
-
- /**
- * Sent when an accessibility client requests the role
- * of the control, or the role of a child of the control.
- * <p>
- * Return a role constant (constant defined in ACC beginning with ROLE_)
- * that describes the role of the specified control or child in the
- * <code>detail</code> field of the event object.
- * </p>
- *
- * @param e an event object containing the following fields:<ul>
- * <li>childID [IN] - an identifier specifying the control or one of its children</li>
- * <li>detail [OUT] - a role constant describing the role of the control or child</li>
- * </ul>
- */
- public void getRole(AccessibleControlEvent e);
-
- /**
- * Sent when an accessibility client requests the identity of
- * the child or control that is currently selected.
- * <p>
- * Return the identifier of the selected child in the
- * <code>childID</code> field of the event object.
- * Return CHILDID_SELF if the control itself is selected.
- * Return CHILDID_MULTIPLE if multiple children are selected, and return an array of childIDs in the <code>children</code> field.
- * Return CHILDID_NONE if neither the control nor any of its children are selected.
- * </p>
- *
- * @param e an event object containing the following fields:<ul>
- * <li>childID [Typical OUT] - the ID of the selected child, or CHILDID_SELF, or CHILDID_MULTIPLE, or CHILDID_NONE</li>
- * <li>accessible [Optional OUT] - the accessible object for the control or child may be returned instead of the childID</li>
- * </ul>
- */
- public void getSelection(AccessibleControlEvent e);
-
- /**
- * Sent when an accessibility client requests the state
- * of the control, or the state of a child of the control.
- * <p>
- * Return a state constant (constant defined in ACC beginning with STATE_)
- * that describes the current state of the specified control or child in the
- * <code>detail</code> field of the event object.
- * </p>
- *
- * @param e an event object containing the following fields:<ul>
- * <li>childID [IN] - an identifier specifying the control or one of its children</li>
- * <li>detail [OUT] - a state constant describing the current state of the control or child</li>
- * </ul>
- */
- public void getState(AccessibleControlEvent e);
-
- /**
- * Sent when an accessibility client requests the value
- * of the control, or the value of a child of the control.
- * <p>
- * Many controls do not return a value. Examples of controls
- * that do are: Combo returns the text string, Text returns
- * its contents, ProgressBar returns a string representing a
- * percentage, and Tree items return a string representing
- * their level in the tree.
- * </p><p>
- * Return a string describing the value of the specified control
- * or child in the <code>result</code> field of the event object.
- * Returning null tells the client to use the platform value string.
- * </p>
- *
- * @param e an event object containing the following fields:<ul>
- * <li>childID [IN] - an identifier specifying the control or one of its children</li>
- * <li>result [OUT] - the requested value string, or null</li>
- * </ul>
- */
- public void getValue(AccessibleControlEvent e);
-
- /**
- * Sent when an accessibility client requests the children of the control.
- * <p>
- * Return the children as an array of childIDs in the <code>children</code>
- * field of the event object.
- * </p>
- *
- * @param e an event object containing the following fields:<ul>
- * <li>children [Typical OUT] - an array of childIDs</li>
- * <li>accessible [Optional OUT] - an array of accessible objects for the children may be returned instead of the childIDs</li>
- * </ul>
- */
- public void getChildren(AccessibleControlEvent e);
-}
+ * http://www.eclipse.org/legal/cpl-v10.html
+ */
+
+import org.eclipse.swt.internal.SWTEventListener;
+
+/**
+ * Classes that implement this interface provide methods
+ * that deal with the events that are generated when an
+ * accessibility client sends a message to a control.
+ * <p>
+ * After creating an instance of a class that implements
+ * this interface it can be added to a control using the
+ * <code>addAccessibleControlListener</code> method and removed
+ * using the <code>removeAccessibleControlListener</code> method.
+ * When a client requests information the appropriate method
+ * will be invoked.
+ * </p><p>
+ * Note: Accessibility clients use child identifiers to specify
+ * whether they want information about a control or one of its children.
+ * Child identifiers are increasing integers beginning with 0.
+ * The identifier CHILDID_SELF represents the control itself.
+ * </p><p>
+ * Note: This interface is typically used by implementors of
+ * a custom control to provide very detailed information about
+ * the control instance to accessibility clients.
+ * </p>
+ *
+ * @see AccessibleControlAdapter
+ * @see AccessibleControlEvent
+ *
+ * @since 2.0
+ */
+public interface AccessibleControlListener extends SWTEventListener {
+
+ /**
+ * Sent when an accessibility client requests the identifier
+ * of the control child at the specified display coordinates.
+ * <p>
+ * Return the identifier of the child at display point (x, y)
+ * in the <code>childID</code> field of the event object.
+ * Return CHILDID_SELF if point (x, y) is in the control itself
+ * and not in any child. Return CHILDID_NONE if point (x, y)
+ * is not contained in either the control or any of its children.
+ * </p>
+ *
+ * @param e an event object containing the following fields:<ul>
+ * <li>x, y [IN] - the specified point in display coordinates</li>
+ * <li>childID [Typical OUT] - the ID of the child at point, or CHILDID_SELF, or CHILDID_NONE</li>
+ * <li>accessible [Optional OUT] - the accessible object for the control or child may be returned instead of the childID</li>
+ * </ul>
+ */
+ public void getChildAtPoint(AccessibleControlEvent e);
+
+ /**
+ * Sent when an accessibility client requests the location
+ * of the control, or the location of a child of the control.
+ * <p>
+ * Return a rectangle describing the location of the specified
+ * control or child in the <code>x, y, width, and height</code>
+ * fields of the event object.
+ * </p>
+ *
+ * @param e an event object containing the following fields:<ul>
+ * <li>childID [IN] - an identifier specifying the control or one of its children</li>
+ * <li>x, y, width, height [OUT] - the control or child location in display coordinates</li>
+ * </ul>
+ */
+ public void getLocation(AccessibleControlEvent e);
+
+ /**
+ * Sent when an accessibility client requests the accessible object
+ * for a child of the control.
+ * <p>
+ * Return an <code>Accessible</code> for the specified control or
+ * child in the <code>accessible</code> field of the event object.
+ * Return null if the specified child does not have its own
+ * <code>Accessible</code>.
+ * </p>
+ *
+ * @param e an event object containing the following fields:<ul>
+ * <li>childID [IN] - an identifier specifying a child of the control</li>
+ * <li>accessible [OUT] - an Accessible for the specified childID, or null if one does not exist</li>
+ * </ul>
+ */
+ public void getChild(AccessibleControlEvent e);
+
+ /**
+ * Sent when an accessibility client requests the number of
+ * children in the control.
+ * <p>
+ * Return the number of child items in the <code>detail</code>
+ * field of the event object.
+ * </p>
+ *
+ * @param e an event object containing the following fields:<ul>
+ * <li>detail [OUT] - the number of child items in this control</li>
+ * </ul>
+ */
+ public void getChildCount(AccessibleControlEvent e);
+
+ /**
+ * Sent when an accessibility client requests the default action
+ * of the control, or the default action of a child of the control.
+ * <p>
+ * This string is typically a verb describing what the user does to it.
+ * For example, a Push Button's default action is "Press", a Check Button's
+ * is "Check" or "UnCheck", and List items have the default action "Double Click".
+ * </p><p>
+ * Return a string describing the default action of the specified
+ * control or child in the <code>result</code> field of the event object.
+ * Returning null tells the client to use the platform default action string.
+ * </p>
+ *
+ * @param e an event object containing the following fields:<ul>
+ * <li>childID [IN] - an identifier specifying the control or one of its children</li>
+ * <li>result [OUT] - the requested default action string, or null</li>
+ * </ul>
+ */
+ public void getDefaultAction(AccessibleControlEvent e);
+
+ /**
+ * Sent when an accessibility client requests the identity of
+ * the child or control that has keyboard focus.
+ * <p>
+ * Return the identifier of the child that has focus in the
+ * <code>childID</code> field of the event object.
+ * Return CHILDID_SELF if the control itself has keyboard focus.
+ * Return CHILDID_NONE if neither the control nor any of its children has focus.
+ * </p>
+ *
+ * @param e an event object containing the following fields:<ul>
+ * <li>childID [Typical OUT] - the ID of the child with focus, or CHILDID_SELF, or CHILDID_NONE</li>
+ * <li>accessible [Optional OUT] - the accessible object for a child may be returned instead of its childID</li>
+ * </ul>
+ */
+ public void getFocus(AccessibleControlEvent e);
+
+ /**
+ * Sent when an accessibility client requests the role
+ * of the control, or the role of a child of the control.
+ * <p>
+ * Return a role constant (constant defined in ACC beginning with ROLE_)
+ * that describes the role of the specified control or child in the
+ * <code>detail</code> field of the event object.
+ * </p>
+ *
+ * @param e an event object containing the following fields:<ul>
+ * <li>childID [IN] - an identifier specifying the control or one of its children</li>
+ * <li>detail [OUT] - a role constant describing the role of the control or child</li>
+ * </ul>
+ */
+ public void getRole(AccessibleControlEvent e);
+
+ /**
+ * Sent when an accessibility client requests the identity of
+ * the child or control that is currently selected.
+ * <p>
+ * Return the identifier of the selected child in the
+ * <code>childID</code> field of the event object.
+ * Return CHILDID_SELF if the control itself is selected.
+ * Return CHILDID_MULTIPLE if multiple children are selected, and return an array of childIDs in the <code>children</code> field.
+ * Return CHILDID_NONE if neither the control nor any of its children are selected.
+ * </p>
+ *
+ * @param e an event object containing the following fields:<ul>
+ * <li>childID [Typical OUT] - the ID of the selected child, or CHILDID_SELF, or CHILDID_MULTIPLE, or CHILDID_NONE</li>
+ * <li>accessible [Optional OUT] - the accessible object for the control or child may be returned instead of the childID</li>
+ * </ul>
+ */
+ public void getSelection(AccessibleControlEvent e);
+
+ /**
+ * Sent when an accessibility client requests the state
+ * of the control, or the state of a child of the control.
+ * <p>
+ * Return a state constant (constant defined in ACC beginning with STATE_)
+ * that describes the current state of the specified control or child in the
+ * <code>detail</code> field of the event object.
+ * </p>
+ *
+ * @param e an event object containing the following fields:<ul>
+ * <li>childID [IN] - an identifier specifying the control or one of its children</li>
+ * <li>detail [OUT] - a state constant describing the current state of the control or child</li>
+ * </ul>
+ */
+ public void getState(AccessibleControlEvent e);
+
+ /**
+ * Sent when an accessibility client requests the value
+ * of the control, or the value of a child of the control.
+ * <p>
+ * Many controls do not return a value. Examples of controls
+ * that do are: Combo returns the text string, Text returns
+ * its contents, ProgressBar returns a string representing a
+ * percentage, and Tree items return a string representing
+ * their level in the tree.
+ * </p><p>
+ * Return a string describing the value of the specified control
+ * or child in the <code>result</code> field of the event object.
+ * Returning null tells the client to use the platform value string.
+ * </p>
+ *
+ * @param e an event object containing the following fields:<ul>
+ * <li>childID [IN] - an identifier specifying the control or one of its children</li>
+ * <li>result [OUT] - the requested value string, or null</li>
+ * </ul>
+ */
+ public void getValue(AccessibleControlEvent e);
+
+ /**
+ * Sent when an accessibility client requests the children of the control.
+ * <p>
+ * Return the children as an array of childIDs in the <code>children</code>
+ * field of the event object.
+ * </p>
+ *
+ * @param e an event object containing the following fields:<ul>
+ * <li>children [Typical OUT] - an array of childIDs</li>
+ * <li>accessible [Optional OUT] - an array of accessible objects for the children may be returned instead of the childIDs</li>
+ * </ul>
+ */
+ public void getChildren(AccessibleControlEvent e);
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleEvent.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleEvent.java
index 5220b8c99f..3c909bc9d2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleEvent.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleEvent.java
@@ -1,50 +1,50 @@
-package org.eclipse.swt.accessibility;
-
-/*
+package org.eclipse.swt.accessibility;
+
+/*
* Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
* This file is made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- */
-
-import org.eclipse.swt.internal.SWTEventObject;
-
-/**
- * Instances of this class are sent as a result of
- * accessibility clients sending messages to controls
- * asking for information about the control instance.
- * <p>
- * Note: The meaning of the result field depends
- * on the message that was sent.
- * </p>
- *
- * @see AccessibleListener
- * @see AccessibleAdapter
- *
- * @since 2.0
- */
-public class AccessibleEvent extends SWTEventObject {
- /**
- * The value of this field is set by an accessibility client
- * before the accessible listener method is called.
- * ChildID can be CHILDID_SELF, representing the control itself,
- * or a 0-based integer representing a specific child of the control.
- */
- public int childID;
-
- /**
- * The value of this field must be set in the accessible listener
- * method before returning.
- * What to set it to depends on the listener method called, and
- * the childID specified by the client.
- */
- public String result;
-
-public AccessibleEvent(Object source) {
- super(source);
-}
-
-public String toString () {
- return "AccessibleEvent {childID=" + childID + " result=" + result + "}";
-}
+ * http://www.eclipse.org/legal/cpl-v10.html
+ */
+
+import org.eclipse.swt.internal.SWTEventObject;
+
+/**
+ * Instances of this class are sent as a result of
+ * accessibility clients sending messages to controls
+ * asking for information about the control instance.
+ * <p>
+ * Note: The meaning of the result field depends
+ * on the message that was sent.
+ * </p>
+ *
+ * @see AccessibleListener
+ * @see AccessibleAdapter
+ *
+ * @since 2.0
+ */
+public class AccessibleEvent extends SWTEventObject {
+ /**
+ * The value of this field is set by an accessibility client
+ * before the accessible listener method is called.
+ * ChildID can be CHILDID_SELF, representing the control itself,
+ * or a 0-based integer representing a specific child of the control.
+ */
+ public int childID;
+
+ /**
+ * The value of this field must be set in the accessible listener
+ * method before returning.
+ * What to set it to depends on the listener method called, and
+ * the childID specified by the client.
+ */
+ public String result;
+
+public AccessibleEvent(Object source) {
+ super(source);
+}
+
+public String toString () {
+ return "AccessibleEvent {childID=" + childID + " result=" + result + "}";
+}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleListener.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleListener.java
index 903bfca01d..ee6396f753 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleListener.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/common/org/eclipse/swt/accessibility/AccessibleListener.java
@@ -1,122 +1,122 @@
-package org.eclipse.swt.accessibility;
-
-/*
+package org.eclipse.swt.accessibility;
+
+/*
* Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
* This file is made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- */
-
-import org.eclipse.swt.internal.SWTEventListener;
-
-/**
- * Classes that implement this interface provide methods
- * that deal with the events that are generated when an
- * accessibility client sends a message to a control.
- * <p>
- * After creating an instance of a class that implements
- * this interface it can be added to a control using the
- * <code>addAccessibleListener</code> method and removed
- * using the <code>removeAccessibleListener</code> method.
- * When a client requests information, the appropriate method
- * will be invoked.
- * </p><p>
- * Note: Accessibility clients use child identifiers to specify
- * whether they want information about a control or one of its children.
- * Child identifiers are increasing integers beginning with 0.
- * The identifier CHILDID_SELF represents the control itself.
- * </p>
- *
- * @see AccessibleAdapter
- * @see AccessibleEvent
- *
- * @since 2.0
- */
-public interface AccessibleListener extends SWTEventListener {
-
- /**
- * Sent when an accessibility client requests the name
- * of the control, or the name of a child of the control.
- * <p>
- * Return the name of the control or specified child in the
- * <code>result</code> field of the event object. Returning
- * an empty string tells the client that the control or child
- * does not have a name, and returning null tells the client
- * to use the platform name.
- * </p>
- *
- * @param e an event object containing the following fields:<ul>
- * <li>childID [IN] - an identifier specifying the control or one of its children</li>
- * <li>result [OUT] - the requested name string, or null</li>
- * </ul>
- */
- public void getName(AccessibleEvent e);
-
- /**
- * Sent when an accessibility client requests the help string
- * of the control, or the help string of a child of the control.
- * <p>
- * The information in this property should be similar to the help
- * provided by toolTipText. It describes what the control or child
- * does or how to use it, as opposed to getDescription, which
- * describes appearance.
- * </p><p>
- * Return the help string of the control or specified child in
- * the <code>result</code> field of the event object. Returning
- * an empty string tells the client that the control or child
- * does not have a help string, and returning null tells the
- * client to use the platform help string.
- * </p>
- *
- * @param e an event object containing the following fields:<ul>
- * <li>childID [IN] - an identifier specifying the control or one of its children</li>
- * <li>result [OUT] - the requested help string, or null</li>
- * </ul>
- */
- public void getHelp(AccessibleEvent e);
-
- /**
- * Sent when an accessibility client requests the keyboard shortcut
- * of the control, or the keyboard shortcut of a child of the control.
- * <p>
- * A keyboard shortcut can either be a mnemonic, or an accelerator.
- * As a general rule, if the control or child can receive keyboard focus,
- * then you should expose its mnemonic, and if it cannot receive keyboard
- * focus, then you should expose its accelerator.
- * </p><p>
- * Return the keyboard shortcut string of the control or specified child
- * in the <code>result</code> field of the event object. Returning an
- * empty string tells the client that the control or child does not
- * have a keyboard shortcut string, and returning null tells the client
- * to use the platform keyboard shortcut string.
- * </p>
- *
- * @param e an event object containing the following fields:<ul>
- * <li>childID [IN] - an identifier specifying the control or one of its children</li>
- * <li>result [OUT] - the requested keyboard shortcut string (example: "ALT+N"), or null</li>
- * </ul>
- */
- public void getKeyboardShortcut(AccessibleEvent e);
-
- /**
- * Sent when an accessibility client requests a description
- * of the control, or a description of a child of the control.
- * <p>
- * This is a textual description of the control or child's visual
- * appearance, which is typically only necessary if it cannot be
- * determined from other properties such as role.
- * </p><p>
- * Return the description of the control or specified child in
- * the <code>result</code> field of the event object. Returning
- * an empty string tells the client that the control or child
- * does not have a description, and returning null tells the
- * client to use the platform description.
- * </p>
- *
- * @param e an event object containing the following fields:<ul>
- * <li>childID [IN] - an identifier specifying the control or one of its children</li>
- * <li>result [OUT] - the requested description string, or null</li>
- * </ul>
- */
- public void getDescription(AccessibleEvent e);
-}
+ * http://www.eclipse.org/legal/cpl-v10.html
+ */
+
+import org.eclipse.swt.internal.SWTEventListener;
+
+/**
+ * Classes that implement this interface provide methods
+ * that deal with the events that are generated when an
+ * accessibility client sends a message to a control.
+ * <p>
+ * After creating an instance of a class that implements
+ * this interface it can be added to a control using the
+ * <code>addAccessibleListener</code> method and removed
+ * using the <code>removeAccessibleListener</code> method.
+ * When a client requests information, the appropriate method
+ * will be invoked.
+ * </p><p>
+ * Note: Accessibility clients use child identifiers to specify
+ * whether they want information about a control or one of its children.
+ * Child identifiers are increasing integers beginning with 0.
+ * The identifier CHILDID_SELF represents the control itself.
+ * </p>
+ *
+ * @see AccessibleAdapter
+ * @see AccessibleEvent
+ *
+ * @since 2.0
+ */
+public interface AccessibleListener extends SWTEventListener {
+
+ /**
+ * Sent when an accessibility client requests the name
+ * of the control, or the name of a child of the control.
+ * <p>
+ * Return the name of the control or specified child in the
+ * <code>result</code> field of the event object. Returning
+ * an empty string tells the client that the control or child
+ * does not have a name, and returning null tells the client
+ * to use the platform name.
+ * </p>
+ *
+ * @param e an event object containing the following fields:<ul>
+ * <li>childID [IN] - an identifier specifying the control or one of its children</li>
+ * <li>result [OUT] - the requested name string, or null</li>
+ * </ul>
+ */
+ public void getName(AccessibleEvent e);
+
+ /**
+ * Sent when an accessibility client requests the help string
+ * of the control, or the help string of a child of the control.
+ * <p>
+ * The information in this property should be similar to the help
+ * provided by toolTipText. It describes what the control or child
+ * does or how to use it, as opposed to getDescription, which
+ * describes appearance.
+ * </p><p>
+ * Return the help string of the control or specified child in
+ * the <code>result</code> field of the event object. Returning
+ * an empty string tells the client that the control or child
+ * does not have a help string, and returning null tells the
+ * client to use the platform help string.
+ * </p>
+ *
+ * @param e an event object containing the following fields:<ul>
+ * <li>childID [IN] - an identifier specifying the control or one of its children</li>
+ * <li>result [OUT] - the requested help string, or null</li>
+ * </ul>
+ */
+ public void getHelp(AccessibleEvent e);
+
+ /**
+ * Sent when an accessibility client requests the keyboard shortcut
+ * of the control, or the keyboard shortcut of a child of the control.
+ * <p>
+ * A keyboard shortcut can either be a mnemonic, or an accelerator.
+ * As a general rule, if the control or child can receive keyboard focus,
+ * then you should expose its mnemonic, and if it cannot receive keyboard
+ * focus, then you should expose its accelerator.
+ * </p><p>
+ * Return the keyboard shortcut string of the control or specified child
+ * in the <code>result</code> field of the event object. Returning an
+ * empty string tells the client that the control or child does not
+ * have a keyboard shortcut string, and returning null tells the client
+ * to use the platform keyboard shortcut string.
+ * </p>
+ *
+ * @param e an event object containing the following fields:<ul>
+ * <li>childID [IN] - an identifier specifying the control or one of its children</li>
+ * <li>result [OUT] - the requested keyboard shortcut string (example: "ALT+N"), or null</li>
+ * </ul>
+ */
+ public void getKeyboardShortcut(AccessibleEvent e);
+
+ /**
+ * Sent when an accessibility client requests a description
+ * of the control, or a description of a child of the control.
+ * <p>
+ * This is a textual description of the control or child's visual
+ * appearance, which is typically only necessary if it cannot be
+ * determined from other properties such as role.
+ * </p><p>
+ * Return the description of the control or specified child in
+ * the <code>result</code> field of the event object. Returning
+ * an empty string tells the client that the control or child
+ * does not have a description, and returning null tells the
+ * client to use the platform description.
+ * </p>
+ *
+ * @param e an event object containing the following fields:<ul>
+ * <li>childID [IN] - an identifier specifying the control or one of its children</li>
+ * <li>result [OUT] - the requested description string, or null</li>
+ * </ul>
+ */
+ public void getDescription(AccessibleEvent e);
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/emulated/org/eclipse/swt/accessibility/Accessible.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/emulated/org/eclipse/swt/accessibility/Accessible.java
index 2c22be84fb..2e2fc877e8 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/emulated/org/eclipse/swt/accessibility/Accessible.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/emulated/org/eclipse/swt/accessibility/Accessible.java
@@ -1,193 +1,193 @@
-package org.eclipse.swt.accessibility;
-
-/*
+package org.eclipse.swt.accessibility;
+
+/*
* Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
* This file is made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- */
-
-import org.eclipse.swt.widgets.Control;
-
-/**
- * Instances of this class provide a bridge between application
- * code and assistive technology clients. Many platforms provide
- * default accessible behavior for most widgets, and this class
- * allows that default behavior to be overridden. Applications
- * can get the default Accessible object for a control by sending
- * it <code>getAccessible</code>, and then add an accessible listener
- * to override simple items like the name and help string, or they
- * can add an accessible control listener to override complex items.
- * As a rule of thumb, an application would only want to use the
- * accessible control listener to implement accessibility for a
- * custom control.
- *
- * @see Control#getAccessible
- * @see AccessibleListener
- * @see AccessibleEvent
- * @see AccessibleControlListener
- * @see AccessibleControlEvent
- *
- * @since 2.0
+ * http://www.eclipse.org/legal/cpl-v10.html
*/
-public class Accessible {
-
- Accessible(Control control) {
- }
-
- /**
- * Invokes platform specific functionality to allocate a new accessible object.
- * <p>
- * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
- * API for <code>Accessible</code>. 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 called from
- * application code.
- * </p>
- *
- * @param control the control to get the accessible object for
- * @return the platform specific accessible object
- *
- * @private
+
+import org.eclipse.swt.widgets.Control;
+
+/**
+ * Instances of this class provide a bridge between application
+ * code and assistive technology clients. Many platforms provide
+ * default accessible behavior for most widgets, and this class
+ * allows that default behavior to be overridden. Applications
+ * can get the default Accessible object for a control by sending
+ * it <code>getAccessible</code>, and then add an accessible listener
+ * to override simple items like the name and help string, or they
+ * can add an accessible control listener to override complex items.
+ * As a rule of thumb, an application would only want to use the
+ * accessible control listener to implement accessibility for a
+ * custom control.
+ *
+ * @see Control#getAccessible
+ * @see AccessibleListener
+ * @see AccessibleEvent
+ * @see AccessibleControlListener
+ * @see AccessibleControlEvent
+ *
+ * @since 2.0
+ */
+public class Accessible {
+
+ Accessible(Control control) {
+ }
+
+ /**
+ * Invokes platform specific functionality to allocate a new accessible object.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Accessible</code>. 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 called from
+ * application code.
+ * </p>
+ *
+ * @param control the control to get the accessible object for
+ * @return the platform specific accessible object
+ *
+ * @private
*/
- public static Accessible internal_new_Accessible(Control control) {
- return new Accessible(control);
- }
-
- /**
- * Adds the listener to the collection of listeners who will
- * be notifed when an accessible client asks for certain strings,
- * such as name, description, help, or keyboard shortcut. The
- * listener is notified by sending it one of the messages defined
- * in the <code>AccessibleListener</code> interface.
- *
- * @param listener the listener that should be notified when the receiver
- * is asked for a name, description, help, or keyboard shortcut string
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
- * </ul>
- *
- * @see AccessibleListener
- * @see #removeAccessibleListener
+ public static Accessible internal_new_Accessible(Control control) {
+ return new Accessible(control);
+ }
+
+ /**
+ * Adds the listener to the collection of listeners who will
+ * be notifed when an accessible client asks for certain strings,
+ * such as name, description, help, or keyboard shortcut. The
+ * listener is notified by sending it one of the messages defined
+ * in the <code>AccessibleListener</code> interface.
+ *
+ * @param listener the listener that should be notified when the receiver
+ * is asked for a name, description, help, or keyboard shortcut string
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
+ * </ul>
+ *
+ * @see AccessibleListener
+ * @see #removeAccessibleListener
*/
- public void addAccessibleListener(AccessibleListener listener) {
- }
-
- /**
- * Removes the listener from the collection of listeners who will
- * be notifed when an accessible client asks for certain strings,
- * such as name, description, help, or keyboard shortcut.
- *
- * @param listener the listener that should no longer be notified when the receiver
- * is asked for a name, description, help, or keyboard shortcut string
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
- * </ul>
- *
- * @see AccessibleListener
- * @see #addDisposeListener
+ public void addAccessibleListener(AccessibleListener listener) {
+ }
+
+ /**
+ * Removes the listener from the collection of listeners who will
+ * be notifed when an accessible client asks for certain strings,
+ * such as name, description, help, or keyboard shortcut.
+ *
+ * @param listener the listener that should no longer be notified when the receiver
+ * is asked for a name, description, help, or keyboard shortcut string
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
+ * </ul>
+ *
+ * @see AccessibleListener
+ * @see #addDisposeListener
*/
- public void removeAccessibleListener(AccessibleListener listener) {
- }
-
- /**
- * Adds the listener to the collection of listeners who will
- * be notifed when an accessible client asks for custom control
- * specific information. The listener is notified by sending it
- * one of the messages defined in the <code>AccessibleControlListener</code>
- * interface.
- *
- * @param listener the listener that should be notified when the receiver
- * is asked for custom control specific information
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
- * </ul>
- *
- * @see AccessibleControlListener
- * @see #removeAccessibleControlListener
+ public void removeAccessibleListener(AccessibleListener listener) {
+ }
+
+ /**
+ * Adds the listener to the collection of listeners who will
+ * be notifed when an accessible client asks for custom control
+ * specific information. The listener is notified by sending it
+ * one of the messages defined in the <code>AccessibleControlListener</code>
+ * interface.
+ *
+ * @param listener the listener that should be notified when the receiver
+ * is asked for custom control specific information
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
+ * </ul>
+ *
+ * @see AccessibleControlListener
+ * @see #removeAccessibleControlListener
*/
- public void addAccessibleControlListener(AccessibleControlListener listener) {
- }
-
- /**
- * Removes the listener from the collection of listeners who will
- * be notifed when an accessible client asks for custom control
- * specific information.
- *
- * @param listener the listener that should no longer be notified when the receiver
- * is asked for custom control specific information
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
- * </ul>
- *
- * @see AccessibleControlListener
- * @see #addAccessibleControlListener
+ public void addAccessibleControlListener(AccessibleControlListener listener) {
+ }
+
+ /**
+ * Removes the listener from the collection of listeners who will
+ * be notifed when an accessible client asks for custom control
+ * specific information.
+ *
+ * @param listener the listener that should no longer be notified when the receiver
+ * is asked for custom control specific information
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
+ * </ul>
+ *
+ * @see AccessibleControlListener
+ * @see #addAccessibleControlListener
*/
- public void removeAccessibleControlListener(AccessibleControlListener listener) {
- }
-
- /**
- * Sends a message to accessible clients indicating that the focus
- * has changed within a custom control.
- *
- * @param childID an identifier specifying a child of the control
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
- * </ul>
+ public void removeAccessibleControlListener(AccessibleControlListener listener) {
+ }
+
+ /**
+ * Sends a message to accessible clients indicating that the focus
+ * has changed within a custom control.
+ *
+ * @param childID an identifier specifying a child of the control
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
+ * </ul>
*/
- public void setFocus(int childID) {
- }
-
- /**
- * Invokes platform specific functionality to dispose an accessible object.
- * <p>
- * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
- * API for <code>Accessible</code>. 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 called from
- * application code.
- * </p>
- *
- * @private
+ public void setFocus(int childID) {
+ }
+
+ /**
+ * Invokes platform specific functionality to dispose an accessible object.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Accessible</code>. 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 called from
+ * application code.
+ * </p>
+ *
+ * @private
*/
- public void internal_dispose_Accessible() {
- }
-
- /**
- * Invokes platform specific functionality to handle a window message.
- * <p>
- * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
- * API for <code>Accessible</code>. 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 called from
- * application code.
- * </p>
- *
- * @private
+ public void internal_dispose_Accessible() {
+ }
+
+ /**
+ * Invokes platform specific functionality to handle a window message.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Accessible</code>. 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 called from
+ * application code.
+ * </p>
+ *
+ * @private
*/
- public int internal_WM_GETOBJECT (int wParam, int lParam) {
- return 0;
- }
-}
+ public int internal_WM_GETOBJECT (int wParam, int lParam) {
+ return 0;
+ }
+}
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 c1d1ba01b0..d90789220d 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
@@ -1,1163 +1,1163 @@
-package org.eclipse.swt.accessibility;
-
-/*
+package org.eclipse.swt.accessibility;
+
+/*
* Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
* This file is made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- */
-
-import java.util.Vector;
-import org.eclipse.swt.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.internal.win32.*;
-import org.eclipse.swt.ole.win32.*;
-import org.eclipse.swt.internal.ole.win32.*;
-
-/**
- * Instances of this class provide a bridge between application
- * code and assistive technology clients. Many platforms provide
- * default accessible behavior for most widgets, and this class
- * allows that default behavior to be overridden. Applications
- * can get the default Accessible object for a control by sending
- * it <code>getAccessible</code>, and then add an accessible listener
- * to override simple items like the name and help string, or they
- * can add an accessible control listener to override complex items.
- * As a rule of thumb, an application would only want to use the
- * accessible control listener to implement accessibility for a
- * custom control.
- *
- * @see Control#getAccessible
- * @see AccessibleListener
- * @see AccessibleEvent
- * @see AccessibleControlListener
- * @see AccessibleControlEvent
- *
- * @since 2.0
- */
-public class Accessible {
- int refCount = 0, enumIndex = 0;
- COMObject objIAccessible, objIEnumVARIANT;
- IAccessible iaccessible;
- Vector accessibleListeners = new Vector(), accessibleControlListeners = new Vector();
- Object[] variants;
- Control control;
-
- Accessible(Control control) {
- this.control = control;
- int[] ppvObject = new int[1];
- int result = COM.CreateStdAccessibleObject(control.handle, COM.OBJID_CLIENT, COM.IIDIAccessible, ppvObject);
- if (result == COM.E_NOTIMPL) return;
- if (result != COM.S_OK) OLE.error(OLE.ERROR_CANNOT_CREATE_OBJECT, result);
- iaccessible = new IAccessible(ppvObject[0]);
- iaccessible.AddRef();
-
- objIAccessible = new COMObject(new int[] {2,0,0,1,3,5,8,1,1,5,5,5,5,5,5,5,6,5,1,1,5,5,8,6,3,4,5,5}) {
- public int method0(int[] args) {return QueryInterface(args[0], args[1]);}
- public int method1(int[] args) {return AddRef();}
- public int method2(int[] args) {return Release();}
- // method3 GetTypeInfoCount - not implemented
- // method4 GetTypeInfo - not implemented
- // method5 GetIDsOfNames - not implemented
- // method6 Invoke - not implemented
- public int method7(int[] args) {return get_accParent(args[0]);}
- public int method8(int[] args) {return get_accChildCount(args[0]);}
- public int method9(int[] args) {return get_accChild(args[0], args[1], args[2], args[3], args[4]);}
- public int method10(int[] args) {return get_accName(args[0], args[1], args[2], args[3], args[4]);}
- public int method11(int[] args) {return get_accValue(args[0], args[1], args[2], args[3], args[4]);}
- public int method12(int[] args) {return get_accDescription(args[0], args[1], args[2], args[3], args[4]);}
- public int method13(int[] args) {return get_accRole(args[0], args[1], args[2], args[3], args[4]);}
- public int method14(int[] args) {return get_accState(args[0], args[1], args[2], args[3], args[4]);}
- public int method15(int[] args) {return get_accHelp(args[0], args[1], args[2], args[3], args[4]);}
- public int method16(int[] args) {return get_accHelpTopic(args[0], args[1], args[2], args[3], args[4], args[5]);}
- public int method17(int[] args) {return get_accKeyboardShortcut(args[0], args[1], args[2], args[3], args[4]);}
- public int method18(int[] args) {return get_accFocus(args[0]);}
- public int method19(int[] args) {return get_accSelection(args[0]);}
- public int method20(int[] args) {return get_accDefaultAction(args[0], args[1], args[2], args[3], args[4]);}
- public int method21(int[] args) {return accSelect(args[0], args[1], args[2], args[3], args[4]);}
- public int method22(int[] args) {return accLocation(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]);}
- public int method23(int[] args) {return accNavigate(args[0], args[1], args[2], args[3], args[4], args[5]);}
- public int method24(int[] args) {return accHitTest(args[0], args[1], args[2]);}
- public int method25(int[] args) {return accDoDefaultAction(args[0], args[1], args[2], args[3]);}
- public int method26(int[] args) {return put_accName(args[0], args[1], args[2], args[3], args[4]);}
- public int method27(int[] args) {return put_accValue(args[0], args[1], args[2], args[3], args[4]);}
- };
-
- objIEnumVARIANT = new COMObject(new int[] {2,0,0,3,1,0,1}) {
- public int method0(int[] args) {return QueryInterface(args[0], args[1]);}
- public int method1(int[] args) {return AddRef();}
- public int method2(int[] args) {return Release();}
- public int method3(int[] args) {return Next(args[0], args[1], args[2]);}
- public int method4(int[] args) {return Skip(args[0]);}
- public int method5(int[] args) {return Reset();}
- // method6 Clone - not implemented
- };
- AddRef();
- }
-
- /**
- * Invokes platform specific functionality to allocate a new accessible object.
- * <p>
- * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
- * API for <code>Accessible</code>. 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 called from
- * application code.
- * </p>
- *
- * @param control the control to get the accessible object for
- * @return the platform specific accessible object
- *
- * @private
- */
- public static Accessible internal_new_Accessible(Control control) {
- return new Accessible(control);
- }
-
- /**
- * Adds the listener to the collection of listeners who will
- * be notifed when an accessible client asks for certain strings,
- * such as name, description, help, or keyboard shortcut. The
- * listener is notified by sending it one of the messages defined
- * in the <code>AccessibleListener</code> interface.
- *
- * @param listener the listener that should be notified when the receiver
- * is asked for a name, description, help, or keyboard shortcut string
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
- * </ul>
- *
- * @see AccessibleListener
- * @see #removeAccessibleListener
- */
- public void addAccessibleListener(AccessibleListener listener) {
- checkWidget();
- if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
- accessibleListeners.addElement(listener);
- }
-
- /**
- * Removes the listener from the collection of listeners who will
- * be notifed when an accessible client asks for certain strings,
- * such as name, description, help, or keyboard shortcut.
- *
- * @param listener the listener that should no longer be notified when the receiver
- * is asked for a name, description, help, or keyboard shortcut string
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
- * </ul>
- *
- * @see AccessibleListener
- * @see #addDisposeListener
- */
- public void removeAccessibleListener(AccessibleListener listener) {
- checkWidget();
- if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
- accessibleListeners.removeElement(listener);
- }
-
- /**
- * Adds the listener to the collection of listeners who will
- * be notifed when an accessible client asks for custom control
- * specific information. The listener is notified by sending it
- * one of the messages defined in the <code>AccessibleControlListener</code>
- * interface.
- *
- * @param listener the listener that should be notified when the receiver
- * is asked for custom control specific information
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
- * </ul>
- *
- * @see AccessibleControlListener
- * @see #removeAccessibleControlListener
- */
- public void addAccessibleControlListener(AccessibleControlListener listener) {
- checkWidget();
- if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
- accessibleControlListeners.addElement(listener);
- }
-
- /**
- * Removes the listener from the collection of listeners who will
- * be notifed when an accessible client asks for custom control
- * specific information.
- *
- * @param listener the listener that should no longer be notified when the receiver
- * is asked for custom control specific information
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
- * </ul>
- *
- * @see AccessibleControlListener
- * @see #addAccessibleControlListener
- */
- public void removeAccessibleControlListener(AccessibleControlListener listener) {
- checkWidget();
- if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
- accessibleControlListeners.removeElement(listener);
- }
-
- /**
- * Sends a message to accessible clients indicating that the focus
- * has changed within a custom control.
- *
- * @param childID an identifier specifying a child of the control
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
- * </ul>
- */
- public void setFocus(int childID) {
- checkWidget();
- int id;
- if (childID == ACC.CHILDID_SELF) id = COM.CHILDID_SELF;
- else if (control instanceof Tree) id = childID; // Tree item childIDs are pointers
- else id = childID + 1; // All other childIDs are 1-based indices
- COM.NotifyWinEvent (COM.EVENT_OBJECT_FOCUS, control.handle, COM.OBJID_CLIENT, id);
- }
-
- /**
- * Invokes platform specific functionality to dispose an accessible object.
- * <p>
- * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
- * API for <code>Accessible</code>. 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 called from
- * application code.
- * </p>
- *
- * @private
- */
- public void internal_dispose_Accessible() {
- if (iaccessible != null)
- iaccessible.Release();
- iaccessible = null;
- Release();
- }
-
- /**
- * Invokes platform specific functionality to handle a window message.
- * <p>
- * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
- * API for <code>Accessible</code>. 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 called from
- * application code.
- * </p>
- *
- * @private
- */
- public int internal_WM_GETOBJECT (int wParam, int lParam) {
- if (objIAccessible == null) return 0;
- if (lParam == COM.OBJID_CLIENT) {
- return COM.LresultFromObject(COM.IIDIAccessible, wParam, objIAccessible.getAddress());
- }
- return 0;
- }
-
- int QueryInterface(int arg1, int arg2) {
- if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
- GUID guid = new GUID();
- COM.MoveMemory(guid, arg1, GUID.sizeof);
-
- if (COM.IsEqualGUID(guid, COM.IIDIUnknown)) {
- COM.MoveMemory(arg2, new int[] { objIAccessible.getAddress()}, 4);
- AddRef();
- return COM.S_OK;
- }
-
- if (COM.IsEqualGUID(guid, COM.IIDIDispatch)) {
- COM.MoveMemory(arg2, new int[] { objIAccessible.getAddress()}, 4);
- AddRef();
- return COM.S_OK;
- }
-
- if (COM.IsEqualGUID(guid, COM.IIDIAccessible)) {
- COM.MoveMemory(arg2, new int[] { objIAccessible.getAddress()}, 4);
- AddRef();
- return COM.S_OK;
- }
-
- if (COM.IsEqualGUID(guid, COM.IIDIEnumVARIANT)) {
- COM.MoveMemory(arg2, new int[] { objIEnumVARIANT.getAddress()}, 4);
- AddRef();
- enumIndex = 0;
- return COM.S_OK;
- }
-
- int[] ppvObject = new int[1];
- int result = iaccessible.QueryInterface(guid, ppvObject);
- COM.MoveMemory(arg2, ppvObject, 4);
- return result;
- }
-
- int AddRef() {
- refCount++;
- return refCount;
- }
-
- int Release() {
- refCount--;
-
- if (refCount == 0) {
- if (objIAccessible != null)
- objIAccessible.dispose();
- objIAccessible = null;
-
- if (objIEnumVARIANT != null)
- objIEnumVARIANT.dispose();
- objIEnumVARIANT = null;
- }
- return refCount;
- }
-
- int accDoDefaultAction(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2) {
- if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
- // Currently, we don't let the application override this. Forward to the proxy.
- int code = iaccessible.accDoDefaultAction(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2);
- if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
- return code;
- }
-
- int accHitTest(int xLeft, int yTop, int pvarChild) {
- if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
- if (accessibleControlListeners.size() == 0) {
- return iaccessible.accHitTest(xLeft, yTop, pvarChild);
- }
-
- AccessibleControlEvent event = new AccessibleControlEvent(this);
- event.childID = ACC.CHILDID_NONE;
- event.x = xLeft;
- event.y = yTop;
- for (int i = 0; i < accessibleControlListeners.size(); i++) {
- AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
- listener.getChildAtPoint(event);
- }
- int childID = event.childID;
- if (childID == ACC.CHILDID_NONE) {
- return iaccessible.accHitTest(xLeft, yTop, pvarChild);
- }
- if (childID == ACC.CHILDID_SELF) childID = COM.CHILDID_SELF;
- else if (!(control instanceof Tree)) childID++; // Tree item childIDs are pointers (not 1-based indices)
- COM.MoveMemory(pvarChild, new short[] { COM.VT_I4 }, 2);
- COM.MoveMemory(pvarChild + 8, new int[] { childID }, 4);
- return COM.S_OK;
- }
-
- int accLocation(int pxLeft, int pyTop, int pcxWidth, int pcyHeight, int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2) {
- if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
- if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG;
-
- /* Get the default location from the OS. */
- int osLeft = 0, osTop = 0, osWidth = 0, osHeight = 0;
- int code = iaccessible.accLocation(pxLeft, pyTop, pcxWidth, pcyHeight, varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2);
- if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
- if (accessibleControlListeners.size() == 0) return code;
- if (code == COM.S_OK) {
- int[] pLeft = new int[1], pTop = new int[1], pWidth = new int[1], pHeight = new int[1];
- COM.MoveMemory(pLeft, pxLeft, 4);
- COM.MoveMemory(pTop, pyTop, 4);
- COM.MoveMemory(pWidth, pcxWidth, 4);
- COM.MoveMemory(pHeight, pcyHeight, 4);
- osLeft = pLeft[0]; osTop = pTop[0]; osWidth = pWidth[0]; osHeight = pHeight[0];
- }
-
- AccessibleControlEvent event = new AccessibleControlEvent(this);
- if (varChild_lVal == COM.CHILDID_SELF) event.childID = ACC.CHILDID_SELF;
- else if (control instanceof Tree) event.childID = varChild_lVal; // Tree item childIDs are pointers
- else event.childID = varChild_lVal - 1; // All other childIDs are 1-based indices
- event.x = osLeft;
- event.y = osTop;
- event.width = osWidth;
- event.height = osHeight;
- for (int i = 0; i < accessibleControlListeners.size(); i++) {
- AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
- listener.getLocation(event);
- }
- OS.MoveMemory(pxLeft, new int[] { event.x }, 4);
- OS.MoveMemory(pyTop, new int[] { event.y }, 4);
- OS.MoveMemory(pcxWidth, new int[] { event.width }, 4);
- OS.MoveMemory(pcyHeight, new int[] { event.height }, 4);
- return COM.S_OK;
- }
-
- int accNavigate(int navDir, int varStart_vt, int varStart_reserved1, int varStart_lVal, int varStart_reserved2, int pvarEndUpAt) {
- if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
- // Currently, we don't let the application override this. Forward to the proxy.
- int code = iaccessible.accNavigate(navDir, varStart_vt, varStart_reserved1, varStart_lVal, varStart_reserved2, pvarEndUpAt);
- if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
- return code;
- }
-
- int accSelect(int flagsSelect, int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2) {
- if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
- // Currently, we don't let the application override this. Forward to the proxy.
- int code = iaccessible.accSelect(flagsSelect, varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2);
- if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
- return code;
- }
-
- int get_accChild(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int ppdispChild) {
- if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
- if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG;
- if (accessibleControlListeners.size() == 0) {
- int code = iaccessible.get_accChild(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, ppdispChild);
- if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
- return code;
- }
-
- AccessibleControlEvent event = new AccessibleControlEvent(this);
- if (varChild_lVal == COM.CHILDID_SELF) event.childID = ACC.CHILDID_SELF;
- else if (control instanceof Tree) event.childID = varChild_lVal; // Tree item childIDs are pointers
- else event.childID = varChild_lVal - 1; // All other childIDs are 1-based indices
- for (int i = 0; i < accessibleControlListeners.size(); i++) {
- AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
- listener.getChild(event);
- }
- Accessible accessible = event.accessible;
- if (accessible != null) {
- COM.MoveMemory(ppdispChild, new int[] { accessible.objIAccessible.getAddress() }, 4);
- return COM.S_OK;
- }
- return COM.S_FALSE;
- }
-
- int get_accChildCount(int pcountChildren) {
- if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
-
- /* Get the default child count from the OS. */
- int osChildCount = 0;
- int code = iaccessible.get_accChildCount(pcountChildren);
- if (accessibleControlListeners.size() == 0) return code;
- if (code == COM.S_OK) {
- int[] pChildCount = new int[1];
- COM.MoveMemory(pChildCount, pcountChildren, 4);
- osChildCount = pChildCount[0];
- }
-
- AccessibleControlEvent event = new AccessibleControlEvent(this);
- event.childID = ACC.CHILDID_SELF;
- event.detail = osChildCount;
- for (int i = 0; i < accessibleControlListeners.size(); i++) {
- AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
- listener.getChildCount(event);
- }
-
- COM.MoveMemory(pcountChildren, new int[] { event.detail }, 4);
- return COM.S_OK;
- }
-
- int get_accDefaultAction(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszDefaultAction) {
- if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
- if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG;
-
- /* Get the default defaultAction from the OS. */
- String osDefaultAction = null;
- int code = iaccessible.get_accDefaultAction(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, pszDefaultAction);
- if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
- if (accessibleControlListeners.size() == 0) return code;
- if (code == COM.S_OK) {
- int[] pDefaultAction = new int[1];
- COM.MoveMemory(pDefaultAction, pszDefaultAction, 4);
- int size = COM.SysStringByteLen(pDefaultAction[0]);
- if (size > 0) {
- char[] buffer = new char[(size + 1) /2];
- COM.MoveMemory(buffer, pDefaultAction[0], size);
- osDefaultAction = new String(buffer);
- }
- }
-
- AccessibleControlEvent event = new AccessibleControlEvent(this);
- if (varChild_lVal == COM.CHILDID_SELF) event.childID = ACC.CHILDID_SELF;
- else if (control instanceof Tree) event.childID = varChild_lVal; // Tree item childIDs are pointers
- else event.childID = varChild_lVal - 1; // All other childIDs are 1-based indices
- event.result = osDefaultAction;
- for (int i = 0; i < accessibleControlListeners.size(); i++) {
- AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
- listener.getDefaultAction(event);
- }
- if (event.result == null) return code;
- char[] data = (event.result + "\0").toCharArray();
- int ptr = COM.SysAllocString(data);
- COM.MoveMemory(pszDefaultAction, new int[] { ptr }, 4);
- return COM.S_OK;
- }
-
- int get_accDescription(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszDescription) {
- if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
- if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG;
-
- /* Get the default description from the OS. */
- String osDescription = null;
- int code = iaccessible.get_accDescription(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, pszDescription);
- if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
- if (accessibleListeners.size() == 0) return code;
- if (code == COM.S_OK) {
- int[] pDescription = new int[1];
- COM.MoveMemory(pDescription, pszDescription, 4);
- int size = COM.SysStringByteLen(pDescription[0]);
- if (size > 0) {
- char[] buffer = new char[(size + 1) /2];
- COM.MoveMemory(buffer, pDescription[0], size);
- osDescription = new String(buffer);
- }
- }
-
- AccessibleEvent event = new AccessibleEvent(this);
- if (varChild_lVal == COM.CHILDID_SELF) event.childID = ACC.CHILDID_SELF;
- else if (control instanceof Tree) event.childID = varChild_lVal; // Tree item childIDs are pointers
- else event.childID = varChild_lVal - 1; // All other childIDs are 1-based indices
- event.result = osDescription;
- for (int i = 0; i < accessibleListeners.size(); i++) {
- AccessibleListener listener = (AccessibleListener) accessibleListeners.elementAt(i);
- listener.getDescription(event);
- }
- if (event.result == null) return code;
- char[] data = (event.result + "\0").toCharArray();
- int ptr = COM.SysAllocString(data);
- COM.MoveMemory(pszDescription, new int[] { ptr }, 4);
- return COM.S_OK;
- }
-
- int get_accFocus(int pvarChild) {
- if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
-
- /* Get the default focus child from the OS. */
- int osChild = ACC.CHILDID_NONE;
- int code = iaccessible.get_accFocus(pvarChild);
- if (accessibleControlListeners.size() == 0) return code;
- if (code == COM.S_OK) {
- short[] pvt = new short[1];
- COM.MoveMemory(pvt, pvarChild, 2);
- if (pvt[0] == COM.VT_I4) {
- int[] pChild = new int[1];
- COM.MoveMemory(pChild, pvarChild + 8, 4);
- osChild = (pChild[0] == COM.CHILDID_SELF) ? ACC.CHILDID_SELF : pChild[0] - 1;
- }
- }
-
- AccessibleControlEvent event = new AccessibleControlEvent(this);
- event.childID = osChild;
- for (int i = 0; i < accessibleControlListeners.size(); i++) {
- AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
- listener.getFocus(event);
- }
- Accessible accessible = event.accessible;
- if (accessible != null) {
- COM.MoveMemory(pvarChild, new short[] { COM.VT_DISPATCH }, 2);
- COM.MoveMemory(pvarChild + 8, new int[] { accessible.objIAccessible.getAddress() }, 4);
- return COM.S_OK;
- }
- int childID = event.childID;
- if (childID == ACC.CHILDID_NONE) {
- COM.MoveMemory(pvarChild, new short[] { COM.VT_EMPTY }, 2);
- return COM.S_FALSE;
- }
- if (childID == ACC.CHILDID_SELF) {
- COM.MoveMemory(pvarChild, new short[] { COM.VT_DISPATCH }, 2);
- COM.MoveMemory(pvarChild + 8, new int[] { objIAccessible.getAddress() }, 4);
- return COM.S_OK;
- }
- COM.MoveMemory(pvarChild, new short[] { COM.VT_I4 }, 2);
- COM.MoveMemory(pvarChild + 8, new int[] { childID + 1 }, 4);
- return COM.S_OK;
- }
-
- int get_accHelp(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszHelp) {
- if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
- if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG;
-
- /* Get the default help string from the OS. */
- String osHelp = null;
- int code = iaccessible.get_accHelp(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, pszHelp);
- if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
- if (accessibleListeners.size() == 0) return code;
- if (code == COM.S_OK) {
- int[] pHelp = new int[1];
- COM.MoveMemory(pHelp, pszHelp, 4);
- int size = COM.SysStringByteLen(pHelp[0]);
- if (size > 0) {
- char[] buffer = new char[(size + 1) /2];
- COM.MoveMemory(buffer, pHelp[0], size);
- osHelp = new String(buffer);
- }
- }
-
- AccessibleEvent event = new AccessibleEvent(this);
- if (varChild_lVal == COM.CHILDID_SELF) event.childID = ACC.CHILDID_SELF;
- else if (control instanceof Tree) event.childID = varChild_lVal; // Tree item childIDs are pointers
- else event.childID = varChild_lVal - 1; // All other childIDs are 1-based indices
- event.result = osHelp;
- for (int i = 0; i < accessibleListeners.size(); i++) {
- AccessibleListener listener = (AccessibleListener) accessibleListeners.elementAt(i);
- listener.getHelp(event);
- }
- if (event.result == null) return code;
- char[] data = (event.result + "\0").toCharArray();
- int ptr = COM.SysAllocString(data);
- COM.MoveMemory(pszHelp, new int[] { ptr }, 4);
- return COM.S_OK;
- }
-
- int get_accHelpTopic(int pszHelpFile, int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pidTopic) {
- if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
- // Currently, we don't let the application override this. Forward to the proxy.
- int code = iaccessible.get_accHelpTopic(pszHelpFile, varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, pidTopic);
- if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
- return code;
- }
-
- int get_accKeyboardShortcut(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszKeyboardShortcut) {
- if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
- if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG;
-
- /* Get the default keyboard shortcut from the OS. */
- String osKeyboardShortcut = null;
- int code = iaccessible.get_accKeyboardShortcut(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, pszKeyboardShortcut);
- if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
- if (accessibleListeners.size() == 0) return code;
- if (code == COM.S_OK) {
- int[] pKeyboardShortcut = new int[1];
- COM.MoveMemory(pKeyboardShortcut, pszKeyboardShortcut, 4);
- int size = COM.SysStringByteLen(pKeyboardShortcut[0]);
- if (size > 0) {
- char[] buffer = new char[(size + 1) /2];
- COM.MoveMemory(buffer, pKeyboardShortcut[0], size);
- osKeyboardShortcut = new String(buffer);
- }
- }
-
- AccessibleEvent event = new AccessibleEvent(this);
- if (varChild_lVal == COM.CHILDID_SELF) event.childID = ACC.CHILDID_SELF;
- else if (control instanceof Tree) event.childID = varChild_lVal; // Tree item childIDs are pointers
- else event.childID = varChild_lVal - 1; // All other childIDs are 1-based indices
- event.result = osKeyboardShortcut;
- for (int i = 0; i < accessibleListeners.size(); i++) {
- AccessibleListener listener = (AccessibleListener) accessibleListeners.elementAt(i);
- listener.getKeyboardShortcut(event);
- }
- if (event.result == null) return code;
- char[] data = (event.result + "\0").toCharArray();
- int ptr = COM.SysAllocString(data);
- COM.MoveMemory(pszKeyboardShortcut, new int[] { ptr }, 4);
- return COM.S_OK;
- }
-
- int get_accName(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszName) {
- if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
- if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG;
-
- /* Get the default name from the OS. */
- String osName = null;
- int code = iaccessible.get_accName(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, pszName);
- if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
- if (accessibleListeners.size() == 0) return code;
- if (code == COM.S_OK) {
- int[] pName = new int[1];
- COM.MoveMemory(pName, pszName, 4);
- int size = COM.SysStringByteLen(pName[0]);
- if (size > 0) {
- char[] buffer = new char[(size + 1) /2];
- COM.MoveMemory(buffer, pName[0], size);
- osName = new String(buffer);
- }
- }
-
- AccessibleEvent event = new AccessibleEvent(this);
- if (varChild_lVal == COM.CHILDID_SELF) event.childID = ACC.CHILDID_SELF;
- else if (control instanceof Tree) event.childID = varChild_lVal; // Tree item childIDs are pointers
- else event.childID = varChild_lVal - 1; // All other childIDs are 1-based indices
- event.result = osName;
- for (int i = 0; i < accessibleListeners.size(); i++) {
- AccessibleListener listener = (AccessibleListener) accessibleListeners.elementAt(i);
- listener.getName(event);
- }
- if (event.result == null) return code;
- char[] data = (event.result + "\0").toCharArray();
- int ptr = COM.SysAllocString(data);
- COM.MoveMemory(pszName, new int[] { ptr }, 4);
- return COM.S_OK;
- }
-
- int get_accParent(int ppdispParent) {
- if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
- // Currently, we don't let the application override this. Forward to the proxy.
- return iaccessible.get_accParent(ppdispParent);
- }
-
- int get_accRole(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pvarRole) {
- if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
- if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG;
-
- /* Get the default role from the OS. */
- int osRole = COM.ROLE_SYSTEM_CLIENT;
- int code = iaccessible.get_accRole(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, pvarRole);
- if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
- // TEMPORARY CODE - process tree and table even if there are no apps listening
- if (accessibleControlListeners.size() == 0 && !(control instanceof Tree || control instanceof Table)) return code;
- if (code == COM.S_OK) {
- short[] pvt = new short[1];
- COM.MoveMemory(pvt, pvarRole, 2);
- if (pvt[0] == COM.VT_I4) {
- int[] pRole = new int[1];
- COM.MoveMemory(pRole, pvarRole + 8, 4);
- osRole = pRole[0];
- }
- }
-
- AccessibleControlEvent event = new AccessibleControlEvent(this);
- event.detail = osToRole(osRole);
- if (varChild_lVal == COM.CHILDID_SELF) {
- event.childID = ACC.CHILDID_SELF;
- } else {
- if (control instanceof Tree) {
- /* Tree item childIDs are pointers (not 1-based indices). */
- event.childID = varChild_lVal;
-
- // TEMPORARY CODE
- /* Currently our checkbox tree is emulated using state mask images,
- * so we need to specify 'checkbox' role for the items here. */
- if ((control.getStyle() & SWT.CHECK) != 0) event.detail = ACC.ROLE_CHECKBUTTON;
- } else if (control instanceof Table) {
- event.childID = varChild_lVal - 1;
-
- // TEMPORARY CODE
- /* Currently our checkbox table is emulated using state mask images,
- * so we need to specify 'checkbox' role for the items here. */
- if ((control.getStyle() & SWT.CHECK) != 0) event.detail = ACC.ROLE_CHECKBUTTON;
- } else {
- event.childID = varChild_lVal - 1;
- }
- }
- for (int i = 0; i < accessibleControlListeners.size(); i++) {
- AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
- listener.getRole(event);
- }
- int role = roleToOs(event.detail);
- COM.MoveMemory(pvarRole, new short[] { COM.VT_I4 }, 2);
- COM.MoveMemory(pvarRole + 8, new int[] { role }, 4);
- return COM.S_OK;
- }
-
- int get_accSelection(int pvarChildren) {
- if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
-
- /* Get the default selection from the OS. */
- int osChild = ACC.CHILDID_NONE;
- int code = iaccessible.get_accSelection(pvarChildren);
- if (accessibleControlListeners.size() == 0) return code;
- if (code == COM.S_OK) {
- short[] pvt = new short[1];
- COM.MoveMemory(pvt, pvarChildren, 2);
- if (pvt[0] == COM.VT_I4) {
- int[] pChild = new int[1];
- COM.MoveMemory(pChild, pvarChildren + 8, 4);
- osChild = (pChild[0] == COM.CHILDID_SELF) ? ACC.CHILDID_SELF : pChild[0] - 1;
- } else if (pvt[0] == COM.VT_UNKNOWN) {
- osChild = ACC.CHILDID_MULTIPLE;
- /* Should get IEnumVARIANT from punkVal field... need better API here... */
- }
- }
-
- AccessibleControlEvent event = new AccessibleControlEvent(this);
- event.childID = osChild;
- for (int i = 0; i < accessibleControlListeners.size(); i++) {
- AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
- listener.getSelection(event);
- }
- Accessible accessible = event.accessible;
- if (accessible != null) {
- COM.MoveMemory(pvarChildren, new short[] { COM.VT_DISPATCH }, 2);
- COM.MoveMemory(pvarChildren + 8, new int[] { accessible.objIAccessible.getAddress() }, 4);
- return COM.S_OK;
- }
- int childID = event.childID;
- if (childID == ACC.CHILDID_NONE) {
- COM.MoveMemory(pvarChildren, new short[] { COM.VT_EMPTY }, 2);
- return COM.S_FALSE;
- }
- if (childID == ACC.CHILDID_MULTIPLE) {
- COM.MoveMemory(pvarChildren, new short[] { COM.VT_UNKNOWN }, 2);
- /* Should return an IEnumVARIANT for this... so the next line is wrong... need better API here... */
- COM.MoveMemory(pvarChildren + 8, new int[] { objIAccessible.getAddress() }, 4);
- return COM.S_OK;
- }
- if (childID == ACC.CHILDID_SELF) {
- COM.MoveMemory(pvarChildren, new short[] { COM.VT_DISPATCH }, 2);
- COM.MoveMemory(pvarChildren + 8, new int[] { objIAccessible.getAddress() }, 4);
- return COM.S_OK;
- }
- COM.MoveMemory(pvarChildren, new short[] { COM.VT_I4 }, 2);
- COM.MoveMemory(pvarChildren + 8, new int[] { childID + 1 }, 4);
- return COM.S_OK;
- }
-
- int get_accState(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pvarState) {
- if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
- if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG;
-
- /* Get the default state from the OS. */
- int osState = 0;
- int code = iaccessible.get_accState(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, pvarState);
- if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
- // TEMPORARY CODE - process tree and table even if there are no apps listening
- if (accessibleControlListeners.size() == 0 && !(control instanceof Tree || control instanceof Table)) return code;
- if (code == COM.S_OK) {
- short[] pvt = new short[1];
- COM.MoveMemory(pvt, pvarState, 2);
- if (pvt[0] == COM.VT_I4) {
- int[] pState = new int[1];
- COM.MoveMemory(pState, pvarState + 8, 4);
- osState = pState[0];
- }
- }
-
- AccessibleControlEvent event = new AccessibleControlEvent(this);
- event.detail = osToState(osState);
- if (varChild_lVal == COM.CHILDID_SELF) {
- event.childID = ACC.CHILDID_SELF;
- } else {
- if (control instanceof Tree) {
- /* Tree item childIDs are pointers (not 1-based indices). */
- event.childID = varChild_lVal;
-
- // TEMPORARY CODE
- /* Currently our checkbox tree is emulated using state mask images,
- * so we need to determine if the item is 'checked' here. */
- int hwnd = control.handle;
- TVITEM tvItem = new TVITEM ();
- tvItem.mask = OS.TVIF_HANDLE | OS.TVIF_STATE;
- tvItem.hItem = varChild_lVal;
- tvItem.stateMask = OS.TVIS_STATEIMAGEMASK;
- int result = OS.SendMessage (hwnd, OS.TVM_GETITEM, 0, tvItem);
- boolean checked = (result != 0) && (((tvItem.state >> 12) & 1) == 0);
- if (checked) event.detail |= ACC.STATE_CHECKED;
- } else if (control instanceof Table) {
- event.childID = varChild_lVal - 1;
-
- // TEMPORARY CODE
- /* Currently our checkbox table is emulated using state mask images,
- * so we need to determine if the item is 'checked' here. */
- Table table = (Table) control;
- TableItem item = table.getItem(event.childID);
- if (item != null) {
- if (item.getChecked()) event.detail |= ACC.STATE_CHECKED;
- }
- } else {
- event.childID = varChild_lVal - 1;
- }
- }
- for (int i = 0; i < accessibleControlListeners.size(); i++) {
- AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
- listener.getState(event);
- }
- int state = stateToOs(event.detail);
- COM.MoveMemory(pvarState, new short[] { COM.VT_I4 }, 2);
- COM.MoveMemory(pvarState + 8, new int[] { state }, 4);
- return COM.S_OK;
- }
-
- int get_accValue(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszValue) {
- if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
- if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG;
-
- /* Get the default value string from the OS. */
- String osValue = null;
- int code = iaccessible.get_accValue(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, pszValue);
- if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
- if (accessibleControlListeners.size() == 0) return code;
- if (code == COM.S_OK) {
- int[] pValue = new int[1];
- COM.MoveMemory(pValue, pszValue, 4);
- int size = COM.SysStringByteLen(pValue[0]);
- if (size > 0) {
- char[] buffer = new char[(size + 1) /2];
- COM.MoveMemory(buffer, pValue[0], size);
- osValue = new String(buffer);
- }
- }
-
- AccessibleControlEvent event = new AccessibleControlEvent(this);
- if (varChild_lVal == COM.CHILDID_SELF) event.childID = ACC.CHILDID_SELF;
- else if (control instanceof Tree) event.childID = varChild_lVal; // Tree item childIDs are pointers
- else event.childID = varChild_lVal - 1; // All other childIDs are 1-based indices
- event.result = osValue;
- for (int i = 0; i < accessibleControlListeners.size(); i++) {
- AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
- listener.getValue(event);
- }
- if (event.result == null) return code;
- char[] data = (event.result + "\0").toCharArray();
- int ptr = COM.SysAllocString(data);
- COM.MoveMemory(pszValue, new int[] { ptr }, 4);
- return COM.S_OK;
- }
-
- int put_accName(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int szName) {
- // MSAA: this method is no longer supported
- if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
- // We don't implement this. Forward to the proxy.
- int code = iaccessible.put_accName(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, szName);
- if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
- return code;
- }
-
- int put_accValue(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int szValue) {
- // MSAA: this method is typically only used for edit controls
- if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
- // We don't implement this. Forward to the proxy.
- int code = iaccessible.put_accValue(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, szValue);
- if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
- return code;
- }
-
- /* IEnumVARIANT methods: Next, Skip, Reset */
- /* Retrieve the next celt items in the enumeration sequence.
- * If there are fewer than the requested number of elements left
- * in the sequence, retrieve the remaining elements.
- * The number of elements actually retrieved is returned in pceltFetched
- * (unless the caller passed in NULL for that parameter).
- */
- int Next(int celt, int rgvar, int pceltFetched) {
- /* If there are no listeners, query the proxy for
- * its IEnumVariant, and get the Next items from it.
- */
- if (accessibleControlListeners.size() == 0) {
- int[] ppvObject = new int[1];
- int code = iaccessible.QueryInterface(COM.IIDIEnumVARIANT, ppvObject);
- if (code != COM.S_OK) return code;
- IEnumVARIANT ienumvariant = new IEnumVARIANT(ppvObject[0]);
- int[] celtFetched = new int[1];
- code = ienumvariant.Next(celt, rgvar, celtFetched);
- COM.MoveMemory(pceltFetched, celtFetched, 4);
- return code;
- }
-
- if (rgvar == 0) return COM.E_INVALIDARG;
- if (pceltFetched == 0 && celt != 1) return COM.E_INVALIDARG;
- if (enumIndex == 0) {
- AccessibleControlEvent event = new AccessibleControlEvent(this);
- event.childID = ACC.CHILDID_SELF;
- for (int i = 0; i < accessibleControlListeners.size(); i++) {
- AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
- listener.getChildren(event);
- }
- variants = event.children;
- }
- Object[] nextItems = null;
- if (variants != null && celt >= 1) {
- int endIndex = enumIndex + celt - 1;
- if (endIndex > (variants.length - 1)) endIndex = variants.length - 1;
- if (enumIndex <= endIndex) {
- nextItems = new Object[endIndex - enumIndex + 1];
- for (int i = 0; i < nextItems.length; i++) {
- Object child = variants[enumIndex];
- if (child instanceof Integer) {
- nextItems[i] = new Integer(((Integer)child).intValue() + 1);
- } else {
- nextItems[i] = child;
- }
- enumIndex++;
- }
- }
- }
- if (nextItems != null) {
- for (int i = 0; i < nextItems.length; i++) {
- Object nextItem = nextItems[i];
- if (nextItem instanceof Integer) {
- int item = ((Integer) nextItem).intValue();
- COM.MoveMemory(rgvar + i * 16, new short[] { COM.VT_I4 }, 2);
- COM.MoveMemory(rgvar + i * 16 + 8, new int[] { item }, 4);
- } else {
- int address = ((Accessible) nextItem).objIAccessible.getAddress();
- COM.MoveMemory(rgvar + i * 16, new short[] { COM.VT_DISPATCH }, 2);
- COM.MoveMemory(rgvar + i * 16 + 8, new int[] { address }, 4);
- }
- }
- if (pceltFetched != 0)
- COM.MoveMemory(pceltFetched, new int[] {nextItems.length}, 4);
- if (nextItems.length == celt) return COM.S_OK;
- } else {
- if (pceltFetched != 0)
- COM.MoveMemory(pceltFetched, new int[] {0}, 4);
- }
- return COM.S_FALSE;
- }
-
- /* Skip over the specified number of elements in the enumeration sequence. */
- int Skip(int celt) {
- /* If there are no listeners, query the proxy
- * for its IEnumVariant, and tell it to Skip.
- */
- if (accessibleControlListeners.size() == 0) {
- int[] ppvObject = new int[1];
- int code = iaccessible.QueryInterface(COM.IIDIEnumVARIANT, ppvObject);
- if (code != COM.S_OK) return code;
- IEnumVARIANT ienumvariant = new IEnumVARIANT(ppvObject[0]);
- code = ienumvariant.Skip(celt);
- return code;
- }
-
- if (celt < 1 ) return COM.E_INVALIDARG;
- enumIndex += celt;
- if (enumIndex > (variants.length - 1)) {
- enumIndex = variants.length - 1;
- return COM.S_FALSE;
- }
- return COM.S_OK;
- }
-
- /* Reset the enumeration sequence to the beginning. */
- int Reset() {
- /* If there are no listeners, query the proxy
- * for its IEnumVariant, and tell it to Reset.
- */
- if (accessibleControlListeners.size() == 0) {
- int[] ppvObject = new int[1];
- int code = iaccessible.QueryInterface(COM.IIDIEnumVARIANT, ppvObject);
- if (code != COM.S_OK) return code;
- IEnumVARIANT ienumvariant = new IEnumVARIANT(ppvObject[0]);
- code = ienumvariant.Reset();
- return code;
- }
-
- enumIndex = 0;
- return COM.S_OK;
- }
-
- int stateToOs(int state) {
- int osState = 0;
- if ((state & ACC.STATE_SELECTED) != 0) osState |= COM.STATE_SYSTEM_SELECTED;
- if ((state & ACC.STATE_SELECTABLE) != 0) osState |= COM.STATE_SYSTEM_SELECTABLE;
- if ((state & ACC.STATE_MULTISELECTABLE) != 0) osState |= COM.STATE_SYSTEM_MULTISELECTABLE;
- if ((state & ACC.STATE_FOCUSED) != 0) osState |= COM.STATE_SYSTEM_FOCUSED;
- if ((state & ACC.STATE_FOCUSABLE) != 0) osState |= COM.STATE_SYSTEM_FOCUSABLE;
- if ((state & ACC.STATE_PRESSED) != 0) osState |= COM.STATE_SYSTEM_PRESSED;
- if ((state & ACC.STATE_CHECKED) != 0) osState |= COM.STATE_SYSTEM_CHECKED;
- if ((state & ACC.STATE_EXPANDED) != 0) osState |= COM.STATE_SYSTEM_EXPANDED;
- if ((state & ACC.STATE_COLLAPSED) != 0) osState |= COM.STATE_SYSTEM_COLLAPSED;
- if ((state & ACC.STATE_HOTTRACKED) != 0) osState |= COM.STATE_SYSTEM_HOTTRACKED;
- if ((state & ACC.STATE_BUSY) != 0) osState |= COM.STATE_SYSTEM_BUSY;
- if ((state & ACC.STATE_READONLY) != 0) osState |= COM.STATE_SYSTEM_READONLY;
- if ((state & ACC.STATE_INVISIBLE) != 0) osState |= COM.STATE_SYSTEM_INVISIBLE;
- if ((state & ACC.STATE_OFFSCREEN) != 0) osState |= COM.STATE_SYSTEM_OFFSCREEN;
- if ((state & ACC.STATE_SIZEABLE) != 0) osState |= COM.STATE_SYSTEM_SIZEABLE;
- return osState;
- }
-
- int osToState(int osState) {
- int state = ACC.STATE_NORMAL;
- if ((osState & COM.STATE_SYSTEM_SELECTED) != 0) state |= ACC.STATE_SELECTED;
- if ((osState & COM.STATE_SYSTEM_SELECTABLE) != 0) state |= ACC.STATE_SELECTABLE;
- if ((osState & COM.STATE_SYSTEM_MULTISELECTABLE) != 0) state |= ACC.STATE_MULTISELECTABLE;
- if ((osState & COM.STATE_SYSTEM_FOCUSED) != 0) state |= ACC.STATE_FOCUSED;
- if ((osState & COM.STATE_SYSTEM_FOCUSABLE) != 0) state |= ACC.STATE_FOCUSABLE;
- if ((osState & COM.STATE_SYSTEM_PRESSED) != 0) state |= ACC.STATE_PRESSED;
- if ((osState & COM.STATE_SYSTEM_CHECKED) != 0) state |= ACC.STATE_CHECKED;
- if ((osState & COM.STATE_SYSTEM_EXPANDED) != 0) state |= ACC.STATE_EXPANDED;
- if ((osState & COM.STATE_SYSTEM_COLLAPSED) != 0) state |= ACC.STATE_COLLAPSED;
- if ((osState & COM.STATE_SYSTEM_HOTTRACKED) != 0) state |= ACC.STATE_HOTTRACKED;
- if ((osState & COM.STATE_SYSTEM_BUSY) != 0) state |= ACC.STATE_BUSY;
- if ((osState & COM.STATE_SYSTEM_READONLY) != 0) state |= ACC.STATE_READONLY;
- if ((osState & COM.STATE_SYSTEM_INVISIBLE) != 0) state |= ACC.STATE_INVISIBLE;
- if ((osState & COM.STATE_SYSTEM_OFFSCREEN) != 0) state |= ACC.STATE_OFFSCREEN;
- if ((osState & COM.STATE_SYSTEM_SIZEABLE) != 0) state |= ACC.STATE_SIZEABLE;
- return state;
- }
-
- int roleToOs(int role) {
- switch (role) {
- case ACC.ROLE_CLIENT_AREA: return COM.ROLE_SYSTEM_CLIENT;
- case ACC.ROLE_WINDOW: return COM.ROLE_SYSTEM_WINDOW;
- case ACC.ROLE_MENUBAR: return COM.ROLE_SYSTEM_MENUBAR;
- case ACC.ROLE_MENU: return COM.ROLE_SYSTEM_MENUPOPUP;
- case ACC.ROLE_MENUITEM: return COM.ROLE_SYSTEM_MENUITEM;
- case ACC.ROLE_SEPARATOR: return COM.ROLE_SYSTEM_SEPARATOR;
- case ACC.ROLE_TOOLTIP: return COM.ROLE_SYSTEM_TOOLTIP;
- case ACC.ROLE_SCROLLBAR: return COM.ROLE_SYSTEM_SCROLLBAR;
- case ACC.ROLE_DIALOG: return COM.ROLE_SYSTEM_DIALOG;
- case ACC.ROLE_LABEL: return COM.ROLE_SYSTEM_STATICTEXT;
- case ACC.ROLE_PUSHBUTTON: return COM.ROLE_SYSTEM_PUSHBUTTON;
- case ACC.ROLE_CHECKBUTTON: return COM.ROLE_SYSTEM_CHECKBUTTON;
- case ACC.ROLE_RADIOBUTTON: return COM.ROLE_SYSTEM_RADIOBUTTON;
- case ACC.ROLE_COMBOBOX: return COM.ROLE_SYSTEM_COMBOBOX;
- case ACC.ROLE_TEXT: return COM.ROLE_SYSTEM_TEXT;
- case ACC.ROLE_TOOLBAR: return COM.ROLE_SYSTEM_TOOLBAR;
- case ACC.ROLE_LIST: return COM.ROLE_SYSTEM_LIST;
- case ACC.ROLE_LISTITEM: return COM.ROLE_SYSTEM_LISTITEM;
- case ACC.ROLE_TABLE: return COM.ROLE_SYSTEM_TABLE;
- case ACC.ROLE_TABLECOLUMN: return COM.ROLE_SYSTEM_COLUMNHEADER;
- case ACC.ROLE_TREE: return COM.ROLE_SYSTEM_OUTLINE;
- case ACC.ROLE_TABFOLDER: return COM.ROLE_SYSTEM_PAGETABLIST;
- case ACC.ROLE_TABITEM: return COM.ROLE_SYSTEM_PAGETAB;
- case ACC.ROLE_PROGRESSBAR: return COM.ROLE_SYSTEM_PROGRESSBAR;
- case ACC.ROLE_SLIDER: return COM.ROLE_SYSTEM_SLIDER;
- }
- return COM.ROLE_SYSTEM_CLIENT;
- }
-
- int osToRole(int osRole) {
- int role = COM.ROLE_SYSTEM_CLIENT;
- switch (osRole) {
- case COM.ROLE_SYSTEM_CLIENT: return ACC.ROLE_CLIENT_AREA;
- case COM.ROLE_SYSTEM_WINDOW: return ACC.ROLE_WINDOW;
- case COM.ROLE_SYSTEM_MENUBAR: return ACC.ROLE_MENUBAR;
- case COM.ROLE_SYSTEM_MENUPOPUP: return ACC.ROLE_MENU;
- case COM.ROLE_SYSTEM_MENUITEM: return ACC.ROLE_MENUITEM;
- case COM.ROLE_SYSTEM_SEPARATOR: return ACC.ROLE_SEPARATOR;
- case COM.ROLE_SYSTEM_TOOLTIP: return ACC.ROLE_TOOLTIP;
- case COM.ROLE_SYSTEM_SCROLLBAR: return ACC.ROLE_SCROLLBAR;
- case COM.ROLE_SYSTEM_DIALOG: return ACC.ROLE_DIALOG;
- case COM.ROLE_SYSTEM_STATICTEXT: return ACC.ROLE_LABEL;
- case COM.ROLE_SYSTEM_PUSHBUTTON: return ACC.ROLE_PUSHBUTTON;
- case COM.ROLE_SYSTEM_CHECKBUTTON: return ACC.ROLE_CHECKBUTTON;
- case COM.ROLE_SYSTEM_RADIOBUTTON: return ACC.ROLE_RADIOBUTTON;
- case COM.ROLE_SYSTEM_COMBOBOX: return ACC.ROLE_COMBOBOX;
- case COM.ROLE_SYSTEM_TEXT: return ACC.ROLE_TEXT;
- case COM.ROLE_SYSTEM_TOOLBAR: return ACC.ROLE_TOOLBAR;
- case COM.ROLE_SYSTEM_LIST: return ACC.ROLE_LIST;
- case COM.ROLE_SYSTEM_LISTITEM: return ACC.ROLE_LISTITEM;
- case COM.ROLE_SYSTEM_TABLE: return ACC.ROLE_TABLE;
- case COM.ROLE_SYSTEM_COLUMNHEADER: return ACC.ROLE_TABLECOLUMN;
- case COM.ROLE_SYSTEM_OUTLINE: return ACC.ROLE_TREE;
- case COM.ROLE_SYSTEM_PAGETABLIST: return ACC.ROLE_TABFOLDER;
- case COM.ROLE_SYSTEM_PAGETAB: return ACC.ROLE_TABITEM;
- case COM.ROLE_SYSTEM_PROGRESSBAR: return ACC.ROLE_PROGRESSBAR;
- case COM.ROLE_SYSTEM_SLIDER: return ACC.ROLE_SLIDER;
- }
- return role;
- }
-
- /* checkWidget was copied from Widget, and rewritten to work in this package */
- void checkWidget () {
- if (!isValidThread ()) SWT.error (SWT.ERROR_THREAD_INVALID_ACCESS);
- if (control.isDisposed ()) SWT.error (SWT.ERROR_WIDGET_DISPOSED);
- }
-
- /* isValidThread was copied from Widget, and rewritten to work in this package */
- boolean isValidThread () {
- return control.getDisplay ().getThread () == Thread.currentThread ();
- }
-}
+ * http://www.eclipse.org/legal/cpl-v10.html
+ */
+
+import java.util.Vector;
+import org.eclipse.swt.*;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.internal.win32.*;
+import org.eclipse.swt.ole.win32.*;
+import org.eclipse.swt.internal.ole.win32.*;
+
+/**
+ * Instances of this class provide a bridge between application
+ * code and assistive technology clients. Many platforms provide
+ * default accessible behavior for most widgets, and this class
+ * allows that default behavior to be overridden. Applications
+ * can get the default Accessible object for a control by sending
+ * it <code>getAccessible</code>, and then add an accessible listener
+ * to override simple items like the name and help string, or they
+ * can add an accessible control listener to override complex items.
+ * As a rule of thumb, an application would only want to use the
+ * accessible control listener to implement accessibility for a
+ * custom control.
+ *
+ * @see Control#getAccessible
+ * @see AccessibleListener
+ * @see AccessibleEvent
+ * @see AccessibleControlListener
+ * @see AccessibleControlEvent
+ *
+ * @since 2.0
+ */
+public class Accessible {
+ int refCount = 0, enumIndex = 0;
+ COMObject objIAccessible, objIEnumVARIANT;
+ IAccessible iaccessible;
+ Vector accessibleListeners = new Vector(), accessibleControlListeners = new Vector();
+ Object[] variants;
+ Control control;
+
+ Accessible(Control control) {
+ this.control = control;
+ int[] ppvObject = new int[1];
+ int result = COM.CreateStdAccessibleObject(control.handle, COM.OBJID_CLIENT, COM.IIDIAccessible, ppvObject);
+ if (result == COM.E_NOTIMPL) return;
+ if (result != COM.S_OK) OLE.error(OLE.ERROR_CANNOT_CREATE_OBJECT, result);
+ iaccessible = new IAccessible(ppvObject[0]);
+ iaccessible.AddRef();
+
+ objIAccessible = new COMObject(new int[] {2,0,0,1,3,5,8,1,1,5,5,5,5,5,5,5,6,5,1,1,5,5,8,6,3,4,5,5}) {
+ public int method0(int[] args) {return QueryInterface(args[0], args[1]);}
+ public int method1(int[] args) {return AddRef();}
+ public int method2(int[] args) {return Release();}
+ // method3 GetTypeInfoCount - not implemented
+ // method4 GetTypeInfo - not implemented
+ // method5 GetIDsOfNames - not implemented
+ // method6 Invoke - not implemented
+ public int method7(int[] args) {return get_accParent(args[0]);}
+ public int method8(int[] args) {return get_accChildCount(args[0]);}
+ public int method9(int[] args) {return get_accChild(args[0], args[1], args[2], args[3], args[4]);}
+ public int method10(int[] args) {return get_accName(args[0], args[1], args[2], args[3], args[4]);}
+ public int method11(int[] args) {return get_accValue(args[0], args[1], args[2], args[3], args[4]);}
+ public int method12(int[] args) {return get_accDescription(args[0], args[1], args[2], args[3], args[4]);}
+ public int method13(int[] args) {return get_accRole(args[0], args[1], args[2], args[3], args[4]);}
+ public int method14(int[] args) {return get_accState(args[0], args[1], args[2], args[3], args[4]);}
+ public int method15(int[] args) {return get_accHelp(args[0], args[1], args[2], args[3], args[4]);}
+ public int method16(int[] args) {return get_accHelpTopic(args[0], args[1], args[2], args[3], args[4], args[5]);}
+ public int method17(int[] args) {return get_accKeyboardShortcut(args[0], args[1], args[2], args[3], args[4]);}
+ public int method18(int[] args) {return get_accFocus(args[0]);}
+ public int method19(int[] args) {return get_accSelection(args[0]);}
+ public int method20(int[] args) {return get_accDefaultAction(args[0], args[1], args[2], args[3], args[4]);}
+ public int method21(int[] args) {return accSelect(args[0], args[1], args[2], args[3], args[4]);}
+ public int method22(int[] args) {return accLocation(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]);}
+ public int method23(int[] args) {return accNavigate(args[0], args[1], args[2], args[3], args[4], args[5]);}
+ public int method24(int[] args) {return accHitTest(args[0], args[1], args[2]);}
+ public int method25(int[] args) {return accDoDefaultAction(args[0], args[1], args[2], args[3]);}
+ public int method26(int[] args) {return put_accName(args[0], args[1], args[2], args[3], args[4]);}
+ public int method27(int[] args) {return put_accValue(args[0], args[1], args[2], args[3], args[4]);}
+ };
+
+ objIEnumVARIANT = new COMObject(new int[] {2,0,0,3,1,0,1}) {
+ public int method0(int[] args) {return QueryInterface(args[0], args[1]);}
+ public int method1(int[] args) {return AddRef();}
+ public int method2(int[] args) {return Release();}
+ public int method3(int[] args) {return Next(args[0], args[1], args[2]);}
+ public int method4(int[] args) {return Skip(args[0]);}
+ public int method5(int[] args) {return Reset();}
+ // method6 Clone - not implemented
+ };
+ AddRef();
+ }
+
+ /**
+ * Invokes platform specific functionality to allocate a new accessible object.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Accessible</code>. 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 called from
+ * application code.
+ * </p>
+ *
+ * @param control the control to get the accessible object for
+ * @return the platform specific accessible object
+ *
+ * @private
+ */
+ public static Accessible internal_new_Accessible(Control control) {
+ return new Accessible(control);
+ }
+
+ /**
+ * Adds the listener to the collection of listeners who will
+ * be notifed when an accessible client asks for certain strings,
+ * such as name, description, help, or keyboard shortcut. The
+ * listener is notified by sending it one of the messages defined
+ * in the <code>AccessibleListener</code> interface.
+ *
+ * @param listener the listener that should be notified when the receiver
+ * is asked for a name, description, help, or keyboard shortcut string
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
+ * </ul>
+ *
+ * @see AccessibleListener
+ * @see #removeAccessibleListener
+ */
+ public void addAccessibleListener(AccessibleListener listener) {
+ checkWidget();
+ if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ accessibleListeners.addElement(listener);
+ }
+
+ /**
+ * Removes the listener from the collection of listeners who will
+ * be notifed when an accessible client asks for certain strings,
+ * such as name, description, help, or keyboard shortcut.
+ *
+ * @param listener the listener that should no longer be notified when the receiver
+ * is asked for a name, description, help, or keyboard shortcut string
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
+ * </ul>
+ *
+ * @see AccessibleListener
+ * @see #addDisposeListener
+ */
+ public void removeAccessibleListener(AccessibleListener listener) {
+ checkWidget();
+ if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ accessibleListeners.removeElement(listener);
+ }
+
+ /**
+ * Adds the listener to the collection of listeners who will
+ * be notifed when an accessible client asks for custom control
+ * specific information. The listener is notified by sending it
+ * one of the messages defined in the <code>AccessibleControlListener</code>
+ * interface.
+ *
+ * @param listener the listener that should be notified when the receiver
+ * is asked for custom control specific information
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
+ * </ul>
+ *
+ * @see AccessibleControlListener
+ * @see #removeAccessibleControlListener
+ */
+ public void addAccessibleControlListener(AccessibleControlListener listener) {
+ checkWidget();
+ if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ accessibleControlListeners.addElement(listener);
+ }
+
+ /**
+ * Removes the listener from the collection of listeners who will
+ * be notifed when an accessible client asks for custom control
+ * specific information.
+ *
+ * @param listener the listener that should no longer be notified when the receiver
+ * is asked for custom control specific information
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
+ * </ul>
+ *
+ * @see AccessibleControlListener
+ * @see #addAccessibleControlListener
+ */
+ public void removeAccessibleControlListener(AccessibleControlListener listener) {
+ checkWidget();
+ if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ accessibleControlListeners.removeElement(listener);
+ }
+
+ /**
+ * Sends a message to accessible clients indicating that the focus
+ * has changed within a custom control.
+ *
+ * @param childID an identifier specifying a child of the control
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
+ * </ul>
+ */
+ public void setFocus(int childID) {
+ checkWidget();
+ int id;
+ if (childID == ACC.CHILDID_SELF) id = COM.CHILDID_SELF;
+ else if (control instanceof Tree) id = childID; // Tree item childIDs are pointers
+ else id = childID + 1; // All other childIDs are 1-based indices
+ COM.NotifyWinEvent (COM.EVENT_OBJECT_FOCUS, control.handle, COM.OBJID_CLIENT, id);
+ }
+
+ /**
+ * Invokes platform specific functionality to dispose an accessible object.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Accessible</code>. 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 called from
+ * application code.
+ * </p>
+ *
+ * @private
+ */
+ public void internal_dispose_Accessible() {
+ if (iaccessible != null)
+ iaccessible.Release();
+ iaccessible = null;
+ Release();
+ }
+
+ /**
+ * Invokes platform specific functionality to handle a window message.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Accessible</code>. 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 called from
+ * application code.
+ * </p>
+ *
+ * @private
+ */
+ public int internal_WM_GETOBJECT (int wParam, int lParam) {
+ if (objIAccessible == null) return 0;
+ if (lParam == COM.OBJID_CLIENT) {
+ return COM.LresultFromObject(COM.IIDIAccessible, wParam, objIAccessible.getAddress());
+ }
+ return 0;
+ }
+
+ int QueryInterface(int arg1, int arg2) {
+ if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
+ GUID guid = new GUID();
+ COM.MoveMemory(guid, arg1, GUID.sizeof);
+
+ if (COM.IsEqualGUID(guid, COM.IIDIUnknown)) {
+ COM.MoveMemory(arg2, new int[] { objIAccessible.getAddress()}, 4);
+ AddRef();
+ return COM.S_OK;
+ }
+
+ if (COM.IsEqualGUID(guid, COM.IIDIDispatch)) {
+ COM.MoveMemory(arg2, new int[] { objIAccessible.getAddress()}, 4);
+ AddRef();
+ return COM.S_OK;
+ }
+
+ if (COM.IsEqualGUID(guid, COM.IIDIAccessible)) {
+ COM.MoveMemory(arg2, new int[] { objIAccessible.getAddress()}, 4);
+ AddRef();
+ return COM.S_OK;
+ }
+
+ if (COM.IsEqualGUID(guid, COM.IIDIEnumVARIANT)) {
+ COM.MoveMemory(arg2, new int[] { objIEnumVARIANT.getAddress()}, 4);
+ AddRef();
+ enumIndex = 0;
+ return COM.S_OK;
+ }
+
+ int[] ppvObject = new int[1];
+ int result = iaccessible.QueryInterface(guid, ppvObject);
+ COM.MoveMemory(arg2, ppvObject, 4);
+ return result;
+ }
+
+ int AddRef() {
+ refCount++;
+ return refCount;
+ }
+
+ int Release() {
+ refCount--;
+
+ if (refCount == 0) {
+ if (objIAccessible != null)
+ objIAccessible.dispose();
+ objIAccessible = null;
+
+ if (objIEnumVARIANT != null)
+ objIEnumVARIANT.dispose();
+ objIEnumVARIANT = null;
+ }
+ return refCount;
+ }
+
+ int accDoDefaultAction(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2) {
+ if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
+ // Currently, we don't let the application override this. Forward to the proxy.
+ int code = iaccessible.accDoDefaultAction(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2);
+ if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
+ return code;
+ }
+
+ int accHitTest(int xLeft, int yTop, int pvarChild) {
+ if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
+ if (accessibleControlListeners.size() == 0) {
+ return iaccessible.accHitTest(xLeft, yTop, pvarChild);
+ }
+
+ AccessibleControlEvent event = new AccessibleControlEvent(this);
+ event.childID = ACC.CHILDID_NONE;
+ event.x = xLeft;
+ event.y = yTop;
+ for (int i = 0; i < accessibleControlListeners.size(); i++) {
+ AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
+ listener.getChildAtPoint(event);
+ }
+ int childID = event.childID;
+ if (childID == ACC.CHILDID_NONE) {
+ return iaccessible.accHitTest(xLeft, yTop, pvarChild);
+ }
+ if (childID == ACC.CHILDID_SELF) childID = COM.CHILDID_SELF;
+ else if (!(control instanceof Tree)) childID++; // Tree item childIDs are pointers (not 1-based indices)
+ COM.MoveMemory(pvarChild, new short[] { COM.VT_I4 }, 2);
+ COM.MoveMemory(pvarChild + 8, new int[] { childID }, 4);
+ return COM.S_OK;
+ }
+
+ int accLocation(int pxLeft, int pyTop, int pcxWidth, int pcyHeight, int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2) {
+ if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
+ if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG;
+
+ /* Get the default location from the OS. */
+ int osLeft = 0, osTop = 0, osWidth = 0, osHeight = 0;
+ int code = iaccessible.accLocation(pxLeft, pyTop, pcxWidth, pcyHeight, varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2);
+ if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
+ if (accessibleControlListeners.size() == 0) return code;
+ if (code == COM.S_OK) {
+ int[] pLeft = new int[1], pTop = new int[1], pWidth = new int[1], pHeight = new int[1];
+ COM.MoveMemory(pLeft, pxLeft, 4);
+ COM.MoveMemory(pTop, pyTop, 4);
+ COM.MoveMemory(pWidth, pcxWidth, 4);
+ COM.MoveMemory(pHeight, pcyHeight, 4);
+ osLeft = pLeft[0]; osTop = pTop[0]; osWidth = pWidth[0]; osHeight = pHeight[0];
+ }
+
+ AccessibleControlEvent event = new AccessibleControlEvent(this);
+ if (varChild_lVal == COM.CHILDID_SELF) event.childID = ACC.CHILDID_SELF;
+ else if (control instanceof Tree) event.childID = varChild_lVal; // Tree item childIDs are pointers
+ else event.childID = varChild_lVal - 1; // All other childIDs are 1-based indices
+ event.x = osLeft;
+ event.y = osTop;
+ event.width = osWidth;
+ event.height = osHeight;
+ for (int i = 0; i < accessibleControlListeners.size(); i++) {
+ AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
+ listener.getLocation(event);
+ }
+ OS.MoveMemory(pxLeft, new int[] { event.x }, 4);
+ OS.MoveMemory(pyTop, new int[] { event.y }, 4);
+ OS.MoveMemory(pcxWidth, new int[] { event.width }, 4);
+ OS.MoveMemory(pcyHeight, new int[] { event.height }, 4);
+ return COM.S_OK;
+ }
+
+ int accNavigate(int navDir, int varStart_vt, int varStart_reserved1, int varStart_lVal, int varStart_reserved2, int pvarEndUpAt) {
+ if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
+ // Currently, we don't let the application override this. Forward to the proxy.
+ int code = iaccessible.accNavigate(navDir, varStart_vt, varStart_reserved1, varStart_lVal, varStart_reserved2, pvarEndUpAt);
+ if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
+ return code;
+ }
+
+ int accSelect(int flagsSelect, int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2) {
+ if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
+ // Currently, we don't let the application override this. Forward to the proxy.
+ int code = iaccessible.accSelect(flagsSelect, varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2);
+ if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
+ return code;
+ }
+
+ int get_accChild(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int ppdispChild) {
+ if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
+ if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG;
+ if (accessibleControlListeners.size() == 0) {
+ int code = iaccessible.get_accChild(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, ppdispChild);
+ if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
+ return code;
+ }
+
+ AccessibleControlEvent event = new AccessibleControlEvent(this);
+ if (varChild_lVal == COM.CHILDID_SELF) event.childID = ACC.CHILDID_SELF;
+ else if (control instanceof Tree) event.childID = varChild_lVal; // Tree item childIDs are pointers
+ else event.childID = varChild_lVal - 1; // All other childIDs are 1-based indices
+ for (int i = 0; i < accessibleControlListeners.size(); i++) {
+ AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
+ listener.getChild(event);
+ }
+ Accessible accessible = event.accessible;
+ if (accessible != null) {
+ COM.MoveMemory(ppdispChild, new int[] { accessible.objIAccessible.getAddress() }, 4);
+ return COM.S_OK;
+ }
+ return COM.S_FALSE;
+ }
+
+ int get_accChildCount(int pcountChildren) {
+ if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
+
+ /* Get the default child count from the OS. */
+ int osChildCount = 0;
+ int code = iaccessible.get_accChildCount(pcountChildren);
+ if (accessibleControlListeners.size() == 0) return code;
+ if (code == COM.S_OK) {
+ int[] pChildCount = new int[1];
+ COM.MoveMemory(pChildCount, pcountChildren, 4);
+ osChildCount = pChildCount[0];
+ }
+
+ AccessibleControlEvent event = new AccessibleControlEvent(this);
+ event.childID = ACC.CHILDID_SELF;
+ event.detail = osChildCount;
+ for (int i = 0; i < accessibleControlListeners.size(); i++) {
+ AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
+ listener.getChildCount(event);
+ }
+
+ COM.MoveMemory(pcountChildren, new int[] { event.detail }, 4);
+ return COM.S_OK;
+ }
+
+ int get_accDefaultAction(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszDefaultAction) {
+ if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
+ if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG;
+
+ /* Get the default defaultAction from the OS. */
+ String osDefaultAction = null;
+ int code = iaccessible.get_accDefaultAction(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, pszDefaultAction);
+ if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
+ if (accessibleControlListeners.size() == 0) return code;
+ if (code == COM.S_OK) {
+ int[] pDefaultAction = new int[1];
+ COM.MoveMemory(pDefaultAction, pszDefaultAction, 4);
+ int size = COM.SysStringByteLen(pDefaultAction[0]);
+ if (size > 0) {
+ char[] buffer = new char[(size + 1) /2];
+ COM.MoveMemory(buffer, pDefaultAction[0], size);
+ osDefaultAction = new String(buffer);
+ }
+ }
+
+ AccessibleControlEvent event = new AccessibleControlEvent(this);
+ if (varChild_lVal == COM.CHILDID_SELF) event.childID = ACC.CHILDID_SELF;
+ else if (control instanceof Tree) event.childID = varChild_lVal; // Tree item childIDs are pointers
+ else event.childID = varChild_lVal - 1; // All other childIDs are 1-based indices
+ event.result = osDefaultAction;
+ for (int i = 0; i < accessibleControlListeners.size(); i++) {
+ AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
+ listener.getDefaultAction(event);
+ }
+ if (event.result == null) return code;
+ char[] data = (event.result + "\0").toCharArray();
+ int ptr = COM.SysAllocString(data);
+ COM.MoveMemory(pszDefaultAction, new int[] { ptr }, 4);
+ return COM.S_OK;
+ }
+
+ int get_accDescription(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszDescription) {
+ if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
+ if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG;
+
+ /* Get the default description from the OS. */
+ String osDescription = null;
+ int code = iaccessible.get_accDescription(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, pszDescription);
+ if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
+ if (accessibleListeners.size() == 0) return code;
+ if (code == COM.S_OK) {
+ int[] pDescription = new int[1];
+ COM.MoveMemory(pDescription, pszDescription, 4);
+ int size = COM.SysStringByteLen(pDescription[0]);
+ if (size > 0) {
+ char[] buffer = new char[(size + 1) /2];
+ COM.MoveMemory(buffer, pDescription[0], size);
+ osDescription = new String(buffer);
+ }
+ }
+
+ AccessibleEvent event = new AccessibleEvent(this);
+ if (varChild_lVal == COM.CHILDID_SELF) event.childID = ACC.CHILDID_SELF;
+ else if (control instanceof Tree) event.childID = varChild_lVal; // Tree item childIDs are pointers
+ else event.childID = varChild_lVal - 1; // All other childIDs are 1-based indices
+ event.result = osDescription;
+ for (int i = 0; i < accessibleListeners.size(); i++) {
+ AccessibleListener listener = (AccessibleListener) accessibleListeners.elementAt(i);
+ listener.getDescription(event);
+ }
+ if (event.result == null) return code;
+ char[] data = (event.result + "\0").toCharArray();
+ int ptr = COM.SysAllocString(data);
+ COM.MoveMemory(pszDescription, new int[] { ptr }, 4);
+ return COM.S_OK;
+ }
+
+ int get_accFocus(int pvarChild) {
+ if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
+
+ /* Get the default focus child from the OS. */
+ int osChild = ACC.CHILDID_NONE;
+ int code = iaccessible.get_accFocus(pvarChild);
+ if (accessibleControlListeners.size() == 0) return code;
+ if (code == COM.S_OK) {
+ short[] pvt = new short[1];
+ COM.MoveMemory(pvt, pvarChild, 2);
+ if (pvt[0] == COM.VT_I4) {
+ int[] pChild = new int[1];
+ COM.MoveMemory(pChild, pvarChild + 8, 4);
+ osChild = (pChild[0] == COM.CHILDID_SELF) ? ACC.CHILDID_SELF : pChild[0] - 1;
+ }
+ }
+
+ AccessibleControlEvent event = new AccessibleControlEvent(this);
+ event.childID = osChild;
+ for (int i = 0; i < accessibleControlListeners.size(); i++) {
+ AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
+ listener.getFocus(event);
+ }
+ Accessible accessible = event.accessible;
+ if (accessible != null) {
+ COM.MoveMemory(pvarChild, new short[] { COM.VT_DISPATCH }, 2);
+ COM.MoveMemory(pvarChild + 8, new int[] { accessible.objIAccessible.getAddress() }, 4);
+ return COM.S_OK;
+ }
+ int childID = event.childID;
+ if (childID == ACC.CHILDID_NONE) {
+ COM.MoveMemory(pvarChild, new short[] { COM.VT_EMPTY }, 2);
+ return COM.S_FALSE;
+ }
+ if (childID == ACC.CHILDID_SELF) {
+ COM.MoveMemory(pvarChild, new short[] { COM.VT_DISPATCH }, 2);
+ COM.MoveMemory(pvarChild + 8, new int[] { objIAccessible.getAddress() }, 4);
+ return COM.S_OK;
+ }
+ COM.MoveMemory(pvarChild, new short[] { COM.VT_I4 }, 2);
+ COM.MoveMemory(pvarChild + 8, new int[] { childID + 1 }, 4);
+ return COM.S_OK;
+ }
+
+ int get_accHelp(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszHelp) {
+ if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
+ if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG;
+
+ /* Get the default help string from the OS. */
+ String osHelp = null;
+ int code = iaccessible.get_accHelp(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, pszHelp);
+ if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
+ if (accessibleListeners.size() == 0) return code;
+ if (code == COM.S_OK) {
+ int[] pHelp = new int[1];
+ COM.MoveMemory(pHelp, pszHelp, 4);
+ int size = COM.SysStringByteLen(pHelp[0]);
+ if (size > 0) {
+ char[] buffer = new char[(size + 1) /2];
+ COM.MoveMemory(buffer, pHelp[0], size);
+ osHelp = new String(buffer);
+ }
+ }
+
+ AccessibleEvent event = new AccessibleEvent(this);
+ if (varChild_lVal == COM.CHILDID_SELF) event.childID = ACC.CHILDID_SELF;
+ else if (control instanceof Tree) event.childID = varChild_lVal; // Tree item childIDs are pointers
+ else event.childID = varChild_lVal - 1; // All other childIDs are 1-based indices
+ event.result = osHelp;
+ for (int i = 0; i < accessibleListeners.size(); i++) {
+ AccessibleListener listener = (AccessibleListener) accessibleListeners.elementAt(i);
+ listener.getHelp(event);
+ }
+ if (event.result == null) return code;
+ char[] data = (event.result + "\0").toCharArray();
+ int ptr = COM.SysAllocString(data);
+ COM.MoveMemory(pszHelp, new int[] { ptr }, 4);
+ return COM.S_OK;
+ }
+
+ int get_accHelpTopic(int pszHelpFile, int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pidTopic) {
+ if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
+ // Currently, we don't let the application override this. Forward to the proxy.
+ int code = iaccessible.get_accHelpTopic(pszHelpFile, varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, pidTopic);
+ if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
+ return code;
+ }
+
+ int get_accKeyboardShortcut(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszKeyboardShortcut) {
+ if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
+ if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG;
+
+ /* Get the default keyboard shortcut from the OS. */
+ String osKeyboardShortcut = null;
+ int code = iaccessible.get_accKeyboardShortcut(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, pszKeyboardShortcut);
+ if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
+ if (accessibleListeners.size() == 0) return code;
+ if (code == COM.S_OK) {
+ int[] pKeyboardShortcut = new int[1];
+ COM.MoveMemory(pKeyboardShortcut, pszKeyboardShortcut, 4);
+ int size = COM.SysStringByteLen(pKeyboardShortcut[0]);
+ if (size > 0) {
+ char[] buffer = new char[(size + 1) /2];
+ COM.MoveMemory(buffer, pKeyboardShortcut[0], size);
+ osKeyboardShortcut = new String(buffer);
+ }
+ }
+
+ AccessibleEvent event = new AccessibleEvent(this);
+ if (varChild_lVal == COM.CHILDID_SELF) event.childID = ACC.CHILDID_SELF;
+ else if (control instanceof Tree) event.childID = varChild_lVal; // Tree item childIDs are pointers
+ else event.childID = varChild_lVal - 1; // All other childIDs are 1-based indices
+ event.result = osKeyboardShortcut;
+ for (int i = 0; i < accessibleListeners.size(); i++) {
+ AccessibleListener listener = (AccessibleListener) accessibleListeners.elementAt(i);
+ listener.getKeyboardShortcut(event);
+ }
+ if (event.result == null) return code;
+ char[] data = (event.result + "\0").toCharArray();
+ int ptr = COM.SysAllocString(data);
+ COM.MoveMemory(pszKeyboardShortcut, new int[] { ptr }, 4);
+ return COM.S_OK;
+ }
+
+ int get_accName(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszName) {
+ if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
+ if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG;
+
+ /* Get the default name from the OS. */
+ String osName = null;
+ int code = iaccessible.get_accName(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, pszName);
+ if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
+ if (accessibleListeners.size() == 0) return code;
+ if (code == COM.S_OK) {
+ int[] pName = new int[1];
+ COM.MoveMemory(pName, pszName, 4);
+ int size = COM.SysStringByteLen(pName[0]);
+ if (size > 0) {
+ char[] buffer = new char[(size + 1) /2];
+ COM.MoveMemory(buffer, pName[0], size);
+ osName = new String(buffer);
+ }
+ }
+
+ AccessibleEvent event = new AccessibleEvent(this);
+ if (varChild_lVal == COM.CHILDID_SELF) event.childID = ACC.CHILDID_SELF;
+ else if (control instanceof Tree) event.childID = varChild_lVal; // Tree item childIDs are pointers
+ else event.childID = varChild_lVal - 1; // All other childIDs are 1-based indices
+ event.result = osName;
+ for (int i = 0; i < accessibleListeners.size(); i++) {
+ AccessibleListener listener = (AccessibleListener) accessibleListeners.elementAt(i);
+ listener.getName(event);
+ }
+ if (event.result == null) return code;
+ char[] data = (event.result + "\0").toCharArray();
+ int ptr = COM.SysAllocString(data);
+ COM.MoveMemory(pszName, new int[] { ptr }, 4);
+ return COM.S_OK;
+ }
+
+ int get_accParent(int ppdispParent) {
+ if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
+ // Currently, we don't let the application override this. Forward to the proxy.
+ return iaccessible.get_accParent(ppdispParent);
+ }
+
+ int get_accRole(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pvarRole) {
+ if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
+ if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG;
+
+ /* Get the default role from the OS. */
+ int osRole = COM.ROLE_SYSTEM_CLIENT;
+ int code = iaccessible.get_accRole(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, pvarRole);
+ if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
+ // TEMPORARY CODE - process tree and table even if there are no apps listening
+ if (accessibleControlListeners.size() == 0 && !(control instanceof Tree || control instanceof Table)) return code;
+ if (code == COM.S_OK) {
+ short[] pvt = new short[1];
+ COM.MoveMemory(pvt, pvarRole, 2);
+ if (pvt[0] == COM.VT_I4) {
+ int[] pRole = new int[1];
+ COM.MoveMemory(pRole, pvarRole + 8, 4);
+ osRole = pRole[0];
+ }
+ }
+
+ AccessibleControlEvent event = new AccessibleControlEvent(this);
+ event.detail = osToRole(osRole);
+ if (varChild_lVal == COM.CHILDID_SELF) {
+ event.childID = ACC.CHILDID_SELF;
+ } else {
+ if (control instanceof Tree) {
+ /* Tree item childIDs are pointers (not 1-based indices). */
+ event.childID = varChild_lVal;
+
+ // TEMPORARY CODE
+ /* Currently our checkbox tree is emulated using state mask images,
+ * so we need to specify 'checkbox' role for the items here. */
+ if ((control.getStyle() & SWT.CHECK) != 0) event.detail = ACC.ROLE_CHECKBUTTON;
+ } else if (control instanceof Table) {
+ event.childID = varChild_lVal - 1;
+
+ // TEMPORARY CODE
+ /* Currently our checkbox table is emulated using state mask images,
+ * so we need to specify 'checkbox' role for the items here. */
+ if ((control.getStyle() & SWT.CHECK) != 0) event.detail = ACC.ROLE_CHECKBUTTON;
+ } else {
+ event.childID = varChild_lVal - 1;
+ }
+ }
+ for (int i = 0; i < accessibleControlListeners.size(); i++) {
+ AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
+ listener.getRole(event);
+ }
+ int role = roleToOs(event.detail);
+ COM.MoveMemory(pvarRole, new short[] { COM.VT_I4 }, 2);
+ COM.MoveMemory(pvarRole + 8, new int[] { role }, 4);
+ return COM.S_OK;
+ }
+
+ int get_accSelection(int pvarChildren) {
+ if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
+
+ /* Get the default selection from the OS. */
+ int osChild = ACC.CHILDID_NONE;
+ int code = iaccessible.get_accSelection(pvarChildren);
+ if (accessibleControlListeners.size() == 0) return code;
+ if (code == COM.S_OK) {
+ short[] pvt = new short[1];
+ COM.MoveMemory(pvt, pvarChildren, 2);
+ if (pvt[0] == COM.VT_I4) {
+ int[] pChild = new int[1];
+ COM.MoveMemory(pChild, pvarChildren + 8, 4);
+ osChild = (pChild[0] == COM.CHILDID_SELF) ? ACC.CHILDID_SELF : pChild[0] - 1;
+ } else if (pvt[0] == COM.VT_UNKNOWN) {
+ osChild = ACC.CHILDID_MULTIPLE;
+ /* Should get IEnumVARIANT from punkVal field... need better API here... */
+ }
+ }
+
+ AccessibleControlEvent event = new AccessibleControlEvent(this);
+ event.childID = osChild;
+ for (int i = 0; i < accessibleControlListeners.size(); i++) {
+ AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
+ listener.getSelection(event);
+ }
+ Accessible accessible = event.accessible;
+ if (accessible != null) {
+ COM.MoveMemory(pvarChildren, new short[] { COM.VT_DISPATCH }, 2);
+ COM.MoveMemory(pvarChildren + 8, new int[] { accessible.objIAccessible.getAddress() }, 4);
+ return COM.S_OK;
+ }
+ int childID = event.childID;
+ if (childID == ACC.CHILDID_NONE) {
+ COM.MoveMemory(pvarChildren, new short[] { COM.VT_EMPTY }, 2);
+ return COM.S_FALSE;
+ }
+ if (childID == ACC.CHILDID_MULTIPLE) {
+ COM.MoveMemory(pvarChildren, new short[] { COM.VT_UNKNOWN }, 2);
+ /* Should return an IEnumVARIANT for this... so the next line is wrong... need better API here... */
+ COM.MoveMemory(pvarChildren + 8, new int[] { objIAccessible.getAddress() }, 4);
+ return COM.S_OK;
+ }
+ if (childID == ACC.CHILDID_SELF) {
+ COM.MoveMemory(pvarChildren, new short[] { COM.VT_DISPATCH }, 2);
+ COM.MoveMemory(pvarChildren + 8, new int[] { objIAccessible.getAddress() }, 4);
+ return COM.S_OK;
+ }
+ COM.MoveMemory(pvarChildren, new short[] { COM.VT_I4 }, 2);
+ COM.MoveMemory(pvarChildren + 8, new int[] { childID + 1 }, 4);
+ return COM.S_OK;
+ }
+
+ int get_accState(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pvarState) {
+ if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
+ if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG;
+
+ /* Get the default state from the OS. */
+ int osState = 0;
+ int code = iaccessible.get_accState(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, pvarState);
+ if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
+ // TEMPORARY CODE - process tree and table even if there are no apps listening
+ if (accessibleControlListeners.size() == 0 && !(control instanceof Tree || control instanceof Table)) return code;
+ if (code == COM.S_OK) {
+ short[] pvt = new short[1];
+ COM.MoveMemory(pvt, pvarState, 2);
+ if (pvt[0] == COM.VT_I4) {
+ int[] pState = new int[1];
+ COM.MoveMemory(pState, pvarState + 8, 4);
+ osState = pState[0];
+ }
+ }
+
+ AccessibleControlEvent event = new AccessibleControlEvent(this);
+ event.detail = osToState(osState);
+ if (varChild_lVal == COM.CHILDID_SELF) {
+ event.childID = ACC.CHILDID_SELF;
+ } else {
+ if (control instanceof Tree) {
+ /* Tree item childIDs are pointers (not 1-based indices). */
+ event.childID = varChild_lVal;
+
+ // TEMPORARY CODE
+ /* Currently our checkbox tree is emulated using state mask images,
+ * so we need to determine if the item is 'checked' here. */
+ int hwnd = control.handle;
+ TVITEM tvItem = new TVITEM ();
+ tvItem.mask = OS.TVIF_HANDLE | OS.TVIF_STATE;
+ tvItem.hItem = varChild_lVal;
+ tvItem.stateMask = OS.TVIS_STATEIMAGEMASK;
+ int result = OS.SendMessage (hwnd, OS.TVM_GETITEM, 0, tvItem);
+ boolean checked = (result != 0) && (((tvItem.state >> 12) & 1) == 0);
+ if (checked) event.detail |= ACC.STATE_CHECKED;
+ } else if (control instanceof Table) {
+ event.childID = varChild_lVal - 1;
+
+ // TEMPORARY CODE
+ /* Currently our checkbox table is emulated using state mask images,
+ * so we need to determine if the item is 'checked' here. */
+ Table table = (Table) control;
+ TableItem item = table.getItem(event.childID);
+ if (item != null) {
+ if (item.getChecked()) event.detail |= ACC.STATE_CHECKED;
+ }
+ } else {
+ event.childID = varChild_lVal - 1;
+ }
+ }
+ for (int i = 0; i < accessibleControlListeners.size(); i++) {
+ AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
+ listener.getState(event);
+ }
+ int state = stateToOs(event.detail);
+ COM.MoveMemory(pvarState, new short[] { COM.VT_I4 }, 2);
+ COM.MoveMemory(pvarState + 8, new int[] { state }, 4);
+ return COM.S_OK;
+ }
+
+ int get_accValue(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszValue) {
+ if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
+ if ((varChild_vt & 0xFFFF) != COM.VT_I4) return COM.E_INVALIDARG;
+
+ /* Get the default value string from the OS. */
+ String osValue = null;
+ int code = iaccessible.get_accValue(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, pszValue);
+ if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
+ if (accessibleControlListeners.size() == 0) return code;
+ if (code == COM.S_OK) {
+ int[] pValue = new int[1];
+ COM.MoveMemory(pValue, pszValue, 4);
+ int size = COM.SysStringByteLen(pValue[0]);
+ if (size > 0) {
+ char[] buffer = new char[(size + 1) /2];
+ COM.MoveMemory(buffer, pValue[0], size);
+ osValue = new String(buffer);
+ }
+ }
+
+ AccessibleControlEvent event = new AccessibleControlEvent(this);
+ if (varChild_lVal == COM.CHILDID_SELF) event.childID = ACC.CHILDID_SELF;
+ else if (control instanceof Tree) event.childID = varChild_lVal; // Tree item childIDs are pointers
+ else event.childID = varChild_lVal - 1; // All other childIDs are 1-based indices
+ event.result = osValue;
+ for (int i = 0; i < accessibleControlListeners.size(); i++) {
+ AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
+ listener.getValue(event);
+ }
+ if (event.result == null) return code;
+ char[] data = (event.result + "\0").toCharArray();
+ int ptr = COM.SysAllocString(data);
+ COM.MoveMemory(pszValue, new int[] { ptr }, 4);
+ return COM.S_OK;
+ }
+
+ int put_accName(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int szName) {
+ // MSAA: this method is no longer supported
+ if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
+ // We don't implement this. Forward to the proxy.
+ int code = iaccessible.put_accName(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, szName);
+ if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
+ return code;
+ }
+
+ int put_accValue(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int szValue) {
+ // MSAA: this method is typically only used for edit controls
+ if (iaccessible == null) return COM.CO_E_OBJNOTCONNECTED;
+ // We don't implement this. Forward to the proxy.
+ int code = iaccessible.put_accValue(varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, szValue);
+ if (code == COM.E_INVALIDARG) code = COM.S_FALSE; // proxy doesn't know about app childID
+ return code;
+ }
+
+ /* IEnumVARIANT methods: Next, Skip, Reset */
+ /* Retrieve the next celt items in the enumeration sequence.
+ * If there are fewer than the requested number of elements left
+ * in the sequence, retrieve the remaining elements.
+ * The number of elements actually retrieved is returned in pceltFetched
+ * (unless the caller passed in NULL for that parameter).
+ */
+ int Next(int celt, int rgvar, int pceltFetched) {
+ /* If there are no listeners, query the proxy for
+ * its IEnumVariant, and get the Next items from it.
+ */
+ if (accessibleControlListeners.size() == 0) {
+ int[] ppvObject = new int[1];
+ int code = iaccessible.QueryInterface(COM.IIDIEnumVARIANT, ppvObject);
+ if (code != COM.S_OK) return code;
+ IEnumVARIANT ienumvariant = new IEnumVARIANT(ppvObject[0]);
+ int[] celtFetched = new int[1];
+ code = ienumvariant.Next(celt, rgvar, celtFetched);
+ COM.MoveMemory(pceltFetched, celtFetched, 4);
+ return code;
+ }
+
+ if (rgvar == 0) return COM.E_INVALIDARG;
+ if (pceltFetched == 0 && celt != 1) return COM.E_INVALIDARG;
+ if (enumIndex == 0) {
+ AccessibleControlEvent event = new AccessibleControlEvent(this);
+ event.childID = ACC.CHILDID_SELF;
+ for (int i = 0; i < accessibleControlListeners.size(); i++) {
+ AccessibleControlListener listener = (AccessibleControlListener) accessibleControlListeners.elementAt(i);
+ listener.getChildren(event);
+ }
+ variants = event.children;
+ }
+ Object[] nextItems = null;
+ if (variants != null && celt >= 1) {
+ int endIndex = enumIndex + celt - 1;
+ if (endIndex > (variants.length - 1)) endIndex = variants.length - 1;
+ if (enumIndex <= endIndex) {
+ nextItems = new Object[endIndex - enumIndex + 1];
+ for (int i = 0; i < nextItems.length; i++) {
+ Object child = variants[enumIndex];
+ if (child instanceof Integer) {
+ nextItems[i] = new Integer(((Integer)child).intValue() + 1);
+ } else {
+ nextItems[i] = child;
+ }
+ enumIndex++;
+ }
+ }
+ }
+ if (nextItems != null) {
+ for (int i = 0; i < nextItems.length; i++) {
+ Object nextItem = nextItems[i];
+ if (nextItem instanceof Integer) {
+ int item = ((Integer) nextItem).intValue();
+ COM.MoveMemory(rgvar + i * 16, new short[] { COM.VT_I4 }, 2);
+ COM.MoveMemory(rgvar + i * 16 + 8, new int[] { item }, 4);
+ } else {
+ int address = ((Accessible) nextItem).objIAccessible.getAddress();
+ COM.MoveMemory(rgvar + i * 16, new short[] { COM.VT_DISPATCH }, 2);
+ COM.MoveMemory(rgvar + i * 16 + 8, new int[] { address }, 4);
+ }
+ }
+ if (pceltFetched != 0)
+ COM.MoveMemory(pceltFetched, new int[] {nextItems.length}, 4);
+ if (nextItems.length == celt) return COM.S_OK;
+ } else {
+ if (pceltFetched != 0)
+ COM.MoveMemory(pceltFetched, new int[] {0}, 4);
+ }
+ return COM.S_FALSE;
+ }
+
+ /* Skip over the specified number of elements in the enumeration sequence. */
+ int Skip(int celt) {
+ /* If there are no listeners, query the proxy
+ * for its IEnumVariant, and tell it to Skip.
+ */
+ if (accessibleControlListeners.size() == 0) {
+ int[] ppvObject = new int[1];
+ int code = iaccessible.QueryInterface(COM.IIDIEnumVARIANT, ppvObject);
+ if (code != COM.S_OK) return code;
+ IEnumVARIANT ienumvariant = new IEnumVARIANT(ppvObject[0]);
+ code = ienumvariant.Skip(celt);
+ return code;
+ }
+
+ if (celt < 1 ) return COM.E_INVALIDARG;
+ enumIndex += celt;
+ if (enumIndex > (variants.length - 1)) {
+ enumIndex = variants.length - 1;
+ return COM.S_FALSE;
+ }
+ return COM.S_OK;
+ }
+
+ /* Reset the enumeration sequence to the beginning. */
+ int Reset() {
+ /* If there are no listeners, query the proxy
+ * for its IEnumVariant, and tell it to Reset.
+ */
+ if (accessibleControlListeners.size() == 0) {
+ int[] ppvObject = new int[1];
+ int code = iaccessible.QueryInterface(COM.IIDIEnumVARIANT, ppvObject);
+ if (code != COM.S_OK) return code;
+ IEnumVARIANT ienumvariant = new IEnumVARIANT(ppvObject[0]);
+ code = ienumvariant.Reset();
+ return code;
+ }
+
+ enumIndex = 0;
+ return COM.S_OK;
+ }
+
+ int stateToOs(int state) {
+ int osState = 0;
+ if ((state & ACC.STATE_SELECTED) != 0) osState |= COM.STATE_SYSTEM_SELECTED;
+ if ((state & ACC.STATE_SELECTABLE) != 0) osState |= COM.STATE_SYSTEM_SELECTABLE;
+ if ((state & ACC.STATE_MULTISELECTABLE) != 0) osState |= COM.STATE_SYSTEM_MULTISELECTABLE;
+ if ((state & ACC.STATE_FOCUSED) != 0) osState |= COM.STATE_SYSTEM_FOCUSED;
+ if ((state & ACC.STATE_FOCUSABLE) != 0) osState |= COM.STATE_SYSTEM_FOCUSABLE;
+ if ((state & ACC.STATE_PRESSED) != 0) osState |= COM.STATE_SYSTEM_PRESSED;
+ if ((state & ACC.STATE_CHECKED) != 0) osState |= COM.STATE_SYSTEM_CHECKED;
+ if ((state & ACC.STATE_EXPANDED) != 0) osState |= COM.STATE_SYSTEM_EXPANDED;
+ if ((state & ACC.STATE_COLLAPSED) != 0) osState |= COM.STATE_SYSTEM_COLLAPSED;
+ if ((state & ACC.STATE_HOTTRACKED) != 0) osState |= COM.STATE_SYSTEM_HOTTRACKED;
+ if ((state & ACC.STATE_BUSY) != 0) osState |= COM.STATE_SYSTEM_BUSY;
+ if ((state & ACC.STATE_READONLY) != 0) osState |= COM.STATE_SYSTEM_READONLY;
+ if ((state & ACC.STATE_INVISIBLE) != 0) osState |= COM.STATE_SYSTEM_INVISIBLE;
+ if ((state & ACC.STATE_OFFSCREEN) != 0) osState |= COM.STATE_SYSTEM_OFFSCREEN;
+ if ((state & ACC.STATE_SIZEABLE) != 0) osState |= COM.STATE_SYSTEM_SIZEABLE;
+ return osState;
+ }
+
+ int osToState(int osState) {
+ int state = ACC.STATE_NORMAL;
+ if ((osState & COM.STATE_SYSTEM_SELECTED) != 0) state |= ACC.STATE_SELECTED;
+ if ((osState & COM.STATE_SYSTEM_SELECTABLE) != 0) state |= ACC.STATE_SELECTABLE;
+ if ((osState & COM.STATE_SYSTEM_MULTISELECTABLE) != 0) state |= ACC.STATE_MULTISELECTABLE;
+ if ((osState & COM.STATE_SYSTEM_FOCUSED) != 0) state |= ACC.STATE_FOCUSED;
+ if ((osState & COM.STATE_SYSTEM_FOCUSABLE) != 0) state |= ACC.STATE_FOCUSABLE;
+ if ((osState & COM.STATE_SYSTEM_PRESSED) != 0) state |= ACC.STATE_PRESSED;
+ if ((osState & COM.STATE_SYSTEM_CHECKED) != 0) state |= ACC.STATE_CHECKED;
+ if ((osState & COM.STATE_SYSTEM_EXPANDED) != 0) state |= ACC.STATE_EXPANDED;
+ if ((osState & COM.STATE_SYSTEM_COLLAPSED) != 0) state |= ACC.STATE_COLLAPSED;
+ if ((osState & COM.STATE_SYSTEM_HOTTRACKED) != 0) state |= ACC.STATE_HOTTRACKED;
+ if ((osState & COM.STATE_SYSTEM_BUSY) != 0) state |= ACC.STATE_BUSY;
+ if ((osState & COM.STATE_SYSTEM_READONLY) != 0) state |= ACC.STATE_READONLY;
+ if ((osState & COM.STATE_SYSTEM_INVISIBLE) != 0) state |= ACC.STATE_INVISIBLE;
+ if ((osState & COM.STATE_SYSTEM_OFFSCREEN) != 0) state |= ACC.STATE_OFFSCREEN;
+ if ((osState & COM.STATE_SYSTEM_SIZEABLE) != 0) state |= ACC.STATE_SIZEABLE;
+ return state;
+ }
+
+ int roleToOs(int role) {
+ switch (role) {
+ case ACC.ROLE_CLIENT_AREA: return COM.ROLE_SYSTEM_CLIENT;
+ case ACC.ROLE_WINDOW: return COM.ROLE_SYSTEM_WINDOW;
+ case ACC.ROLE_MENUBAR: return COM.ROLE_SYSTEM_MENUBAR;
+ case ACC.ROLE_MENU: return COM.ROLE_SYSTEM_MENUPOPUP;
+ case ACC.ROLE_MENUITEM: return COM.ROLE_SYSTEM_MENUITEM;
+ case ACC.ROLE_SEPARATOR: return COM.ROLE_SYSTEM_SEPARATOR;
+ case ACC.ROLE_TOOLTIP: return COM.ROLE_SYSTEM_TOOLTIP;
+ case ACC.ROLE_SCROLLBAR: return COM.ROLE_SYSTEM_SCROLLBAR;
+ case ACC.ROLE_DIALOG: return COM.ROLE_SYSTEM_DIALOG;
+ case ACC.ROLE_LABEL: return COM.ROLE_SYSTEM_STATICTEXT;
+ case ACC.ROLE_PUSHBUTTON: return COM.ROLE_SYSTEM_PUSHBUTTON;
+ case ACC.ROLE_CHECKBUTTON: return COM.ROLE_SYSTEM_CHECKBUTTON;
+ case ACC.ROLE_RADIOBUTTON: return COM.ROLE_SYSTEM_RADIOBUTTON;
+ case ACC.ROLE_COMBOBOX: return COM.ROLE_SYSTEM_COMBOBOX;
+ case ACC.ROLE_TEXT: return COM.ROLE_SYSTEM_TEXT;
+ case ACC.ROLE_TOOLBAR: return COM.ROLE_SYSTEM_TOOLBAR;
+ case ACC.ROLE_LIST: return COM.ROLE_SYSTEM_LIST;
+ case ACC.ROLE_LISTITEM: return COM.ROLE_SYSTEM_LISTITEM;
+ case ACC.ROLE_TABLE: return COM.ROLE_SYSTEM_TABLE;
+ case ACC.ROLE_TABLECOLUMN: return COM.ROLE_SYSTEM_COLUMNHEADER;
+ case ACC.ROLE_TREE: return COM.ROLE_SYSTEM_OUTLINE;
+ case ACC.ROLE_TABFOLDER: return COM.ROLE_SYSTEM_PAGETABLIST;
+ case ACC.ROLE_TABITEM: return COM.ROLE_SYSTEM_PAGETAB;
+ case ACC.ROLE_PROGRESSBAR: return COM.ROLE_SYSTEM_PROGRESSBAR;
+ case ACC.ROLE_SLIDER: return COM.ROLE_SYSTEM_SLIDER;
+ }
+ return COM.ROLE_SYSTEM_CLIENT;
+ }
+
+ int osToRole(int osRole) {
+ int role = COM.ROLE_SYSTEM_CLIENT;
+ switch (osRole) {
+ case COM.ROLE_SYSTEM_CLIENT: return ACC.ROLE_CLIENT_AREA;
+ case COM.ROLE_SYSTEM_WINDOW: return ACC.ROLE_WINDOW;
+ case COM.ROLE_SYSTEM_MENUBAR: return ACC.ROLE_MENUBAR;
+ case COM.ROLE_SYSTEM_MENUPOPUP: return ACC.ROLE_MENU;
+ case COM.ROLE_SYSTEM_MENUITEM: return ACC.ROLE_MENUITEM;
+ case COM.ROLE_SYSTEM_SEPARATOR: return ACC.ROLE_SEPARATOR;
+ case COM.ROLE_SYSTEM_TOOLTIP: return ACC.ROLE_TOOLTIP;
+ case COM.ROLE_SYSTEM_SCROLLBAR: return ACC.ROLE_SCROLLBAR;
+ case COM.ROLE_SYSTEM_DIALOG: return ACC.ROLE_DIALOG;
+ case COM.ROLE_SYSTEM_STATICTEXT: return ACC.ROLE_LABEL;
+ case COM.ROLE_SYSTEM_PUSHBUTTON: return ACC.ROLE_PUSHBUTTON;
+ case COM.ROLE_SYSTEM_CHECKBUTTON: return ACC.ROLE_CHECKBUTTON;
+ case COM.ROLE_SYSTEM_RADIOBUTTON: return ACC.ROLE_RADIOBUTTON;
+ case COM.ROLE_SYSTEM_COMBOBOX: return ACC.ROLE_COMBOBOX;
+ case COM.ROLE_SYSTEM_TEXT: return ACC.ROLE_TEXT;
+ case COM.ROLE_SYSTEM_TOOLBAR: return ACC.ROLE_TOOLBAR;
+ case COM.ROLE_SYSTEM_LIST: return ACC.ROLE_LIST;
+ case COM.ROLE_SYSTEM_LISTITEM: return ACC.ROLE_LISTITEM;
+ case COM.ROLE_SYSTEM_TABLE: return ACC.ROLE_TABLE;
+ case COM.ROLE_SYSTEM_COLUMNHEADER: return ACC.ROLE_TABLECOLUMN;
+ case COM.ROLE_SYSTEM_OUTLINE: return ACC.ROLE_TREE;
+ case COM.ROLE_SYSTEM_PAGETABLIST: return ACC.ROLE_TABFOLDER;
+ case COM.ROLE_SYSTEM_PAGETAB: return ACC.ROLE_TABITEM;
+ case COM.ROLE_SYSTEM_PROGRESSBAR: return ACC.ROLE_PROGRESSBAR;
+ case COM.ROLE_SYSTEM_SLIDER: return ACC.ROLE_SLIDER;
+ }
+ return role;
+ }
+
+ /* checkWidget was copied from Widget, and rewritten to work in this package */
+ void checkWidget () {
+ if (!isValidThread ()) SWT.error (SWT.ERROR_THREAD_INVALID_ACCESS);
+ if (control.isDisposed ()) SWT.error (SWT.ERROR_WIDGET_DISPOSED);
+ }
+
+ /* isValidThread was copied from Widget, and rewritten to work in this package */
+ boolean isValidThread () {
+ return control.getDisplay ().getThread () == Thread.currentThread ();
+ }
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/AnimatedProgress.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/AnimatedProgress.java
index c21d07ab14..475f4e2e4d 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/AnimatedProgress.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/AnimatedProgress.java
@@ -1,215 +1,215 @@
-package org.eclipse.swt.custom;
-
-/*
+package org.eclipse.swt.custom;
+
+/*
* Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
* This file is made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- */
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.events.*;
-
-/**
- * A control for showing progress feedback for a long running operation.
- *
- * @deprecated As of Eclipse 2.1, use ProgressBar with the style SWT.INDETERMINATE
- *
- * <dl>
- * <dt><b>Styles:</b><dd>VERTICAL, HORIZONTAL, BORDER
- * </dl>
- */
-public class AnimatedProgress extends Canvas {
-
- private static final int SLEEP = 70;
- private static final int DEFAULT_WIDTH = 160;
- private static final int DEFAULT_HEIGHT = 18;
- private boolean active = false;
- private boolean showStripes = false;
- private int value;
- private int orientation = SWT.HORIZONTAL;
- private boolean showBorder = false;
-
-/**
- * Constructs a new instance of this class given its parent
- * and a style value describing its behavior and appearance.
- * <p>
- * The style value is either one of the style constants defined in
- * class <code>SWT</code> which is applicable to instances of this
- * class, or must be built by <em>bitwise OR</em>'ing together
- * (that is, using the <code>int</code> "|" operator) two or more
- * of those <code>SWT</code> style constants. The class description
- * lists the style constants that are applicable to the class.
- * Style bits are also inherited from superclasses.
- * </p>
- *
- * @param parent a widget which will be the parent of the new instance (cannot be null)
- * @param style the style of widget to construct
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
- * </ul>
- *
- * @see SWT#VERTICAL
- * @see SWT#HORIZONTAL
- * @see SWT#BORDER
- * @see #getStyle
- */
-public AnimatedProgress(Composite parent, int style) {
- super(parent, checkStyle(style));
-
- if ((style & SWT.VERTICAL) != 0) {
- orientation = SWT.VERTICAL;
- }
- showBorder = (style & SWT.BORDER) != 0;
-
- addControlListener(new ControlAdapter() {
- public void controlResized(ControlEvent e) {
- redraw();
- }
- });
- addPaintListener(new PaintListener() {
- public void paintControl(PaintEvent e) {
- paint(e);
- }
- });
- addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e){
- stop();
- }
- });
-}
-private static int checkStyle (int style) {
- int mask = SWT.NONE;
- return style & mask;
-}
-/**
- * Stop the animation if it is not already stopped and
- * reset the presentation to a blank appearance.
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public synchronized void clear(){
- checkWidget();
- if (active) stop();
- showStripes = false;
- redraw();
-}
-public Point computeSize(int wHint, int hHint, boolean changed) {
- checkWidget();
- Point size = null;
- if (orientation == SWT.HORIZONTAL) {
- size = new Point(DEFAULT_WIDTH, DEFAULT_HEIGHT);
- } else {
- size = new Point(DEFAULT_HEIGHT, DEFAULT_WIDTH);
- }
- if (wHint != SWT.DEFAULT) size.x = wHint;
- if (hHint != SWT.DEFAULT) size.y = hHint;
-
- return size;
-}
-private void drawBevelRect(GC gc, int x, int y, int w, int h, Color topleft, Color bottomright) {
- gc.setForeground(topleft);
- gc.drawLine(x, y, x+w-1, y);
- gc.drawLine(x, y, x, y+h-1);
-
- gc.setForeground(bottomright);
- gc.drawLine(x+w, y, x+w, y+h);
- gc.drawLine(x, y+h, x+w, y+h);
-}
-private void paint(PaintEvent event) {
- GC gc = event.gc;
- Display disp= getDisplay();
-
- Rectangle rect= getClientArea();
- gc.fillRectangle(rect);
- if (showBorder) {
- drawBevelRect(gc, rect.x, rect.y, rect.width-1, rect.height-1,
- disp.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW),
- disp.getSystemColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW));
- }
-
- paintStripes(gc);
-}
-private void paintStripes(GC gc) {
-
- if (!showStripes) return;
-
- Rectangle rect= getClientArea();
- // Subtracted border painted by paint.
- rect = new Rectangle(rect.x+2, rect.y+2, rect.width-4, rect.height-4);
-
- gc.setLineWidth(2);
- gc.setClipping(rect);
- Color color = getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION);
- gc.setBackground(color);
- gc.fillRectangle(rect);
- gc.setForeground(this.getBackground());
- int step = 12;
- int foregroundValue = value == 0 ? step - 2 : value - 2;
- if (orientation == SWT.HORIZONTAL) {
- int y = rect.y - 1;
- int w = rect.width;
- int h = rect.height + 2;
- for (int i= 0; i < w; i+= step) {
- int x = i + foregroundValue;
- gc.drawLine(x, y, x, h);
- }
- } else {
- int x = rect.x - 1;
- int w = rect.width + 2;
- int h = rect.height;
-
- for (int i= 0; i < h; i+= step) {
- int y = i + foregroundValue;
- gc.drawLine(x, y, w, y);
- }
- }
-
- if (active) {
- value = (value + 2) % step;
- }
-}
-/**
-* Start the animation.
-*
-* @exception SWTException <ul>
-* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
-* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
-* </ul>
-*/
-public synchronized void start() {
- checkWidget();
- if (active) return;
-
- active = true;
- showStripes = true;
-
- final Display display = getDisplay();
- final Runnable [] timer = new Runnable [1];
- timer [0] = new Runnable () {
- public void run () {
- if (!active) return;
- GC gc = new GC(AnimatedProgress.this);
- paintStripes(gc);
- gc.dispose();
- display.timerExec (SLEEP, timer [0]);
- }
- };
- display.timerExec (SLEEP, timer [0]);
-}
-/**
-* Stop the animation. Freeze the presentation at its current appearance.
-*/
-public synchronized void stop() {
- //checkWidget();
- active = false;
-}
-}
+ * http://www.eclipse.org/legal/cpl-v10.html
+ */
+import org.eclipse.swt.*;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.events.*;
+
+/**
+ * A control for showing progress feedback for a long running operation.
+ *
+ * @deprecated As of Eclipse 2.1, use ProgressBar with the style SWT.INDETERMINATE
+ *
+ * <dl>
+ * <dt><b>Styles:</b><dd>VERTICAL, HORIZONTAL, BORDER
+ * </dl>
+ */
+public class AnimatedProgress extends Canvas {
+
+ private static final int SLEEP = 70;
+ private static final int DEFAULT_WIDTH = 160;
+ private static final int DEFAULT_HEIGHT = 18;
+ private boolean active = false;
+ private boolean showStripes = false;
+ private int value;
+ private int orientation = SWT.HORIZONTAL;
+ private boolean showBorder = false;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a widget which will be the parent of the new instance (cannot be null)
+ * @param style the style of widget to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ *
+ * @see SWT#VERTICAL
+ * @see SWT#HORIZONTAL
+ * @see SWT#BORDER
+ * @see #getStyle
+ */
+public AnimatedProgress(Composite parent, int style) {
+ super(parent, checkStyle(style));
+
+ if ((style & SWT.VERTICAL) != 0) {
+ orientation = SWT.VERTICAL;
+ }
+ showBorder = (style & SWT.BORDER) != 0;
+
+ addControlListener(new ControlAdapter() {
+ public void controlResized(ControlEvent e) {
+ redraw();
+ }
+ });
+ addPaintListener(new PaintListener() {
+ public void paintControl(PaintEvent e) {
+ paint(e);
+ }
+ });
+ addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e){
+ stop();
+ }
+ });
+}
+private static int checkStyle (int style) {
+ int mask = SWT.NONE;
+ return style & mask;
+}
+/**
+ * Stop the animation if it is not already stopped and
+ * reset the presentation to a blank appearance.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public synchronized void clear(){
+ checkWidget();
+ if (active) stop();
+ showStripes = false;
+ redraw();
+}
+public Point computeSize(int wHint, int hHint, boolean changed) {
+ checkWidget();
+ Point size = null;
+ if (orientation == SWT.HORIZONTAL) {
+ size = new Point(DEFAULT_WIDTH, DEFAULT_HEIGHT);
+ } else {
+ size = new Point(DEFAULT_HEIGHT, DEFAULT_WIDTH);
+ }
+ if (wHint != SWT.DEFAULT) size.x = wHint;
+ if (hHint != SWT.DEFAULT) size.y = hHint;
+
+ return size;
+}
+private void drawBevelRect(GC gc, int x, int y, int w, int h, Color topleft, Color bottomright) {
+ gc.setForeground(topleft);
+ gc.drawLine(x, y, x+w-1, y);
+ gc.drawLine(x, y, x, y+h-1);
+
+ gc.setForeground(bottomright);
+ gc.drawLine(x+w, y, x+w, y+h);
+ gc.drawLine(x, y+h, x+w, y+h);
+}
+private void paint(PaintEvent event) {
+ GC gc = event.gc;
+ Display disp= getDisplay();
+
+ Rectangle rect= getClientArea();
+ gc.fillRectangle(rect);
+ if (showBorder) {
+ drawBevelRect(gc, rect.x, rect.y, rect.width-1, rect.height-1,
+ disp.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW),
+ disp.getSystemColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW));
+ }
+
+ paintStripes(gc);
+}
+private void paintStripes(GC gc) {
+
+ if (!showStripes) return;
+
+ Rectangle rect= getClientArea();
+ // Subtracted border painted by paint.
+ rect = new Rectangle(rect.x+2, rect.y+2, rect.width-4, rect.height-4);
+
+ gc.setLineWidth(2);
+ gc.setClipping(rect);
+ Color color = getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION);
+ gc.setBackground(color);
+ gc.fillRectangle(rect);
+ gc.setForeground(this.getBackground());
+ int step = 12;
+ int foregroundValue = value == 0 ? step - 2 : value - 2;
+ if (orientation == SWT.HORIZONTAL) {
+ int y = rect.y - 1;
+ int w = rect.width;
+ int h = rect.height + 2;
+ for (int i= 0; i < w; i+= step) {
+ int x = i + foregroundValue;
+ gc.drawLine(x, y, x, h);
+ }
+ } else {
+ int x = rect.x - 1;
+ int w = rect.width + 2;
+ int h = rect.height;
+
+ for (int i= 0; i < h; i+= step) {
+ int y = i + foregroundValue;
+ gc.drawLine(x, y, w, y);
+ }
+ }
+
+ if (active) {
+ value = (value + 2) % step;
+ }
+}
+/**
+* Start the animation.
+*
+* @exception SWTException <ul>
+* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+* </ul>
+*/
+public synchronized void start() {
+ checkWidget();
+ if (active) return;
+
+ active = true;
+ showStripes = true;
+
+ final Display display = getDisplay();
+ final Runnable [] timer = new Runnable [1];
+ timer [0] = new Runnable () {
+ public void run () {
+ if (!active) return;
+ GC gc = new GC(AnimatedProgress.this);
+ paintStripes(gc);
+ gc.dispose();
+ display.timerExec (SLEEP, timer [0]);
+ }
+ };
+ display.timerExec (SLEEP, timer [0]);
+}
+/**
+* Stop the animation. Freeze the presentation at its current appearance.
+*/
+public synchronized void stop() {
+ //checkWidget();
+ active = false;
+}
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/BidiSegmentEvent.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/BidiSegmentEvent.java
index 45125d77b8..dd13c1aa72 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/BidiSegmentEvent.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/BidiSegmentEvent.java
@@ -1,69 +1,69 @@
-package org.eclipse.swt.custom;
-
-/*
+package org.eclipse.swt.custom;
+
+/*
* Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
* This file is made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- */
-
-import org.eclipse.swt.events.*;
-
-/**
- * This event is sent to BidiSegmentListeners when a line is to
- * be measured or rendered in a bidi locale. The segments field is
- * used to specify text ranges in the line that should be treated as
- * separate segments for bidi reordering. Each segment will be reordered
- * and rendered separately.
- * <p>
- * The elements in the segments field specify the start offset of
- * a segment relative to the start of the line. They must follow
- * the following rules:
- * <ul>
- * <li>first element must be 0
- * <li>elements must be in ascending order and must not have duplicates
- * <li>elements must not exceed the line length
- * </ul>
- * In addition, the last element may be set to the end of the line
- * but this is not required.
- *
- * The segments field may be left null if the entire line should
- * be reordered as is.
- * </p>
- * A BidiSegmentListener may be used when adjacent segments of
- * right-to-left text should not be reordered relative to each other.
- * For example, within a Java editor, you may wish multiple
- * right-to-left string literals to be reordered differently than the
- * bidi algorithm specifies.
- *
- * Example:
- * <pre>
- * stored line = "R1R2R3" + "R4R5R6"
- * R1 to R6 are right-to-left characters. The quotation marks
- * are part of the line text. The line is 13 characters long.
- *
- * segments = null:
- * entire line will be reordered and thus the two R2L segments
- * swapped (as per the bidi algorithm).
- * visual line (rendered on screen) = "R6R5R4" + "R3R2R1"
- *
- * segments = [0, 5, 8]
- * "R1R2R3" will be reordered, followed by [blank]+[blank] and
- * "R4R5R6".
- * visual line = "R3R2R1" + "R6R5R4"
- * </pre>
- */
-public class BidiSegmentEvent extends TypedEvent {
- /** line start offset */
- public int lineOffset;
- /** line text */
- public String lineText;
- /** bidi segments, see above */
- public int[] segments;
-
-BidiSegmentEvent(StyledTextEvent e) {
- super(e);
- lineOffset = e.detail;
- lineText = e.text;
-}
-}
+ * http://www.eclipse.org/legal/cpl-v10.html
+ */
+
+import org.eclipse.swt.events.*;
+
+/**
+ * This event is sent to BidiSegmentListeners when a line is to
+ * be measured or rendered in a bidi locale. The segments field is
+ * used to specify text ranges in the line that should be treated as
+ * separate segments for bidi reordering. Each segment will be reordered
+ * and rendered separately.
+ * <p>
+ * The elements in the segments field specify the start offset of
+ * a segment relative to the start of the line. They must follow
+ * the following rules:
+ * <ul>
+ * <li>first element must be 0
+ * <li>elements must be in ascending order and must not have duplicates
+ * <li>elements must not exceed the line length
+ * </ul>
+ * In addition, the last element may be set to the end of the line
+ * but this is not required.
+ *
+ * The segments field may be left null if the entire line should
+ * be reordered as is.
+ * </p>
+ * A BidiSegmentListener may be used when adjacent segments of
+ * right-to-left text should not be reordered relative to each other.
+ * For example, within a Java editor, you may wish multiple
+ * right-to-left string literals to be reordered differently than the
+ * bidi algorithm specifies.
+ *
+ * Example:
+ * <pre>
+ * stored line = "R1R2R3" + "R4R5R6"
+ * R1 to R6 are right-to-left characters. The quotation marks
+ * are part of the line text. The line is 13 characters long.
+ *
+ * segments = null:
+ * entire line will be reordered and thus the two R2L segments
+ * swapped (as per the bidi algorithm).
+ * visual line (rendered on screen) = "R6R5R4" + "R3R2R1"
+ *
+ * segments = [0, 5, 8]
+ * "R1R2R3" will be reordered, followed by [blank]+[blank] and
+ * "R4R5R6".
+ * visual line = "R3R2R1" + "R6R5R4"
+ * </pre>
+ */
+public class BidiSegmentEvent extends TypedEvent {
+ /** line start offset */
+ public int lineOffset;
+ /** line text */
+ public String lineText;
+ /** bidi segments, see above */
+ public int[] segments;
+
+BidiSegmentEvent(StyledTextEvent e) {
+ super(e);
+ lineOffset = e.detail;
+ lineText = e.text;
+}
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/BidiSegmentListener.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/BidiSegmentListener.java
index 551551afe3..267f5dbe2b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/BidiSegmentListener.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/BidiSegmentListener.java
@@ -1,32 +1,32 @@
-package org.eclipse.swt.custom;
-
-/*
+package org.eclipse.swt.custom;
+
+/*
* Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
* This file is made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- */
-import org.eclipse.swt.internal.SWTEventListener;
-
-/**
- * This listener interface may be implemented in order to receive
- * BidiSegmentEvents.
- * @see BidiSegmentEvent
- */
-public interface BidiSegmentListener extends SWTEventListener {
-
-/**
- * This method is called when a line needs to be reordered for
- * measuring or rendering in a bidi locale.
- * <p>
- *
- * @param event.lineOffset line start offset (input)
- * @param event.lineText line text (input)
- * @param event.segments text segments that should be reordered
- * separately. (output)
- * @see BidiSegmentEvent
- */
-public void lineGetSegments(BidiSegmentEvent event);
-
-}
-
+ * http://www.eclipse.org/legal/cpl-v10.html
+ */
+import org.eclipse.swt.internal.SWTEventListener;
+
+/**
+ * This listener interface may be implemented in order to receive
+ * BidiSegmentEvents.
+ * @see BidiSegmentEvent
+ */
+public interface BidiSegmentListener extends SWTEventListener {
+
+/**
+ * This method is called when a line needs to be reordered for
+ * measuring or rendering in a bidi locale.
+ * <p>
+ *
+ * @param event.lineOffset line start offset (input)
+ * @param event.lineText line text (input)
+ * @param event.segments text segments that should be reordered
+ * separately. (output)
+ * @see BidiSegmentEvent
+ */
+public void lineGetSegments(BidiSegmentEvent event);
+
+}
+
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/BusyIndicator.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/BusyIndicator.java
index b9268db080..5e4df66c07 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/BusyIndicator.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/BusyIndicator.java
@@ -1,80 +1,80 @@
-package org.eclipse.swt.custom;
-
-/*
+package org.eclipse.swt.custom;
+
+/*
* Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
* This file is made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- */
-
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
-
-/**
- * Support for showing a Busy Cursor during a long running process.
- */
-public class BusyIndicator {
-
- static int nextBusyId = 1;
- static final String BUSYID_NAME = "SWT BusyIndicator"; //$NON-NLS-1$
-
-/**
- * Runs the given <code>Runnable</code> while providing
- * busy feedback using this busy indicator.
- *
- * @param display the display on which the busy feedback should be
- * displayed. If the display is null, the Display for the current
- * thread will be used. If there is no Display for the current thread,
- * the runnable code will be executed and no busy feedback will be displayed.
- * @param runnable the runnable for which busy feedback is to be shown.
- * Must not be null.
- *
-* @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the runnable is null</li>
- * </ul>
- *
- * @see #showWhile
- */
-
-public static void showWhile(Display display, Runnable runnable) {
- if (runnable == null)
- SWT.error(SWT.ERROR_NULL_ARGUMENT);
- if (display == null) {
- display = Display.getCurrent();
- if (display == null) {
- runnable.run();
- return;
- }
- }
-
- Integer busyId = new Integer(nextBusyId);
- nextBusyId++;
- Cursor cursor = new Cursor(display, SWT.CURSOR_WAIT);
-
- Shell[] shells = display.getShells();
- for (int i = 0; i < shells.length; i++) {
- Integer id = (Integer)shells[i].getData(BUSYID_NAME);
- if (id == null) {
- shells[i].setCursor(cursor);
- shells[i].setData(BUSYID_NAME, busyId);
- }
- }
-
- try {
- runnable.run();
- } finally {
- shells = display.getShells();
- for (int i = 0; i < shells.length; i++) {
- Integer id = (Integer)shells[i].getData(BUSYID_NAME);
- if (id == busyId) {
- shells[i].setCursor(null);
- shells[i].setData(BUSYID_NAME, null);
- }
- }
- if (cursor != null && !cursor.isDisposed()) {
- cursor.dispose();
- }
- }
-}
+ * http://www.eclipse.org/legal/cpl-v10.html
+ */
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.widgets.*;
+
+/**
+ * Support for showing a Busy Cursor during a long running process.
+ */
+public class BusyIndicator {
+
+ static int nextBusyId = 1;
+ static final String BUSYID_NAME = "SWT BusyIndicator"; //$NON-NLS-1$
+
+/**
+ * Runs the given <code>Runnable</code> while providing
+ * busy feedback using this busy indicator.
+ *
+ * @param display the display on which the busy feedback should be
+ * displayed. If the display is null, the Display for the current
+ * thread will be used. If there is no Display for the current thread,
+ * the runnable code will be executed and no busy feedback will be displayed.
+ * @param runnable the runnable for which busy feedback is to be shown.
+ * Must not be null.
+ *
+* @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the runnable is null</li>
+ * </ul>
+ *
+ * @see #showWhile
+ */
+
+public static void showWhile(Display display, Runnable runnable) {
+ if (runnable == null)
+ SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (display == null) {
+ display = Display.getCurrent();
+ if (display == null) {
+ runnable.run();
+ return;
+ }
+ }
+
+ Integer busyId = new Integer(nextBusyId);
+ nextBusyId++;
+ Cursor cursor = new Cursor(display, SWT.CURSOR_WAIT);
+
+ Shell[] shells = display.getShells();
+ for (int i = 0; i < shells.length; i++) {
+ Integer id = (Integer)shells[i].getData(BUSYID_NAME);
+ if (id == null) {
+ shells[i].setCursor(cursor);
+ shells[i].setData(BUSYID_NAME, busyId);
+ }
+ }
+
+ try {
+ runnable.run();
+ } finally {
+ shells = display.getShells();
+ for (int i = 0; i < shells.length; i++) {
+ Integer id = (Integer)shells[i].getData(BUSYID_NAME);
+ if (id == busyId) {
+ shells[i].setCursor(null);
+ shells[i].setData(BUSYID_NAME, null);
+ }
+ }
+ if (cursor != null && !cursor.isDisposed()) {
+ cursor.dispose();
+ }
+ }
+}
}
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 e484e9fc94..76031ae785 100755
--- 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
@@ -1,1180 +1,1180 @@
-package org.eclipse.swt.custom;
-
-/*
+package org.eclipse.swt.custom;
+
+/*
* Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
* This file is made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- */
-
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.accessibility.*;
-
-/**
- * The CCombo class represents a selectable user interface object
- * that combines a text field and a list and issues notificiation
- * when an item is selected from the list.
- * <p>
- * Note that although this class is a subclass of <code>Composite</code>,
- * it does not make sense to add children to it, or set a layout on it.
- * </p>
- * <dl>
- * <dt><b>Styles:</b>
- * <dd>BORDER, READ_ONLY, FLAT</dd>
- * <dt><b>Events:</b>
- * <dd>Selection</dd>
- * </dl>
- */
-public final class CCombo extends Composite {
-
- static final int ITEMS_SHOWING = 5;
-
- Text text;
- List list;
- Shell popup;
- Button arrow;
- boolean hasFocus;
-
-/**
- * Constructs a new instance of this class given its parent
- * and a style value describing its behavior and appearance.
- * <p>
- * The style value is either one of the style constants defined in
- * class <code>SWT</code> which is applicable to instances of this
- * class, or must be built by <em>bitwise OR</em>'ing together
- * (that is, using the <code>int</code> "|" operator) two or more
- * of those <code>SWT</code> style constants. The class description
- * lists the style constants that are applicable to the class.
- * Style bits are also inherited from superclasses.
- * </p>
- *
- * @param parent a widget which will be the parent of the new instance (cannot be null)
- * @param style the style of widget to construct
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
- * </ul>
- *
- * @see SWT#BORDER
- * @see SWT#READ_ONLY
- * @see SWT#FLAT
- * @see Widget#getStyle
- */
-public CCombo (Composite parent, int style) {
- super (parent, checkStyle (style));
-
- style = getStyle();
-
- int textStyle = SWT.SINGLE;
- if ((style & SWT.READ_ONLY) != 0) textStyle |= SWT.READ_ONLY;
- if ((style & SWT.FLAT) != 0) textStyle |= SWT.FLAT;
- text = new Text (this, textStyle);
-
- popup = new Shell (getShell (), SWT.NO_TRIM);
-
- int listStyle = SWT.SINGLE | SWT.V_SCROLL;
- if ((style & SWT.FLAT) != 0) listStyle |= SWT.FLAT;
- list = new List (popup, listStyle);
-
- int arrowStyle = SWT.ARROW | SWT.DOWN;
- if ((style & SWT.FLAT) != 0) arrowStyle |= SWT.FLAT;
- arrow = new Button (this, arrowStyle);
-
- Listener listener = new Listener () {
- public void handleEvent (Event event) {
- if (popup == event.widget) {
- popupEvent (event);
- return;
- }
- if (text == event.widget) {
- textEvent (event);
- return;
- }
- if (list == event.widget) {
- listEvent (event);
- return;
- }
- if (arrow == event.widget) {
- arrowEvent (event);
- return;
- }
- if (CCombo.this == event.widget) {
- comboEvent (event);
- return;
- }
-
- }
- };
-
- int [] comboEvents = {SWT.Dispose, SWT.Move, SWT.Resize};
- for (int i=0; i<comboEvents.length; i++) this.addListener (comboEvents [i], listener);
-
- int [] popupEvents = {SWT.Close, SWT.Paint, SWT.Deactivate};
- for (int i=0; i<popupEvents.length; i++) popup.addListener (popupEvents [i], listener);
-
- int [] textEvents = {SWT.KeyDown, SWT.KeyUp, SWT.Modify, SWT.MouseDown, SWT.MouseUp, SWT.Traverse, SWT.FocusIn, SWT.FocusOut};
- for (int i=0; i<textEvents.length; i++) text.addListener (textEvents [i], listener);
-
- int [] listEvents = {SWT.MouseUp, SWT.Selection, SWT.Traverse, SWT.KeyDown, SWT.KeyUp, SWT.FocusIn, SWT.FocusOut};
- for (int i=0; i<listEvents.length; i++) list.addListener (listEvents [i], listener);
-
- int [] arrowEvents = {SWT.Selection, SWT.FocusIn, SWT.FocusOut};
- for (int i=0; i<arrowEvents.length; i++) arrow.addListener (arrowEvents [i], listener);
-
- initAccessible();
-}
-static int checkStyle (int style) {
- int mask = SWT.BORDER | SWT.READ_ONLY | SWT.FLAT;
- return style & mask;
-}
-/**
-* Adds an item.
-* <p>
-* The item is placed at the end of the list.
-* Indexing is zero based.
-*
-* @param string the new item
-*
-* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
-* when called from the wrong thread
-* @exception SWTError(ERROR_WIDGET_DISPOSED)
-* when the widget has been disposed
-* @exception SWTError(ERROR_NULL_ARGUMENT)
-* when the string is null
-* @exception SWTError(ERROR_ITEM_NOT_ADDED)
-* when the item cannot be added
-*/
-public void add (String string) {
- checkWidget();
- if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- list.add (string);
-}
-/**
-* Adds an item at an index.
-* <p>
-* The item is placed at an index in the list.
-* Indexing is zero based.
-*
-* This operation will fail when the index is
-* out of range.
-*
-* @param string the new item
-* @param index the index for the item
-*
-* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
-* when called from the wrong thread
-* @exception SWTError(ERROR_WIDGET_DISPOSED)
-* when the widget has been disposed
-* @exception SWTError(ERROR_NULL_ARGUMENT)
-* when the string is null
-* @exception SWTError(ERROR_ITEM_NOT_ADDED)
-* when the item cannot be added
-*/
-public void add (String string, int index) {
- checkWidget();
- if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- list.add (string, index);
-}
-/**
-* Adds the listener to receive events.
-* <p>
-*
-* @param listener the listener
-*
-* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
-* when called from the wrong thread
-* @exception SWTError(ERROR_WIDGET_DISPOSED)
-* when the widget has been disposed
-* @exception SWTError(ERROR_NULL_ARGUMENT)
-* when listener is null
-*/
-public void addModifyListener (ModifyListener listener) {;
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- TypedListener typedListener = new TypedListener (listener);
- addListener (SWT.Modify, typedListener);
-}
-/**
-* Adds the listener to receive events.
-* <p>
-*
-* @param listener the listener
-*
-* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
-* when called from the wrong thread
-* @exception SWTError(ERROR_WIDGET_DISPOSED)
-* when the widget has been disposed
-* @exception SWTError(ERROR_NULL_ARGUMENT)
-* when listener is null
-*/
-public void addSelectionListener(SelectionListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- TypedListener typedListener = new TypedListener (listener);
- addListener (SWT.Selection,typedListener);
- addListener (SWT.DefaultSelection,typedListener);
-}
-void arrowEvent (Event event) {
- switch (event.type) {
- case SWT.FocusIn: {
- if (hasFocus) return;
- hasFocus = true;
- if (getEditable ()) text.selectAll ();
- Event e = new Event();
- e.time = event.time;
- notifyListeners(SWT.FocusIn, e);
- break;
- }
- case SWT.FocusOut: {
- event.display.asyncExec(new Runnable() {
- public void run() {
- if (CCombo.this.isDisposed()) return;
- Control focusControl = getDisplay().getFocusControl();
- if (focusControl == list || focusControl == text) return;
- hasFocus = false;
- Event e = new Event();
- notifyListeners(SWT.FocusOut, e);
- }
- });
- break;
- }
- case SWT.Selection: {
- dropDown (!isDropped ());
- break;
- }
- }
-}
-/**
-* Clears the current selection.
-* <p>
-*
-* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
-* when called from the wrong thread
-* @exception SWTError(ERROR_WIDGET_DISPOSED)
-* when the widget has been disposed
-*/
-public void clearSelection () {
- checkWidget();
- text.clearSelection ();
- list.deselectAll ();
-}
-void comboEvent (Event event) {
- switch (event.type) {
- case SWT.Dispose:
- if (popup != null && !popup.isDisposed ()) popup.dispose ();
- popup = null;
- text = null;
- list = null;
- arrow = null;
- break;
- case SWT.Move:
- dropDown(false);
- break;
- case SWT.Resize:
- internalLayout();
- break;
- }
-}
-
-public Point computeSize (int wHint, int hHint, boolean changed) {
- checkWidget();
- int width = 0, height = 0;
- Point textSize = text.computeSize (wHint, SWT.DEFAULT, changed);
- Point arrowSize = arrow.computeSize(SWT.DEFAULT, SWT.DEFAULT, changed);
- Point listSize = list.computeSize (wHint, SWT.DEFAULT, changed);
- int borderWidth = getBorderWidth();
-
- height = Math.max (hHint, Math.max(textSize.y, arrowSize.y) + 2*borderWidth);
- width = Math.max (wHint, Math.max(textSize.x + arrowSize.x + 2*borderWidth, listSize.x + 2) );
- return new Point (width, height);
-}
-/**
-* Deselects an item.
-* <p>
-* If the item at an index is selected, it is
-* deselected. If the item at an index is not
-* selected, it remains deselected. Indices
-* that are out of range are ignored. Indexing
-* is zero based.
-*
-* @param index the index of the item
-*
-* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
-* when called from the wrong thread
-* @exception SWTError(ERROR_WIDGET_DISPOSED)
-* when the widget has been disposed
-*/
-public void deselect (int index) {
- checkWidget();
- list.deselect (index);
-}
-/**
-* Deselects all items.
-* <p>
-*
-* If an item is selected, it is deselected.
-* If an item is not selected, it remains unselected.
-*
-* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
-* when called from the wrong thread
-* @exception SWTError(ERROR_WIDGET_DISPOSED)
-* when the widget has been disposed
-*/
-public void deselectAll () {
- checkWidget();
- list.deselectAll ();
-}
-void dropDown (boolean drop) {
- if (drop == isDropped ()) return;
- if (!drop) {
- popup.setVisible (false);
- text.setFocus();
- return;
- }
- int index = list.getSelectionIndex ();
- if (index != -1) list.setTopIndex (index);
- Rectangle listRect = list.getBounds ();
- Point point = getParent().toDisplay (getLocation ());
- Point comboSize = getSize();
- int width = Math.max (comboSize.x, listRect.width + 2);
- popup.setBounds (point.x, point.y + comboSize.y, width, listRect.height + 2);
- popup.setVisible (true);
- list.setFocus();
-}
-public Control [] getChildren () {
- checkWidget();
- return new Control [0];
-}
-boolean getEditable () {
- return text.getEditable ();
-}
-/**
-* Gets an item at an index.
-* <p>
-* Indexing is zero based.
-*
-* This operation will fail when the index is out
-* of range or an item could not be queried from
-* the OS.
-*
-* @param index the index of the item
-* @return the item
-*
-* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
-* when called from the wrong thread
-* @exception SWTError(ERROR_WIDGET_DISPOSED)
-* when the widget has been disposed
-* @exception SWTError(ERROR_CANNOT_GET_ITEM)
-* when the operation fails
-*/
-public String getItem (int index) {
- checkWidget();
- return list.getItem (index);
-}
-/**
-* Gets the number of items.
-* <p>
-* This operation will fail if the number of
-* items could not be queried from the OS.
-*
-* @return the number of items in the widget
-*
-* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
-* when called from the wrong thread
-* @exception SWTError(ERROR_WIDGET_DISPOSED)
-* when the widget has been disposed
-* @exception SWTError(ERROR_CANNOT_GET_COUNT)
-* when the operation fails
-*/
-public int getItemCount () {
- checkWidget();
- return list.getItemCount ();
-}
-/**
-* Gets the height of one item.
-* <p>
-* This operation will fail if the height of
-* one item could not be queried from the OS.
-*
-* @return the height of one item in the widget
-*
-* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
-* when called from the wrong thread
-* @exception SWTError(ERROR_WIDGET_DISPOSED)
-* when the widget has been disposed
-* @exception SWTError(ERROR_CANNOT_GET_ITEM_HEIGHT)
-* when the operation fails
-*/
-public int getItemHeight () {
- checkWidget();
- return list.getItemHeight ();
-}
-/**
-* Gets the items.
-* <p>
-* This operation will fail if the items cannot
-* be queried from the OS.
-*
-* @return the items in the widget
-*
-* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
-* when called from the wrong thread
-* @exception SWTError(ERROR_WIDGET_DISPOSED)
-* when the widget has been disposed
-* @exception SWTError(ERROR_CANNOT_GET_ITEM)
-* when the operation fails
-*/
-public String [] getItems () {
- checkWidget();
- return list.getItems ();
-}
-/**
-* Gets the selection.
-* <p>
-* @return a point representing the selection start and end
-*
-* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
-* when called from the wrong thread
-* @exception SWTError(ERROR_WIDGET_DISPOSED)
-* when the widget has been disposed
-*/
-public Point getSelection () {
- checkWidget();
- return text.getSelection ();
-}
-/**
-* Gets the index of the selected item.
-* <p>
-* Indexing is zero based.
-* If no item is selected -1 is returned.
-*
-* @return the index of the selected item.
-*
-* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
-* when called from the wrong thread
-* @exception SWTError(ERROR_WIDGET_DISPOSED)
-* when the widget has been disposed
-*/
-public int getSelectionIndex () {
- checkWidget();
- return list.getSelectionIndex ();
-}
-/**
-* Gets the widget text.
-* <p>
-* If the widget has no text, an empty string is returned.
-*
-* @return the widget text
-*
-* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
-* when called from the wrong thread
-* @exception SWTError(ERROR_WIDGET_DISPOSED)
-* when the widget has been disposed
-*/
-public String getText () {
- checkWidget();
- return text.getText ();
-}
-/**
-* Gets the height of the combo's text field.
-* <p>
-* The operation will fail if the height cannot
-* be queried from the OS.
-
-* @return the height of the combo's text field.
-*
-* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
-* when called from the wrong thread
-* @exception SWTError(ERROR_WIDGET_DISPOSED)
-* when the widget has been disposed
-* @exception SWTError(ERROR_ERROR_CANNOT_GET_ITEM_HEIGHT)
-* when the operation fails
-*/
-public int getTextHeight () {
- checkWidget();
- return text.getLineHeight();
-}
-/**
-* Gets the text limit.
-* <p>
-* @return the text limit
-*
-* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
-* when called from the wrong thread
-* @exception SWTError(ERROR_WIDGET_DISPOSED)
-* when the widget has been disposed
-*/
-public int getTextLimit () {
- checkWidget();
- return text.getTextLimit ();
-}
-/**
-* Gets the index of an item.
-* <p>
-* The list is searched starting at 0 until an
-* item is found that is equal to the search item.
-* If no item is found, -1 is returned. Indexing
-* is zero based.
-*
-* @param string the search item
-* @return the index of the item
-*
-* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
-* when called from the wrong thread
-* @exception SWTError(ERROR_WIDGET_DISPOSED)
-* when the widget has been disposed
-* @exception SWTError(ERROR_NULL_ARGUMENT)
-* when string is null
-*/
-public int indexOf (String string) {
- checkWidget();
- if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- return list.indexOf (string);
-}
-/**
-* Gets the index of an item.
-* <p>
-* The widget is searched starting at start including
-* the end position until an item is found that
-* is equal to the search itenm. If no item is
-* found, -1 is returned. Indexing is zero based.
-*
-* @param string the search item
-* @param index the starting position
-* @return the index of the item
-*
-* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
-* when called from the wrong thread
-* @exception SWTError(ERROR_WIDGET_DISPOSED)
-* when the widget has been disposed
-* @exception SWTError(ERROR_NULL_ARGUMENT)
-* when string is null
-*/
-public int indexOf (String string, int start) {
- checkWidget();
- if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- return list.indexOf (string, start);
-}
-
-void initAccessible() {
- getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getHelp(AccessibleEvent e) {
- e.result = getToolTipText();
- }
- });
-
- getAccessible().addAccessibleControlListener(new AccessibleControlAdapter() {
- public void getChildAtPoint(AccessibleControlEvent e) {
- Point testPoint = toControl(new Point(e.x, e.y));
- if (getBounds().contains(testPoint)) {
- e.childID = ACC.CHILDID_SELF;
- }
- }
-
- public void getLocation(AccessibleControlEvent e) {
- Rectangle location = getBounds();
- Point pt = toDisplay(new Point(location.x, location.y));
- e.x = pt.x;
- e.y = pt.y;
- e.width = location.width;
- e.height = location.height;
- }
-
- public void getChildCount(AccessibleControlEvent e) {
- e.detail = 0;
- }
-
- public void getRole(AccessibleControlEvent e) {
- e.detail = ACC.ROLE_COMBOBOX;
- }
-
- public void getState(AccessibleControlEvent e) {
- e.detail = ACC.STATE_NORMAL;
- }
-
- public void getValue(AccessibleControlEvent e) {
- e.result = getText();
- }
- });
-}
-boolean isDropped () {
- return popup.getVisible ();
-}
-public boolean isFocusControl () {
- checkWidget();
- if (text.isFocusControl() || arrow.isFocusControl() || list.isFocusControl() || popup.isFocusControl()) {
- return true;
- } else {
- return super.isFocusControl();
- }
-}
-void internalLayout () {
- if (isDropped ()) dropDown (false);
-
- Rectangle rect = getClientArea();
- int width = rect.width;
- int height = rect.height;
- Point arrowSize = arrow.computeSize(SWT.DEFAULT, height);
- text.setBounds (0, 0, width - arrowSize.x, height);
- arrow.setBounds (width - arrowSize.x, 0, arrowSize.x, arrowSize.y);
-
- Point size = getSize();
- int itemHeight = list.getItemHeight () * ITEMS_SHOWING;
- Point listSize = list.computeSize (SWT.DEFAULT, itemHeight);
- list.setBounds (1, 1, Math.max (size.x - 2, listSize.x), listSize.y);
-}
-void listEvent (Event event) {
- switch (event.type) {
- case SWT.FocusIn: {
- if (hasFocus) return;
- hasFocus = true;
- if (getEditable ()) text.selectAll ();
- Event e = new Event();
- e.time = event.time;
- notifyListeners(SWT.FocusIn, e);
- break;
- }
- case SWT.FocusOut: {
- event.display.asyncExec(new Runnable() {
- public void run() {
- if (CCombo.this.isDisposed()) return;
- Control focusControl = getDisplay().getFocusControl();
- if (focusControl == text || focusControl == arrow) return;
- hasFocus = false;
- Event e = new Event();
- notifyListeners(SWT.FocusOut, e);
- }
- });
- break;
- }
- case SWT.MouseUp: {
- if (event.button != 1) return;
- dropDown (false);
- Event e = new Event();
- e.time = event.time;
- notifyListeners(SWT.DefaultSelection, e);
- break;
- }
- case SWT.Selection: {
- int index = list.getSelectionIndex ();
- if (index == -1) return;
- text.setText (list.getItem (index));
- text.selectAll ();
- list.setSelection(index);
- Event e = new Event();
- e.time = event.time;
- e.stateMask = event.stateMask;
- e.doit = event.doit;
- notifyListeners(SWT.Selection, e);
- event.doit = e.doit;
- break;
- }
- case SWT.Traverse: {
- switch (event.detail) {
- case SWT.TRAVERSE_TAB_NEXT:
- case SWT.TRAVERSE_RETURN:
- case SWT.TRAVERSE_ESCAPE:
- case SWT.TRAVERSE_ARROW_PREVIOUS:
- case SWT.TRAVERSE_ARROW_NEXT:
- event.doit = false;
- break;
- }
- Event e = new Event();
- e.time = event.time;
- e.detail = event.detail;
- e.doit = event.doit;
- e.keyCode = event.keyCode;
- notifyListeners(SWT.Traverse, e);
- event.doit = e.doit;
- break;
- }
- case SWT.KeyUp: {
- Event e = new Event();
- e.time = event.time;
- e.character = event.character;
- e.keyCode = event.keyCode;
- e.stateMask = event.stateMask;
- notifyListeners(SWT.KeyUp, e);
- break;
- }
- case SWT.KeyDown: {
- if (event.character == SWT.ESC) {
- // escape key cancels popup list
- dropDown (false);
- }
- if (event.character == SWT.CR || event.character == '\t') {
- // Enter and Tab cause default selection
- dropDown (false);
- Event e = new Event();
- e.time = event.time;
- e.stateMask = event.stateMask;
- notifyListeners(SWT.DefaultSelection, e);
- }
- //At this point the widget may have been disposed.
- // If so, do not continue.
- if (isDisposed()) break;
- Event e = new Event();
- e.time = event.time;
- e.character = event.character;
- e.keyCode = event.keyCode;
- e.stateMask = event.stateMask;
- notifyListeners(SWT.KeyDown, e);
- break;
-
- }
- }
-}
-void popupEvent(Event event) {
- switch (event.type) {
- case SWT.Paint:
- // draw black rectangle around list
- Rectangle listRect = list.getBounds();
- Color black = getDisplay().getSystemColor(SWT.COLOR_BLACK);
- event.gc.setForeground(black);
- event.gc.drawRectangle(0, 0, listRect.width + 1, listRect.height + 1);
- break;
- case SWT.Close:
- event.doit = false;
- dropDown (false);
- break;
- case SWT.Deactivate:
- dropDown (false);
- break;
- }
-}
-public void redraw (int x, int y, int width, int height, boolean all) {
- checkWidget();
- if (!all) return;
- Point location = text.getLocation();
- text.redraw(x - location.x, y - location.y, width, height, all);
- location = list.getLocation();
- list.redraw(x - location.x, y - location.y, width, height, all);
- if (arrow != null) {
- location = arrow.getLocation();
- arrow.redraw(x - location.x, y - location.y, width, height, all);
- }
-}
-
-/**
-* Removes an item at an index.
-* <p>
-* Indexing is zero based.
-*
-* This operation will fail when the index is out
-* of range or an item could not be removed from
-* the OS.
-*
-* @param index the index of the item
-* @return the selection state
-*
-* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
-* when called from the wrong thread
-* @exception SWTError(ERROR_WIDGET_DISPOSED)
-* when the widget has been disposed
-* @exception SWTError(ERROR_ITEM_NOT_REMOVED)
-* when the operation fails
-*/
-public void remove (int index) {
- checkWidget();
- list.remove (index);
-}
-/**
-* Removes a range of items.
-* <p>
-* Indexing is zero based. The range of items
-* is from the start index up to and including
-* the end index.
-*
-* This operation will fail when the index is out
-* of range or an item could not be removed from
-* the OS.
-*
-* @param start the start of the range
-* @param end the end of the range
-*
-* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
-* when called from the wrong thread
-* @exception SWTError(ERROR_WIDGET_DISPOSED)
-* when the widget has been disposed
-* @exception SWTError(ERROR_ITEM_NOT_REMOVED)
-* when the operation fails
-*/
-public void remove (int start, int end) {
- checkWidget();
- list.remove (start, end);
-}
-/**
-* Removes an item.
-* <p>
-* This operation will fail when the item
-* could not be removed from the OS.
-*
-* @param string the search item
-*
-* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
-* when called from the wrong thread
-* @exception SWTError(ERROR_WIDGET_DISPOSED)
-* when the widget has been disposed
-* @exception SWTError(ERROR_NULL_ARGUMENT)
-* when string is null
-* @exception SWTError(ERROR_ITEM_NOT_REMOVED)
-* when the operation fails
-*/
-public void remove (String string) {
- checkWidget();
- if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- list.remove (string);
-}
-/**
-* Removes all items.
-* <p>
-* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
-* when called from the wrong thread
-* @exception SWTError(ERROR_WIDGET_DISPOSED)
-* when the widget has been disposed
-*/
-public void removeAll () {
- checkWidget();
- text.setText (""); //$NON-NLS-1$
- list.removeAll ();
-}
-/**
-* Removes the listener.
-* <p>
-*
-* @param listener the listener
-*
-* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
-* when called from the wrong thread
-* @exception SWTError(ERROR_WIDGET_DISPOSED)
-* when the widget has been disposed
-* @exception SWTError(ERROR_NULL_ARGUMENT)
-* when listener is null
-*/
-public void removeModifyListener (ModifyListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- removeListener(SWT.Modify, listener);
-}
-/**
-* Removes the listener.
-* <p>
-*
-* @param listener the listener
-*
-* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
-* when called from the wrong thread
-* @exception SWTError(ERROR_WIDGET_DISPOSED)
-* when the widget has been disposed
-* @exception SWTError(ERROR_NULL_ARGUMENT)
-* when listener is null
-*/
-public void removeSelectionListener (SelectionListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- removeListener(SWT.Selection, listener);
- removeListener(SWT.DefaultSelection,listener);
-}
-/**
-* Selects an item.
-* <p>
-* If the item at an index is not selected, it is
-* selected. Indices that are out of
-* range are ignored. Indexing is zero based.
-*
-* @param index the index of the item
-*
-* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
-* when called from the wrong thread
-* @exception SWTError(ERROR_WIDGET_DISPOSED)
-* when the widget has been disposed
-*/
-public void select (int index) {
- checkWidget();
- if (index == -1) {
- list.deselectAll ();
- text.setText (""); //$NON-NLS-1$
- return;
- }
- if (0 <= index && index < list.getItemCount()) {
- if (index != getSelectionIndex()) {
- text.setText (list.getItem (index));
- text.selectAll ();
- list.select (index);
- list.showSelection ();
- }
- }
-}
-public void setBackground (Color color) {
- super.setBackground(color);
- if (text != null) text.setBackground(color);
- if (list != null) list.setBackground(color);
- if (arrow != null) arrow.setBackground(color);
-}
-public boolean setFocus () {
- checkWidget();
- return text.setFocus ();
-}
-public void setFont (Font font) {
- super.setFont (font);
- text.setFont (font);
- list.setFont (font);
- internalLayout ();
-}
-public void setForeground (Color color) {
- super.setForeground(color);
- if (text != null) text.setForeground(color);
- if (list != null) list.setForeground(color);
- if (arrow != null) arrow.setForeground(color);
-}
-/**
-* Sets the text of an item.
-* <p>
-* Indexing is zero based.
-*
-* This operation will fail when the index is out
-* of range or an item could not be changed in
-* the OS.
-*
-* @param index the index for the item
-* @param string the item
-*
-* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
-* when called from the wrong thread
-* @exception SWTError(ERROR_WIDGET_DISPOSED)
-* when the widget has been disposed
-* @exception SWTError(ERROR_NULL_ARGUMENT)
-* when items is null
-* @exception SWTError(ERROR_ITEM_NOT_MODIFIED)
-* when the operation fails
-*/
-public void setItem (int index, String string) {
- checkWidget();
- if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- list.setItem (index, string);
-}
-/**
-* Sets all items.
-* <p>
-* @param items the array of items
-*
-* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
-* when called from the wrong thread
-* @exception SWTError(ERROR_WIDGET_DISPOSED)
-* when the widget has been disposed
-* @exception SWTError(ERROR_NULL_ARGUMENT)
-* when items is null
-* @exception SWTError(ERROR_ITEM_NOT_ADDED)
-* when the operation fails
-*/
-public void setItems (String [] items) {
- checkWidget();
- if (items == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- int style = getStyle();
- if ((style & SWT.READ_ONLY) != 0) text.setText (""); //$NON-NLS-1$
- list.setItems (items);
-}
-/**
-* Sets the new selection.
-* <p>
-* @param selection point representing the start and the end of the new selection
-*
-* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
-* when called from the wrong thread
-* @exception SWTError(ERROR_WIDGET_DISPOSED)
-* when the widget has been disposed
-* @exception SWTError(ERROR_NULL_ARGUMENT)
-* when selection is null
-*/
-public void setSelection (Point selection) {
- checkWidget();
- if (selection == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- text.setSelection (selection.x, selection.y);
-}
-
-/**
-* Sets the widget text
-* <p>
-* @param string the widget text
-*
-* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
-* when called from the wrong thread
-* @exception SWTError(ERROR_WIDGET_DISPOSED)
-* when the widget has been disposed
-* @exception SWTError(ERROR_NULL_ARGUMENT)
-* when string is null
-*/
-public void setText (String string) {
- checkWidget();
- if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- int index = list.indexOf (string);
- if (index == -1) {
- list.deselectAll ();
- text.setText (string);
- return;
- }
- text.setText (string);
- text.selectAll ();
- list.setSelection (index);
- list.showSelection ();
-}
-/**
-* Sets the text limit
-* <p>
-* @param limit new text limit
-*
-* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
-* when called from the wrong thread
-* @exception SWTError(ERROR_WIDGET_DISPOSED)
-* when the widget has been disposed
-* @exception SWTError(ERROR_CANNOT_BE_ZERO)
-* when limit is 0
-*/
-public void setTextLimit (int limit) {
- checkWidget();
- text.setTextLimit (limit);
-}
-
-public void setToolTipText (String string) {
- checkWidget();
- super.setToolTipText(string);
- arrow.setToolTipText (string);
- text.setToolTipText (string);
-}
-
-public void setVisible (boolean visible) {
- super.setVisible(visible);
- if (!visible) popup.setVisible(false);
-}
-
-void textEvent (Event event) {
- switch (event.type) {
- case SWT.FocusIn: {
- if (hasFocus) return;
- hasFocus = true;
- if (getEditable ()) text.selectAll ();
- Event e = new Event();
- e.time = event.time;
- notifyListeners(SWT.FocusIn, e);
- break;
- }
- case SWT.FocusOut: {
- event.display.asyncExec(new Runnable() {
- public void run() {
- if (CCombo.this.isDisposed()) return;
- Control focusControl = getDisplay().getFocusControl();
- if (focusControl == list || focusControl == arrow) return;
- hasFocus = false;
- Event e = new Event();
- notifyListeners(SWT.FocusOut, e);
- }
- });
- break;
- }
- case SWT.KeyDown: {
-
- if (event.character == SWT.ESC) { // escape key cancels popup list
- dropDown (false);
- }
- if (event.character == SWT.CR) {
- dropDown (false);
- Event e = new Event();
- e.time = event.time;
- e.stateMask = event.stateMask;
- notifyListeners(SWT.DefaultSelection, e);
- }
- //At this point the widget may have been disposed.
- // If so, do not continue.
- if (isDisposed()) break;
-
- if (event.keyCode == SWT.ARROW_UP || event.keyCode == SWT.ARROW_DOWN) {
- int oldIndex = getSelectionIndex ();
- if (event.keyCode == SWT.ARROW_UP) {
- select (Math.max (oldIndex - 1, 0));
- } else {
- select (Math.min (oldIndex + 1, getItemCount () - 1));
- }
-
- if (oldIndex != getSelectionIndex ()) {
- Event e = new Event();
- e.time = event.time;
- e.stateMask = event.stateMask;
- notifyListeners(SWT.Selection, e);
- }
- //At this point the widget may have been disposed.
- // If so, do not continue.
- if (isDisposed()) break;
- }
-
- // Further work : Need to add support for incremental search in
- // pop up list as characters typed in text widget
-
- Event e = new Event();
- e.time = event.time;
- e.character = event.character;
- e.keyCode = event.keyCode;
- e.stateMask = event.stateMask;
- notifyListeners(SWT.KeyDown, e);
- break;
- }
- case SWT.KeyUp: {
- Event e = new Event();
- e.time = event.time;
- e.character = event.character;
- e.keyCode = event.keyCode;
- e.stateMask = event.stateMask;
- notifyListeners(SWT.KeyUp, e);
- break;
- }
- case SWT.Modify: {
- list.deselectAll ();
- Event e = new Event();
- e.time = event.time;
- notifyListeners(SWT.Modify, e);
- break;
- }
- case SWT.MouseDown: {
- if (event.button != 1) return;
- if (text.getEditable ()) return;
- boolean dropped = isDropped ();
- text.selectAll ();
- if (!dropped) setFocus ();
- dropDown (!dropped);
- break;
- }
- case SWT.MouseUp: {
- if (event.button != 1) return;
- if (text.getEditable ()) return;
- text.selectAll ();
- break;
- }
- case SWT.Traverse: {
- switch (event.detail) {
- case SWT.TRAVERSE_RETURN:
- case SWT.TRAVERSE_ARROW_PREVIOUS:
- case SWT.TRAVERSE_ARROW_NEXT:
- // The enter causes default selection and
- // the arrow keys are used to manipulate the list contents so
- // do not use them for traversal.
- event.doit = false;
- break;
- }
-
- Event e = new Event();
- e.time = event.time;
- e.detail = event.detail;
- e.doit = event.doit;
- e.keyCode = event.keyCode;
- notifyListeners(SWT.Traverse, e);
- event.doit = e.doit;
- break;
- }
- }
-}
+ * http://www.eclipse.org/legal/cpl-v10.html
+ */
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.accessibility.*;
+
+/**
+ * The CCombo class represents a selectable user interface object
+ * that combines a text field and a list and issues notificiation
+ * when an item is selected from the list.
+ * <p>
+ * Note that although this class is a subclass of <code>Composite</code>,
+ * it does not make sense to add children to it, or set a layout on it.
+ * </p>
+ * <dl>
+ * <dt><b>Styles:</b>
+ * <dd>BORDER, READ_ONLY, FLAT</dd>
+ * <dt><b>Events:</b>
+ * <dd>Selection</dd>
+ * </dl>
+ */
+public final class CCombo extends Composite {
+
+ static final int ITEMS_SHOWING = 5;
+
+ Text text;
+ List list;
+ Shell popup;
+ Button arrow;
+ boolean hasFocus;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a widget which will be the parent of the new instance (cannot be null)
+ * @param style the style of widget to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ *
+ * @see SWT#BORDER
+ * @see SWT#READ_ONLY
+ * @see SWT#FLAT
+ * @see Widget#getStyle
+ */
+public CCombo (Composite parent, int style) {
+ super (parent, checkStyle (style));
+
+ style = getStyle();
+
+ int textStyle = SWT.SINGLE;
+ if ((style & SWT.READ_ONLY) != 0) textStyle |= SWT.READ_ONLY;
+ if ((style & SWT.FLAT) != 0) textStyle |= SWT.FLAT;
+ text = new Text (this, textStyle);
+
+ popup = new Shell (getShell (), SWT.NO_TRIM);
+
+ int listStyle = SWT.SINGLE | SWT.V_SCROLL;
+ if ((style & SWT.FLAT) != 0) listStyle |= SWT.FLAT;
+ list = new List (popup, listStyle);
+
+ int arrowStyle = SWT.ARROW | SWT.DOWN;
+ if ((style & SWT.FLAT) != 0) arrowStyle |= SWT.FLAT;
+ arrow = new Button (this, arrowStyle);
+
+ Listener listener = new Listener () {
+ public void handleEvent (Event event) {
+ if (popup == event.widget) {
+ popupEvent (event);
+ return;
+ }
+ if (text == event.widget) {
+ textEvent (event);
+ return;
+ }
+ if (list == event.widget) {
+ listEvent (event);
+ return;
+ }
+ if (arrow == event.widget) {
+ arrowEvent (event);
+ return;
+ }
+ if (CCombo.this == event.widget) {
+ comboEvent (event);
+ return;
+ }
+
+ }
+ };
+
+ int [] comboEvents = {SWT.Dispose, SWT.Move, SWT.Resize};
+ for (int i=0; i<comboEvents.length; i++) this.addListener (comboEvents [i], listener);
+
+ int [] popupEvents = {SWT.Close, SWT.Paint, SWT.Deactivate};
+ for (int i=0; i<popupEvents.length; i++) popup.addListener (popupEvents [i], listener);
+
+ int [] textEvents = {SWT.KeyDown, SWT.KeyUp, SWT.Modify, SWT.MouseDown, SWT.MouseUp, SWT.Traverse, SWT.FocusIn, SWT.FocusOut};
+ for (int i=0; i<textEvents.length; i++) text.addListener (textEvents [i], listener);
+
+ int [] listEvents = {SWT.MouseUp, SWT.Selection, SWT.Traverse, SWT.KeyDown, SWT.KeyUp, SWT.FocusIn, SWT.FocusOut};
+ for (int i=0; i<listEvents.length; i++) list.addListener (listEvents [i], listener);
+
+ int [] arrowEvents = {SWT.Selection, SWT.FocusIn, SWT.FocusOut};
+ for (int i=0; i<arrowEvents.length; i++) arrow.addListener (arrowEvents [i], listener);
+
+ initAccessible();
+}
+static int checkStyle (int style) {
+ int mask = SWT.BORDER | SWT.READ_ONLY | SWT.FLAT;
+ return style & mask;
+}
+/**
+* Adds an item.
+* <p>
+* The item is placed at the end of the list.
+* Indexing is zero based.
+*
+* @param string the new item
+*
+* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+* when called from the wrong thread
+* @exception SWTError(ERROR_WIDGET_DISPOSED)
+* when the widget has been disposed
+* @exception SWTError(ERROR_NULL_ARGUMENT)
+* when the string is null
+* @exception SWTError(ERROR_ITEM_NOT_ADDED)
+* when the item cannot be added
+*/
+public void add (String string) {
+ checkWidget();
+ if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+ list.add (string);
+}
+/**
+* Adds an item at an index.
+* <p>
+* The item is placed at an index in the list.
+* Indexing is zero based.
+*
+* This operation will fail when the index is
+* out of range.
+*
+* @param string the new item
+* @param index the index for the item
+*
+* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+* when called from the wrong thread
+* @exception SWTError(ERROR_WIDGET_DISPOSED)
+* when the widget has been disposed
+* @exception SWTError(ERROR_NULL_ARGUMENT)
+* when the string is null
+* @exception SWTError(ERROR_ITEM_NOT_ADDED)
+* when the item cannot be added
+*/
+public void add (String string, int index) {
+ checkWidget();
+ if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+ list.add (string, index);
+}
+/**
+* Adds the listener to receive events.
+* <p>
+*
+* @param listener the listener
+*
+* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+* when called from the wrong thread
+* @exception SWTError(ERROR_WIDGET_DISPOSED)
+* when the widget has been disposed
+* @exception SWTError(ERROR_NULL_ARGUMENT)
+* when listener is null
+*/
+public void addModifyListener (ModifyListener listener) {;
+ checkWidget();
+ if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.Modify, typedListener);
+}
+/**
+* Adds the listener to receive events.
+* <p>
+*
+* @param listener the listener
+*
+* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+* when called from the wrong thread
+* @exception SWTError(ERROR_WIDGET_DISPOSED)
+* when the widget has been disposed
+* @exception SWTError(ERROR_NULL_ARGUMENT)
+* when listener is null
+*/
+public void addSelectionListener(SelectionListener listener) {
+ checkWidget();
+ if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.Selection,typedListener);
+ addListener (SWT.DefaultSelection,typedListener);
+}
+void arrowEvent (Event event) {
+ switch (event.type) {
+ case SWT.FocusIn: {
+ if (hasFocus) return;
+ hasFocus = true;
+ if (getEditable ()) text.selectAll ();
+ Event e = new Event();
+ e.time = event.time;
+ notifyListeners(SWT.FocusIn, e);
+ break;
+ }
+ case SWT.FocusOut: {
+ event.display.asyncExec(new Runnable() {
+ public void run() {
+ if (CCombo.this.isDisposed()) return;
+ Control focusControl = getDisplay().getFocusControl();
+ if (focusControl == list || focusControl == text) return;
+ hasFocus = false;
+ Event e = new Event();
+ notifyListeners(SWT.FocusOut, e);
+ }
+ });
+ break;
+ }
+ case SWT.Selection: {
+ dropDown (!isDropped ());
+ break;
+ }
+ }
+}
+/**
+* Clears the current selection.
+* <p>
+*
+* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+* when called from the wrong thread
+* @exception SWTError(ERROR_WIDGET_DISPOSED)
+* when the widget has been disposed
+*/
+public void clearSelection () {
+ checkWidget();
+ text.clearSelection ();
+ list.deselectAll ();
+}
+void comboEvent (Event event) {
+ switch (event.type) {
+ case SWT.Dispose:
+ if (popup != null && !popup.isDisposed ()) popup.dispose ();
+ popup = null;
+ text = null;
+ list = null;
+ arrow = null;
+ break;
+ case SWT.Move:
+ dropDown(false);
+ break;
+ case SWT.Resize:
+ internalLayout();
+ break;
+ }
+}
+
+public Point computeSize (int wHint, int hHint, boolean changed) {
+ checkWidget();
+ int width = 0, height = 0;
+ Point textSize = text.computeSize (wHint, SWT.DEFAULT, changed);
+ Point arrowSize = arrow.computeSize(SWT.DEFAULT, SWT.DEFAULT, changed);
+ Point listSize = list.computeSize (wHint, SWT.DEFAULT, changed);
+ int borderWidth = getBorderWidth();
+
+ height = Math.max (hHint, Math.max(textSize.y, arrowSize.y) + 2*borderWidth);
+ width = Math.max (wHint, Math.max(textSize.x + arrowSize.x + 2*borderWidth, listSize.x + 2) );
+ return new Point (width, height);
+}
+/**
+* Deselects an item.
+* <p>
+* If the item at an index is selected, it is
+* deselected. If the item at an index is not
+* selected, it remains deselected. Indices
+* that are out of range are ignored. Indexing
+* is zero based.
+*
+* @param index the index of the item
+*
+* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+* when called from the wrong thread
+* @exception SWTError(ERROR_WIDGET_DISPOSED)
+* when the widget has been disposed
+*/
+public void deselect (int index) {
+ checkWidget();
+ list.deselect (index);
+}
+/**
+* Deselects all items.
+* <p>
+*
+* If an item is selected, it is deselected.
+* If an item is not selected, it remains unselected.
+*
+* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+* when called from the wrong thread
+* @exception SWTError(ERROR_WIDGET_DISPOSED)
+* when the widget has been disposed
+*/
+public void deselectAll () {
+ checkWidget();
+ list.deselectAll ();
+}
+void dropDown (boolean drop) {
+ if (drop == isDropped ()) return;
+ if (!drop) {
+ popup.setVisible (false);
+ text.setFocus();
+ return;
+ }
+ int index = list.getSelectionIndex ();
+ if (index != -1) list.setTopIndex (index);
+ Rectangle listRect = list.getBounds ();
+ Point point = getParent().toDisplay (getLocation ());
+ Point comboSize = getSize();
+ int width = Math.max (comboSize.x, listRect.width + 2);
+ popup.setBounds (point.x, point.y + comboSize.y, width, listRect.height + 2);
+ popup.setVisible (true);
+ list.setFocus();
+}
+public Control [] getChildren () {
+ checkWidget();
+ return new Control [0];
+}
+boolean getEditable () {
+ return text.getEditable ();
+}
+/**
+* Gets an item at an index.
+* <p>
+* Indexing is zero based.
+*
+* This operation will fail when the index is out
+* of range or an item could not be queried from
+* the OS.
+*
+* @param index the index of the item
+* @return the item
+*
+* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+* when called from the wrong thread
+* @exception SWTError(ERROR_WIDGET_DISPOSED)
+* when the widget has been disposed
+* @exception SWTError(ERROR_CANNOT_GET_ITEM)
+* when the operation fails
+*/
+public String getItem (int index) {
+ checkWidget();
+ return list.getItem (index);
+}
+/**
+* Gets the number of items.
+* <p>
+* This operation will fail if the number of
+* items could not be queried from the OS.
+*
+* @return the number of items in the widget
+*
+* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+* when called from the wrong thread
+* @exception SWTError(ERROR_WIDGET_DISPOSED)
+* when the widget has been disposed
+* @exception SWTError(ERROR_CANNOT_GET_COUNT)
+* when the operation fails
+*/
+public int getItemCount () {
+ checkWidget();
+ return list.getItemCount ();
+}
+/**
+* Gets the height of one item.
+* <p>
+* This operation will fail if the height of
+* one item could not be queried from the OS.
+*
+* @return the height of one item in the widget
+*
+* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+* when called from the wrong thread
+* @exception SWTError(ERROR_WIDGET_DISPOSED)
+* when the widget has been disposed
+* @exception SWTError(ERROR_CANNOT_GET_ITEM_HEIGHT)
+* when the operation fails
+*/
+public int getItemHeight () {
+ checkWidget();
+ return list.getItemHeight ();
+}
+/**
+* Gets the items.
+* <p>
+* This operation will fail if the items cannot
+* be queried from the OS.
+*
+* @return the items in the widget
+*
+* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+* when called from the wrong thread
+* @exception SWTError(ERROR_WIDGET_DISPOSED)
+* when the widget has been disposed
+* @exception SWTError(ERROR_CANNOT_GET_ITEM)
+* when the operation fails
+*/
+public String [] getItems () {
+ checkWidget();
+ return list.getItems ();
+}
+/**
+* Gets the selection.
+* <p>
+* @return a point representing the selection start and end
+*
+* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+* when called from the wrong thread
+* @exception SWTError(ERROR_WIDGET_DISPOSED)
+* when the widget has been disposed
+*/
+public Point getSelection () {
+ checkWidget();
+ return text.getSelection ();
+}
+/**
+* Gets the index of the selected item.
+* <p>
+* Indexing is zero based.
+* If no item is selected -1 is returned.
+*
+* @return the index of the selected item.
+*
+* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+* when called from the wrong thread
+* @exception SWTError(ERROR_WIDGET_DISPOSED)
+* when the widget has been disposed
+*/
+public int getSelectionIndex () {
+ checkWidget();
+ return list.getSelectionIndex ();
+}
+/**
+* Gets the widget text.
+* <p>
+* If the widget has no text, an empty string is returned.
+*
+* @return the widget text
+*
+* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+* when called from the wrong thread
+* @exception SWTError(ERROR_WIDGET_DISPOSED)
+* when the widget has been disposed
+*/
+public String getText () {
+ checkWidget();
+ return text.getText ();
+}
+/**
+* Gets the height of the combo's text field.
+* <p>
+* The operation will fail if the height cannot
+* be queried from the OS.
+
+* @return the height of the combo's text field.
+*
+* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+* when called from the wrong thread
+* @exception SWTError(ERROR_WIDGET_DISPOSED)
+* when the widget has been disposed
+* @exception SWTError(ERROR_ERROR_CANNOT_GET_ITEM_HEIGHT)
+* when the operation fails
+*/
+public int getTextHeight () {
+ checkWidget();
+ return text.getLineHeight();
+}
+/**
+* Gets the text limit.
+* <p>
+* @return the text limit
+*
+* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+* when called from the wrong thread
+* @exception SWTError(ERROR_WIDGET_DISPOSED)
+* when the widget has been disposed
+*/
+public int getTextLimit () {
+ checkWidget();
+ return text.getTextLimit ();
+}
+/**
+* Gets the index of an item.
+* <p>
+* The list is searched starting at 0 until an
+* item is found that is equal to the search item.
+* If no item is found, -1 is returned. Indexing
+* is zero based.
+*
+* @param string the search item
+* @return the index of the item
+*
+* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+* when called from the wrong thread
+* @exception SWTError(ERROR_WIDGET_DISPOSED)
+* when the widget has been disposed
+* @exception SWTError(ERROR_NULL_ARGUMENT)
+* when string is null
+*/
+public int indexOf (String string) {
+ checkWidget();
+ if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+ return list.indexOf (string);
+}
+/**
+* Gets the index of an item.
+* <p>
+* The widget is searched starting at start including
+* the end position until an item is found that
+* is equal to the search itenm. If no item is
+* found, -1 is returned. Indexing is zero based.
+*
+* @param string the search item
+* @param index the starting position
+* @return the index of the item
+*
+* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+* when called from the wrong thread
+* @exception SWTError(ERROR_WIDGET_DISPOSED)
+* when the widget has been disposed
+* @exception SWTError(ERROR_NULL_ARGUMENT)
+* when string is null
+*/
+public int indexOf (String string, int start) {
+ checkWidget();
+ if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+ return list.indexOf (string, start);
+}
+
+void initAccessible() {
+ getAccessible().addAccessibleListener(new AccessibleAdapter() {
+ public void getHelp(AccessibleEvent e) {
+ e.result = getToolTipText();
+ }
+ });
+
+ getAccessible().addAccessibleControlListener(new AccessibleControlAdapter() {
+ public void getChildAtPoint(AccessibleControlEvent e) {
+ Point testPoint = toControl(new Point(e.x, e.y));
+ if (getBounds().contains(testPoint)) {
+ e.childID = ACC.CHILDID_SELF;
+ }
+ }
+
+ public void getLocation(AccessibleControlEvent e) {
+ Rectangle location = getBounds();
+ Point pt = toDisplay(new Point(location.x, location.y));
+ e.x = pt.x;
+ e.y = pt.y;
+ e.width = location.width;
+ e.height = location.height;
+ }
+
+ public void getChildCount(AccessibleControlEvent e) {
+ e.detail = 0;
+ }
+
+ public void getRole(AccessibleControlEvent e) {
+ e.detail = ACC.ROLE_COMBOBOX;
+ }
+
+ public void getState(AccessibleControlEvent e) {
+ e.detail = ACC.STATE_NORMAL;
+ }
+
+ public void getValue(AccessibleControlEvent e) {
+ e.result = getText();
+ }
+ });
+}
+boolean isDropped () {
+ return popup.getVisible ();
+}
+public boolean isFocusControl () {
+ checkWidget();
+ if (text.isFocusControl() || arrow.isFocusControl() || list.isFocusControl() || popup.isFocusControl()) {
+ return true;
+ } else {
+ return super.isFocusControl();
+ }
+}
+void internalLayout () {
+ if (isDropped ()) dropDown (false);
+
+ Rectangle rect = getClientArea();
+ int width = rect.width;
+ int height = rect.height;
+ Point arrowSize = arrow.computeSize(SWT.DEFAULT, height);
+ text.setBounds (0, 0, width - arrowSize.x, height);
+ arrow.setBounds (width - arrowSize.x, 0, arrowSize.x, arrowSize.y);
+
+ Point size = getSize();
+ int itemHeight = list.getItemHeight () * ITEMS_SHOWING;
+ Point listSize = list.computeSize (SWT.DEFAULT, itemHeight);
+ list.setBounds (1, 1, Math.max (size.x - 2, listSize.x), listSize.y);
+}
+void listEvent (Event event) {
+ switch (event.type) {
+ case SWT.FocusIn: {
+ if (hasFocus) return;
+ hasFocus = true;
+ if (getEditable ()) text.selectAll ();
+ Event e = new Event();
+ e.time = event.time;
+ notifyListeners(SWT.FocusIn, e);
+ break;
+ }
+ case SWT.FocusOut: {
+ event.display.asyncExec(new Runnable() {
+ public void run() {
+ if (CCombo.this.isDisposed()) return;
+ Control focusControl = getDisplay().getFocusControl();
+ if (focusControl == text || focusControl == arrow) return;
+ hasFocus = false;
+ Event e = new Event();
+ notifyListeners(SWT.FocusOut, e);
+ }
+ });
+ break;
+ }
+ case SWT.MouseUp: {
+ if (event.button != 1) return;
+ dropDown (false);
+ Event e = new Event();
+ e.time = event.time;
+ notifyListeners(SWT.DefaultSelection, e);
+ break;
+ }
+ case SWT.Selection: {
+ int index = list.getSelectionIndex ();
+ if (index == -1) return;
+ text.setText (list.getItem (index));
+ text.selectAll ();
+ list.setSelection(index);
+ Event e = new Event();
+ e.time = event.time;
+ e.stateMask = event.stateMask;
+ e.doit = event.doit;
+ notifyListeners(SWT.Selection, e);
+ event.doit = e.doit;
+ break;
+ }
+ case SWT.Traverse: {
+ switch (event.detail) {
+ case SWT.TRAVERSE_TAB_NEXT:
+ case SWT.TRAVERSE_RETURN:
+ case SWT.TRAVERSE_ESCAPE:
+ case SWT.TRAVERSE_ARROW_PREVIOUS:
+ case SWT.TRAVERSE_ARROW_NEXT:
+ event.doit = false;
+ break;
+ }
+ Event e = new Event();
+ e.time = event.time;
+ e.detail = event.detail;
+ e.doit = event.doit;
+ e.keyCode = event.keyCode;
+ notifyListeners(SWT.Traverse, e);
+ event.doit = e.doit;
+ break;
+ }
+ case SWT.KeyUp: {
+ Event e = new Event();
+ e.time = event.time;
+ e.character = event.character;
+ e.keyCode = event.keyCode;
+ e.stateMask = event.stateMask;
+ notifyListeners(SWT.KeyUp, e);
+ break;
+ }
+ case SWT.KeyDown: {
+ if (event.character == SWT.ESC) {
+ // escape key cancels popup list
+ dropDown (false);
+ }
+ if (event.character == SWT.CR || event.character == '\t') {
+ // Enter and Tab cause default selection
+ dropDown (false);
+ Event e = new Event();
+ e.time = event.time;
+ e.stateMask = event.stateMask;
+ notifyListeners(SWT.DefaultSelection, e);
+ }
+ //At this point the widget may have been disposed.
+ // If so, do not continue.
+ if (isDisposed()) break;
+ Event e = new Event();
+ e.time = event.time;
+ e.character = event.character;
+ e.keyCode = event.keyCode;
+ e.stateMask = event.stateMask;
+ notifyListeners(SWT.KeyDown, e);
+ break;
+
+ }
+ }
+}
+void popupEvent(Event event) {
+ switch (event.type) {
+ case SWT.Paint:
+ // draw black rectangle around list
+ Rectangle listRect = list.getBounds();
+ Color black = getDisplay().getSystemColor(SWT.COLOR_BLACK);
+ event.gc.setForeground(black);
+ event.gc.drawRectangle(0, 0, listRect.width + 1, listRect.height + 1);
+ break;
+ case SWT.Close:
+ event.doit = false;
+ dropDown (false);
+ break;
+ case SWT.Deactivate:
+ dropDown (false);
+ break;
+ }
+}
+public void redraw (int x, int y, int width, int height, boolean all) {
+ checkWidget();
+ if (!all) return;
+ Point location = text.getLocation();
+ text.redraw(x - location.x, y - location.y, width, height, all);
+ location = list.getLocation();
+ list.redraw(x - location.x, y - location.y, width, height, all);
+ if (arrow != null) {
+ location = arrow.getLocation();
+ arrow.redraw(x - location.x, y - location.y, width, height, all);
+ }
+}
+
+/**
+* Removes an item at an index.
+* <p>
+* Indexing is zero based.
+*
+* This operation will fail when the index is out
+* of range or an item could not be removed from
+* the OS.
+*
+* @param index the index of the item
+* @return the selection state
+*
+* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+* when called from the wrong thread
+* @exception SWTError(ERROR_WIDGET_DISPOSED)
+* when the widget has been disposed
+* @exception SWTError(ERROR_ITEM_NOT_REMOVED)
+* when the operation fails
+*/
+public void remove (int index) {
+ checkWidget();
+ list.remove (index);
+}
+/**
+* Removes a range of items.
+* <p>
+* Indexing is zero based. The range of items
+* is from the start index up to and including
+* the end index.
+*
+* This operation will fail when the index is out
+* of range or an item could not be removed from
+* the OS.
+*
+* @param start the start of the range
+* @param end the end of the range
+*
+* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+* when called from the wrong thread
+* @exception SWTError(ERROR_WIDGET_DISPOSED)
+* when the widget has been disposed
+* @exception SWTError(ERROR_ITEM_NOT_REMOVED)
+* when the operation fails
+*/
+public void remove (int start, int end) {
+ checkWidget();
+ list.remove (start, end);
+}
+/**
+* Removes an item.
+* <p>
+* This operation will fail when the item
+* could not be removed from the OS.
+*
+* @param string the search item
+*
+* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+* when called from the wrong thread
+* @exception SWTError(ERROR_WIDGET_DISPOSED)
+* when the widget has been disposed
+* @exception SWTError(ERROR_NULL_ARGUMENT)
+* when string is null
+* @exception SWTError(ERROR_ITEM_NOT_REMOVED)
+* when the operation fails
+*/
+public void remove (String string) {
+ checkWidget();
+ if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+ list.remove (string);
+}
+/**
+* Removes all items.
+* <p>
+* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+* when called from the wrong thread
+* @exception SWTError(ERROR_WIDGET_DISPOSED)
+* when the widget has been disposed
+*/
+public void removeAll () {
+ checkWidget();
+ text.setText (""); //$NON-NLS-1$
+ list.removeAll ();
+}
+/**
+* Removes the listener.
+* <p>
+*
+* @param listener the listener
+*
+* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+* when called from the wrong thread
+* @exception SWTError(ERROR_WIDGET_DISPOSED)
+* when the widget has been disposed
+* @exception SWTError(ERROR_NULL_ARGUMENT)
+* when listener is null
+*/
+public void removeModifyListener (ModifyListener listener) {
+ checkWidget();
+ if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+ removeListener(SWT.Modify, listener);
+}
+/**
+* Removes the listener.
+* <p>
+*
+* @param listener the listener
+*
+* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+* when called from the wrong thread
+* @exception SWTError(ERROR_WIDGET_DISPOSED)
+* when the widget has been disposed
+* @exception SWTError(ERROR_NULL_ARGUMENT)
+* when listener is null
+*/
+public void removeSelectionListener (SelectionListener listener) {
+ checkWidget();
+ if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+ removeListener(SWT.Selection, listener);
+ removeListener(SWT.DefaultSelection,listener);
+}
+/**
+* Selects an item.
+* <p>
+* If the item at an index is not selected, it is
+* selected. Indices that are out of
+* range are ignored. Indexing is zero based.
+*
+* @param index the index of the item
+*
+* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+* when called from the wrong thread
+* @exception SWTError(ERROR_WIDGET_DISPOSED)
+* when the widget has been disposed
+*/
+public void select (int index) {
+ checkWidget();
+ if (index == -1) {
+ list.deselectAll ();
+ text.setText (""); //$NON-NLS-1$
+ return;
+ }
+ if (0 <= index && index < list.getItemCount()) {
+ if (index != getSelectionIndex()) {
+ text.setText (list.getItem (index));
+ text.selectAll ();
+ list.select (index);
+ list.showSelection ();
+ }
+ }
+}
+public void setBackground (Color color) {
+ super.setBackground(color);
+ if (text != null) text.setBackground(color);
+ if (list != null) list.setBackground(color);
+ if (arrow != null) arrow.setBackground(color);
+}
+public boolean setFocus () {
+ checkWidget();
+ return text.setFocus ();
+}
+public void setFont (Font font) {
+ super.setFont (font);
+ text.setFont (font);
+ list.setFont (font);
+ internalLayout ();
+}
+public void setForeground (Color color) {
+ super.setForeground(color);
+ if (text != null) text.setForeground(color);
+ if (list != null) list.setForeground(color);
+ if (arrow != null) arrow.setForeground(color);
+}
+/**
+* Sets the text of an item.
+* <p>
+* Indexing is zero based.
+*
+* This operation will fail when the index is out
+* of range or an item could not be changed in
+* the OS.
+*
+* @param index the index for the item
+* @param string the item
+*
+* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+* when called from the wrong thread
+* @exception SWTError(ERROR_WIDGET_DISPOSED)
+* when the widget has been disposed
+* @exception SWTError(ERROR_NULL_ARGUMENT)
+* when items is null
+* @exception SWTError(ERROR_ITEM_NOT_MODIFIED)
+* when the operation fails
+*/
+public void setItem (int index, String string) {
+ checkWidget();
+ if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+ list.setItem (index, string);
+}
+/**
+* Sets all items.
+* <p>
+* @param items the array of items
+*
+* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+* when called from the wrong thread
+* @exception SWTError(ERROR_WIDGET_DISPOSED)
+* when the widget has been disposed
+* @exception SWTError(ERROR_NULL_ARGUMENT)
+* when items is null
+* @exception SWTError(ERROR_ITEM_NOT_ADDED)
+* when the operation fails
+*/
+public void setItems (String [] items) {
+ checkWidget();
+ if (items == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+ int style = getStyle();
+ if ((style & SWT.READ_ONLY) != 0) text.setText (""); //$NON-NLS-1$
+ list.setItems (items);
+}
+/**
+* Sets the new selection.
+* <p>
+* @param selection point representing the start and the end of the new selection
+*
+* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+* when called from the wrong thread
+* @exception SWTError(ERROR_WIDGET_DISPOSED)
+* when the widget has been disposed
+* @exception SWTError(ERROR_NULL_ARGUMENT)
+* when selection is null
+*/
+public void setSelection (Point selection) {
+ checkWidget();
+ if (selection == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+ text.setSelection (selection.x, selection.y);
+}
+
+/**
+* Sets the widget text
+* <p>
+* @param string the widget text
+*
+* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+* when called from the wrong thread
+* @exception SWTError(ERROR_WIDGET_DISPOSED)
+* when the widget has been disposed
+* @exception SWTError(ERROR_NULL_ARGUMENT)
+* when string is null
+*/
+public void setText (String string) {
+ checkWidget();
+ if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+ int index = list.indexOf (string);
+ if (index == -1) {
+ list.deselectAll ();
+ text.setText (string);
+ return;
+ }
+ text.setText (string);
+ text.selectAll ();
+ list.setSelection (index);
+ list.showSelection ();
+}
+/**
+* Sets the text limit
+* <p>
+* @param limit new text limit
+*
+* @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+* when called from the wrong thread
+* @exception SWTError(ERROR_WIDGET_DISPOSED)
+* when the widget has been disposed
+* @exception SWTError(ERROR_CANNOT_BE_ZERO)
+* when limit is 0
+*/
+public void setTextLimit (int limit) {
+ checkWidget();
+ text.setTextLimit (limit);
+}
+
+public void setToolTipText (String string) {
+ checkWidget();
+ super.setToolTipText(string);
+ arrow.setToolTipText (string);
+ text.setToolTipText (string);
+}
+
+public void setVisible (boolean visible) {
+ super.setVisible(visible);
+ if (!visible) popup.setVisible(false);
+}
+
+void textEvent (Event event) {
+ switch (event.type) {
+ case SWT.FocusIn: {
+ if (hasFocus) return;
+ hasFocus = true;
+ if (getEditable ()) text.selectAll ();
+ Event e = new Event();
+ e.time = event.time;
+ notifyListeners(SWT.FocusIn, e);
+ break;
+ }
+ case SWT.FocusOut: {
+ event.display.asyncExec(new Runnable() {
+ public void run() {
+ if (CCombo.this.isDisposed()) return;
+ Control focusControl = getDisplay().getFocusControl();
+ if (focusControl == list || focusControl == arrow) return;
+ hasFocus = false;
+ Event e = new Event();
+ notifyListeners(SWT.FocusOut, e);
+ }
+ });
+ break;
+ }
+ case SWT.KeyDown: {
+
+ if (event.character == SWT.ESC) { // escape key cancels popup list
+ dropDown (false);
+ }
+ if (event.character == SWT.CR) {
+ dropDown (false);
+ Event e = new Event();
+ e.time = event.time;
+ e.stateMask = event.stateMask;
+ notifyListeners(SWT.DefaultSelection, e);
+ }
+ //At this point the widget may have been disposed.
+ // If so, do not continue.
+ if (isDisposed()) break;
+
+ if (event.keyCode == SWT.ARROW_UP || event.keyCode == SWT.ARROW_DOWN) {
+ int oldIndex = getSelectionIndex ();
+ if (event.keyCode == SWT.ARROW_UP) {
+ select (Math.max (oldIndex - 1, 0));
+ } else {
+ select (Math.min (oldIndex + 1, getItemCount () - 1));
+ }
+
+ if (oldIndex != getSelectionIndex ()) {
+ Event e = new Event();
+ e.time = event.time;
+ e.stateMask = event.stateMask;
+ notifyListeners(SWT.Selection, e);
+ }
+ //At this point the widget may have been disposed.
+ // If so, do not continue.
+ if (isDisposed()) break;
+ }
+
+ // Further work : Need to add support for incremental search in
+ // pop up list as characters typed in text widget
+
+ Event e = new Event();
+ e.time = event.time;
+ e.character = event.character;
+ e.keyCode = event.keyCode;
+ e.stateMask = event.stateMask;
+ notifyListeners(SWT.KeyDown, e);
+ break;
+ }
+ case SWT.KeyUp: {
+ Event e = new Event();
+ e.time = event.time;
+ e.character = event.character;
+ e.keyCode = event.keyCode;
+ e.stateMask = event.stateMask;
+ notifyListeners(SWT.KeyUp, e);
+ break;
+ }
+ case SWT.Modify: {
+ list.deselectAll ();
+ Event e = new Event();
+ e.time = event.time;
+ notifyListeners(SWT.Modify, e);
+ break;
+ }
+ case SWT.MouseDown: {
+ if (event.button != 1) return;
+ if (text.getEditable ()) return;
+ boolean dropped = isDropped ();
+ text.selectAll ();
+ if (!dropped) setFocus ();
+ dropDown (!dropped);
+ break;
+ }
+ case SWT.MouseUp: {
+ if (event.button != 1) return;
+ if (text.getEditable ()) return;
+ text.selectAll ();
+ break;
+ }
+ case SWT.Traverse: {
+ switch (event.detail) {
+ case SWT.TRAVERSE_RETURN:
+ case SWT.TRAVERSE_ARROW_PREVIOUS:
+ case SWT.TRAVERSE_ARROW_NEXT:
+ // The enter causes default selection and
+ // the arrow keys are used to manipulate the list contents so
+ // do not use them for traversal.
+ event.doit = false;
+ break;
+ }
+
+ Event e = new Event();
+ e.time = event.time;
+ e.detail = event.detail;
+ e.doit = event.doit;
+ e.keyCode = event.keyCode;
+ notifyListeners(SWT.Traverse, e);
+ event.doit = e.doit;
+ break;
+ }
+ }
+}
}
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 eba4c43e10..62576ceb0a 100755
--- 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
@@ -1,611 +1,611 @@
-package org.eclipse.swt.custom;
-
-/*
+package org.eclipse.swt.custom;
+
+/*
* Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
* This file is made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- */
-
-import org.eclipse.swt.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.accessibility.*;
-
-/**
- * A Label which supports aligned text and/or an image and different border styles.
- * <p>
- * If there is not enough space a CLabel uses the following strategy to fit the
- * information into the available space:
- * <pre>
- * ignores the indent in left align mode
- * ignores the image and the gap
- * shortens the text by replacing the center portion of the label with an ellipsis
- * shortens the text by removing the center portion of the label
- * </pre>
- * <p>
- * <dl>
- * <dt><b>Styles:</b>
- * <dd>LEFT, RIGHT, CENTER, SHADOW_IN, SHADOW_OUT, SHADOW_NONE</dd>
- * <dt><b>Events:</b>
- * <dd></dd>
- * </dl>
- */
-public class CLabel extends Canvas {
-
- /** Gap between icon and text */
- private static final int GAP = 5;
- /** Left and right margins */
- private static final int INDENT = 3;
- /** a string inserted in the middle of text that has been shortened */
- private static final String ellipsis = "..."; //$NON-NLS-1$
- /** the alignment. Either CENTER, RIGHT, LEFT. Default is LEFT*/
- private int align = SWT.LEFT;
- private int hIndent = INDENT;
- private int vIndent = INDENT;
- /** the current text */
- private String text;
- /** the current icon */
- private Image image;
- // The tooltip is used for two purposes - the application can set
- // a tooltip or the tooltip can be used to display the full text when the
- // the text has been truncated due to the label being too short.
- // The appToolTip stores the tooltip set by the application. Control.tooltiptext
- // contains whatever tooltip is currently being displayed.
- private String appToolTipText;
-
- private Image backgroundImage;
- private Color[] gradientColors;
- private int[] gradientPercents;
-
-/**
- * Constructs a new instance of this class given its parent
- * and a style value describing its behavior and appearance.
- * <p>
- * The style value is either one of the style constants defined in
- * class <code>SWT</code> which is applicable to instances of this
- * class, or must be built by <em>bitwise OR</em>'ing together
- * (that is, using the <code>int</code> "|" operator) two or more
- * of those <code>SWT</code> style constants. The class description
- * lists the style constants that are applicable to the class.
- * Style bits are also inherited from superclasses.
- * </p>
- *
- * @param parent a widget which will be the parent of the new instance (cannot be null)
- * @param style the style of widget to construct
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
- * </ul>
- *
- * @see SWT#LEFT
- * @see SWT#RIGHT
- * @see SWT#CENTER
- * @see SWT#SHADOW_IN
- * @see SWT#SHADOW_OUT
- * @see SWT#SHADOW_NONE
- * @see #getStyle
- */
-public CLabel(Composite parent, int style) {
- super(parent, checkStyle(style));
-
- if ((style & SWT.CENTER) != 0) align = SWT.CENTER;
- if ((style & SWT.RIGHT) != 0) align = SWT.RIGHT;
- if ((style & SWT.LEFT) != 0) align = SWT.LEFT;
-
- addPaintListener(new PaintListener(){
- public void paintControl(PaintEvent event) {
- onPaint(event);
- }
- });
-
- addDisposeListener(new DisposeListener(){
- public void widgetDisposed(DisposeEvent event) {
- onDispose(event);
- }
- });
-
- initAccessible();
-
-}
-/**
- * Check the style bits to ensure that no invalid styles are applied.
- */
-private static int checkStyle (int style) {
- int mask = SWT.SHADOW_IN | SWT.SHADOW_OUT | SWT.SHADOW_NONE;
- style = style & mask;
- style |= SWT.NO_FOCUS;
- //TEMPORARY CODE
- /*
- * The default background on carbon and some GTK themes is not a solid color
- * but a texture. To show the correct default background, we must allow
- * the operating system to draw it and therefore, we can not use the
- * NO_BACKGROUND style. The NO_BACKGROUND style is not required on platforms
- * that use double buffering which is true in both of these cases.
- */
- String platform = SWT.getPlatform();
- if ("carbon".equals(platform) || "gtk".equals(platform)) return style; //$NON-NLS-1$ //$NON-NLS-2$
- return style | SWT.NO_BACKGROUND;
-}
-public Point computeSize(int wHint, int hHint, boolean changed) {
- checkWidget();
- Point e = getTotalSize(image, text);
- if (wHint == SWT.DEFAULT){
- e.x += 2*hIndent;
- } else {
- e.x = wHint;
- }
- if (hHint == SWT.DEFAULT) {
- e.y += 2*vIndent;
- } else {
- e.y = hHint;
- }
- return e;
-}
-/**
- * Draw a rectangle in the given colors.
- */
-private void drawBevelRect(GC gc, int x, int y, int w, int h, Color topleft, Color bottomright) {
- gc.setForeground(bottomright);
- gc.drawLine(x+w, y, x+w, y+h);
- gc.drawLine(x, y+h, x+w, y+h);
-
- gc.setForeground(topleft);
- gc.drawLine(x, y, x+w-1, y);
- gc.drawLine(x, y, x, y+h-1);
-}
-/**
- * Returns the alignment.
- * The alignment style (LEFT, CENTER or RIGHT) is returned.
- *
- * @return SWT.LEFT, SWT.RIGHT or SWT.CENTER
- */
-public int getAlignment() {
- //checkWidget();
- return align;
-}
-/**
- * Return the CLabel's image or <code>null</code>.
- *
- * @return the image of the label or null
- */
-public Image getImage() {
- //checkWidget();
- return image;
-}
-/**
- * Compute the minimum size.
- */
-private Point getTotalSize(Image image, String text) {
- Point size = new Point(0, 0);
-
- if (image != null) {
- Rectangle r = image.getBounds();
- size.x += r.width;
- size.y += r.height;
- }
-
- GC gc = new GC(this);
- if (text != null && text.length() > 0) {
- Point e = gc.textExtent(text);
- size.x += e.x;
- size.y = Math.max(size.y, e.y);
- if (image != null) size.x += GAP;
- } else {
- size.y = Math.max(size.y, gc.getFontMetrics().getHeight());
- }
- gc.dispose();
-
- return size;
-}
-public void setToolTipText (String string) {
- super.setToolTipText (string);
- appToolTipText = super.getToolTipText();
-}
-/**
- * Return the Label's text.
- *
- * @return the text of the label or null
- */
-public String getText() {
- //checkWidget();
- return text;
-}
-public String getToolTipText () {
- checkWidget();
- return appToolTipText;
-}
-/**
- * Paint the Label's border.
- */
-private void paintBorder(GC gc, Rectangle r) {
- Display disp= getDisplay();
-
- Color c1 = null;
- Color c2 = null;
-
- int style = getStyle();
- if ((style & SWT.SHADOW_IN) != 0) {
- c1 = disp.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW);
- c2 = disp.getSystemColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW);
- }
- if ((style & SWT.SHADOW_OUT) != 0) {
- c1 = disp.getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW);
- c2 = disp.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW);
- }
-
- if (c1 != null && c2 != null) {
- gc.setLineWidth(1);
- drawBevelRect(gc, r.x, r.y, r.width-1, r.height-1, c1, c2);
- }
-}
-private void initAccessible() {
- Accessible accessible = getAccessible();
- accessible.addAccessibleListener(new AccessibleAdapter() {
- public void getName(AccessibleEvent e) {
- e.result = getText();
- }
-
- public void getHelp(AccessibleEvent e) {
- e.result = getToolTipText();
- }
- });
-
- accessible.addAccessibleControlListener(new AccessibleControlAdapter() {
- public void getChildAtPoint(AccessibleControlEvent e) {
- Point pt = toControl(new Point(e.x, e.y));
- e.childID = (getBounds().contains(pt)) ? ACC.CHILDID_SELF : ACC.CHILDID_NONE;
- }
-
- public void getLocation(AccessibleControlEvent e) {
- Rectangle location = getBounds();
- Point pt = toDisplay(new Point(location.x, location.y));
- e.x = pt.x;
- e.y = pt.y;
- e.width = location.width;
- e.height = location.height;
- }
-
- public void getChildCount(AccessibleControlEvent e) {
- e.detail = 0;
- }
-
- public void getRole(AccessibleControlEvent e) {
- e.detail = ACC.ROLE_LABEL;
- }
-
- public void getState(AccessibleControlEvent e) {
- e.detail = ACC.STATE_READONLY;
- }
- });
-}
-private void onDispose(DisposeEvent event) {
- gradientColors = null;
- gradientPercents = null;
- backgroundImage = null;
- text = null;
- image = null;
- appToolTipText = null;
-}
-/*
- * Process the paint event
- */
-private void onPaint(PaintEvent event) {
- Rectangle rect = getClientArea();
- if (rect.width == 0 || rect.height == 0) return;
-
- boolean shortenText = false;
- String t = text;
- Image img = image;
- int availableWidth = rect.width - 2*hIndent;
- Point extent = getTotalSize(img, t);
- if (extent.x > availableWidth) {
- img = null;
- extent = getTotalSize(img, t);
- if (extent.x > availableWidth) {
- shortenText = true;
- }
- }
-
- GC gc = event.gc;
-
- // shorten the text
- if (shortenText) {
- t = shortenText(gc, text, availableWidth);
- extent = getTotalSize(img, t);
- if (appToolTipText == null) {
- super.setToolTipText(text);
- }
- } else {
- super.setToolTipText(appToolTipText);
- }
-
- // determine horizontal position
- int x = rect.x + hIndent;
- if (align == SWT.CENTER) {
- x = (rect.width-extent.x)/2;
- }
- if (align == SWT.RIGHT) {
- x = rect.width-extent.x - hIndent;
- }
-
- // draw a background image behind the text
- try {
- if (backgroundImage != null) {
- // draw a background image behind the text
- Rectangle imageRect = backgroundImage.getBounds();
- gc.drawImage(backgroundImage, 0, 0, imageRect.width, imageRect.height,
- 0, 0, rect.width, rect.height);
- } else if (gradientColors != null) {
- // draw a gradient behind the text
- final Color oldBackground = gc.getBackground();
- if (gradientColors.length == 1) {
- if (gradientColors[0] != null) gc.setBackground(gradientColors[0]);
- gc.fillRectangle(0, 0, rect.width, rect.height);
- } else {
- final Color oldForeground = gc.getForeground();
- Color lastColor = gradientColors[0];
- if (lastColor == null) lastColor = oldBackground;
- for (int i = 0, pos = 0; i < gradientPercents.length; ++i) {
- gc.setForeground(lastColor);
- lastColor = gradientColors[i + 1];
- if (lastColor == null) lastColor = oldBackground;
- gc.setBackground(lastColor);
- final int gradientWidth = (gradientPercents[i] * rect.width / 100) - pos;
- gc.fillGradientRectangle(pos, 0, gradientWidth, rect.height, false);
- pos += gradientWidth;
- }
- gc.setForeground(oldForeground);
- }
- gc.setBackground(oldBackground);
- } else {
- if ((getStyle() & SWT.NO_BACKGROUND) != 0) {
- gc.setBackground(getBackground());
- gc.fillRectangle(rect);
- }
- }
- } catch (SWTException e) {
- if ((getStyle() & SWT.NO_BACKGROUND) != 0) {
- gc.setBackground(getBackground());
- gc.fillRectangle(rect);
- }
- }
-
- // draw border
- int style = getStyle();
- if ((style & SWT.SHADOW_IN) != 0 || (style & SWT.SHADOW_OUT) != 0) {
- paintBorder(gc, rect);
- }
- // draw the image
- if (img != null) {
- Rectangle imageRect = img.getBounds();
- gc.drawImage(img, 0, 0, imageRect.width, imageRect.height,
- x, (rect.height-imageRect.height)/2, imageRect.width, imageRect.height);
- x += imageRect.width + GAP;
- }
- // draw the text
- if (t != null) {
- int textHeight = gc.getFontMetrics().getHeight();
- gc.setForeground(getForeground());
- gc.drawText(t, x, rect.y + (rect.height-textHeight)/2, true);
- }
-}
-/**
- * Set the alignment of the CLabel.
- * Use the values LEFT, CENTER and RIGHT to align image and text within the available space.
- *
- * @param align the alignment style of LEFT, RIGHT or CENTER
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * <li>ERROR_INVALID_ARGUMENT - if the value of align is not one of SWT.LEFT, SWT.RIGHT or SWT.CENTER</li>
- * </ul>
- */
-public void setAlignment(int align) {
- checkWidget();
- if (align != SWT.LEFT && align != SWT.RIGHT && align != SWT.CENTER) {
- SWT.error(SWT.ERROR_INVALID_ARGUMENT);
- }
- if (this.align != align) {
- this.align = align;
- redraw();
- }
-}
-
-public void setBackground (Color color) {
- super.setBackground (color);
- // Are these settings the same as before?
- if (color != null && backgroundImage == null &&
- gradientColors == null && gradientPercents == null) {
- Color background = getBackground();
- if (color.equals(background)) {
- return;
- }
- }
- backgroundImage = null;
- gradientColors = null;
- gradientPercents = null;
- redraw ();
-}
-
-/**
- * Specify a gradient of colours to be drawn in the background of the CLabel.
- * <p>For example, to draw a gradient that varies from dark blue to blue and then to
- * white and stays white for the right hald of the label, use the following call
- * to setBackground:</p>
- * <pre>
- * clabel.setBackground(new Color[]{display.getSystemColor(SWT.COLOR_DARK_BLUE),
- * display.getSystemColor(SWT.COLOR_BLUE),
- * display.getSystemColor(SWT.COLOR_WHITE),
- * display.getSystemColor(SWT.COLOR_WHITE)},
- * new int[] {25, 50, 100});
- * </pre>
- *
- * @param colors an array of Color that specifies the colors to appear in the gradient
- * in order of appearance from left to right; The value <code>null</code>
- * clears the background gradient; the value <code>null</code> can be used
- * inside the array of Color to specify the background color.
- * @param percents an array of integers between 0 and 100 specifying the percent of the width
- * of the widget at which the color should change; the size of the percents
- * array must be one less than the size of the colors array.
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * <li>ERROR_INVALID_ARGUMENT - if the values of colors and percents are not consistant</li>
- * </ul>
- */
-public void setBackground(Color[] colors, int[] percents) {
- checkWidget();
- if (colors != null) {
- if (percents == null || percents.length != colors.length - 1) {
- SWT.error(SWT.ERROR_INVALID_ARGUMENT);
- }
- if (getDisplay().getDepth() < 15) {
- // Don't use gradients on low color displays
- colors = new Color[] { colors[0] };
- percents = new int[] { };
- }
- for (int i = 0; i < percents.length; i++) {
- if (percents[i] < 0 || percents[i] > 100) {
- SWT.error(SWT.ERROR_INVALID_ARGUMENT);
- }
- if (i > 0 && percents[i] < percents[i-1]) {
- SWT.error(SWT.ERROR_INVALID_ARGUMENT);
- }
- }
- }
-
- // Are these settings the same as before?
- final Color background = getBackground();
- if (backgroundImage == null) {
- if ((gradientColors != null) && (colors != null) &&
- (gradientColors.length == colors.length)) {
- boolean same = false;
- for (int i = 0; i < gradientColors.length; i++) {
- same = (gradientColors[i] == colors[i]) ||
- ((gradientColors[i] == null) && (colors[i] == background)) ||
- ((gradientColors[i] == background) && (colors[i] == null));
- if (!same) break;
- }
- if (same) {
- for (int i = 0; i < gradientPercents.length; i++) {
- same = gradientPercents[i] == percents[i];
- if (!same) break;
- }
- }
- if (same) return;
- }
- } else {
- backgroundImage = null;
- }
- // Store the new settings
- if (colors == null) {
- gradientColors = null;
- gradientPercents = null;
- } else {
- gradientColors = new Color[colors.length];
- for (int i = 0; i < colors.length; ++i)
- gradientColors[i] = (colors[i] != null) ? colors[i] : background;
- gradientPercents = new int[percents.length];
- for (int i = 0; i < percents.length; ++i)
- gradientPercents[i] = percents[i];
- }
- // Refresh with the new settings
- redraw();
-}
-/**
- * Set the image to be drawn in the background of the label.
- *
- * @param image the image to be drawn in the background
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void setBackground(Image image) {
- checkWidget();
- if (image == backgroundImage) return;
- if (image != null) {
- gradientColors = null;
- gradientPercents = null;
- }
- backgroundImage = image;
- redraw();
-
-}
-public void setFont(Font font) {
- super.setFont(font);
- redraw();
-}
-/**
- * Set the label's Image.
- * The value <code>null</code> clears it.
- *
- * @param image the image to be displayed in the label or null
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void setImage(Image image) {
- checkWidget();
- if (image != this.image) {
- this.image = image;
- redraw();
- }
-}
-/**
- * Set the label's text.
- * The value <code>null</code> clears it.
- *
- * @param text the text to be displayed in the label or null
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void setText(String text) {
- checkWidget();
- if (text == null) text = ""; //$NON-NLS-1$
- if (! text.equals(this.text)) {
- this.text = text;
- redraw();
- }
-}
-/**
- * Shorten the given text <code>t</code> so that its length doesn't exceed
- * the given width. The default implementation replaces characters in the
- * center of the original string with an ellipsis ("...").
- * Override if you need a different strategy.
- */
-protected String shortenText(GC gc, String t, int width) {
- if (t == null) return null;
- int w = gc.textExtent(ellipsis).x;
- int l = t.length();
- int pivot = l/2;
- int s = pivot;
- int e = pivot+1;
- while (s >= 0 && e < l) {
- String s1 = t.substring(0, s);
- String s2 = t.substring(e, l);
- int l1 = gc.textExtent(s1).x;
- int l2 = gc.textExtent(s2).x;
- if (l1+w+l2 < width) {
- t = s1 + ellipsis + s2;
- break;
- }
- s--;
- e++;
- }
- return t;
-}
-}
+ * http://www.eclipse.org/legal/cpl-v10.html
+ */
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.accessibility.*;
+
+/**
+ * A Label which supports aligned text and/or an image and different border styles.
+ * <p>
+ * If there is not enough space a CLabel uses the following strategy to fit the
+ * information into the available space:
+ * <pre>
+ * ignores the indent in left align mode
+ * ignores the image and the gap
+ * shortens the text by replacing the center portion of the label with an ellipsis
+ * shortens the text by removing the center portion of the label
+ * </pre>
+ * <p>
+ * <dl>
+ * <dt><b>Styles:</b>
+ * <dd>LEFT, RIGHT, CENTER, SHADOW_IN, SHADOW_OUT, SHADOW_NONE</dd>
+ * <dt><b>Events:</b>
+ * <dd></dd>
+ * </dl>
+ */
+public class CLabel extends Canvas {
+
+ /** Gap between icon and text */
+ private static final int GAP = 5;
+ /** Left and right margins */
+ private static final int INDENT = 3;
+ /** a string inserted in the middle of text that has been shortened */
+ private static final String ellipsis = "..."; //$NON-NLS-1$
+ /** the alignment. Either CENTER, RIGHT, LEFT. Default is LEFT*/
+ private int align = SWT.LEFT;
+ private int hIndent = INDENT;
+ private int vIndent = INDENT;
+ /** the current text */
+ private String text;
+ /** the current icon */
+ private Image image;
+ // The tooltip is used for two purposes - the application can set
+ // a tooltip or the tooltip can be used to display the full text when the
+ // the text has been truncated due to the label being too short.
+ // The appToolTip stores the tooltip set by the application. Control.tooltiptext
+ // contains whatever tooltip is currently being displayed.
+ private String appToolTipText;
+
+ private Image backgroundImage;
+ private Color[] gradientColors;
+ private int[] gradientPercents;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a widget which will be the parent of the new instance (cannot be null)
+ * @param style the style of widget to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ *
+ * @see SWT#LEFT
+ * @see SWT#RIGHT
+ * @see SWT#CENTER
+ * @see SWT#SHADOW_IN
+ * @see SWT#SHADOW_OUT
+ * @see SWT#SHADOW_NONE
+ * @see #getStyle
+ */
+public CLabel(Composite parent, int style) {
+ super(parent, checkStyle(style));
+
+ if ((style & SWT.CENTER) != 0) align = SWT.CENTER;
+ if ((style & SWT.RIGHT) != 0) align = SWT.RIGHT;
+ if ((style & SWT.LEFT) != 0) align = SWT.LEFT;
+
+ addPaintListener(new PaintListener(){
+ public void paintControl(PaintEvent event) {
+ onPaint(event);
+ }
+ });
+
+ addDisposeListener(new DisposeListener(){
+ public void widgetDisposed(DisposeEvent event) {
+ onDispose(event);
+ }
+ });
+
+ initAccessible();
+
+}
+/**
+ * Check the style bits to ensure that no invalid styles are applied.
+ */
+private static int checkStyle (int style) {
+ int mask = SWT.SHADOW_IN | SWT.SHADOW_OUT | SWT.SHADOW_NONE;
+ style = style & mask;
+ style |= SWT.NO_FOCUS;
+ //TEMPORARY CODE
+ /*
+ * The default background on carbon and some GTK themes is not a solid color
+ * but a texture. To show the correct default background, we must allow
+ * the operating system to draw it and therefore, we can not use the
+ * NO_BACKGROUND style. The NO_BACKGROUND style is not required on platforms
+ * that use double buffering which is true in both of these cases.
+ */
+ String platform = SWT.getPlatform();
+ if ("carbon".equals(platform) || "gtk".equals(platform)) return style; //$NON-NLS-1$ //$NON-NLS-2$
+ return style | SWT.NO_BACKGROUND;
+}
+public Point computeSize(int wHint, int hHint, boolean changed) {
+ checkWidget();
+ Point e = getTotalSize(image, text);
+ if (wHint == SWT.DEFAULT){
+ e.x += 2*hIndent;
+ } else {
+ e.x = wHint;
+ }
+ if (hHint == SWT.DEFAULT) {
+ e.y += 2*vIndent;
+ } else {
+ e.y = hHint;
+ }
+ return e;
+}
+/**
+ * Draw a rectangle in the given colors.
+ */
+private void drawBevelRect(GC gc, int x, int y, int w, int h, Color topleft, Color bottomright) {
+ gc.setForeground(bottomright);
+ gc.drawLine(x+w, y, x+w, y+h);
+ gc.drawLine(x, y+h, x+w, y+h);
+
+ gc.setForeground(topleft);
+ gc.drawLine(x, y, x+w-1, y);
+ gc.drawLine(x, y, x, y+h-1);
+}
+/**
+ * Returns the alignment.
+ * The alignment style (LEFT, CENTER or RIGHT) is returned.
+ *
+ * @return SWT.LEFT, SWT.RIGHT or SWT.CENTER
+ */
+public int getAlignment() {
+ //checkWidget();
+ return align;
+}
+/**
+ * Return the CLabel's image or <code>null</code>.
+ *
+ * @return the image of the label or null
+ */
+public Image getImage() {
+ //checkWidget();
+ return image;
+}
+/**
+ * Compute the minimum size.
+ */
+private Point getTotalSize(Image image, String text) {
+ Point size = new Point(0, 0);
+
+ if (image != null) {
+ Rectangle r = image.getBounds();
+ size.x += r.width;
+ size.y += r.height;
+ }
+
+ GC gc = new GC(this);
+ if (text != null && text.length() > 0) {
+ Point e = gc.textExtent(text);
+ size.x += e.x;
+ size.y = Math.max(size.y, e.y);
+ if (image != null) size.x += GAP;
+ } else {
+ size.y = Math.max(size.y, gc.getFontMetrics().getHeight());
+ }
+ gc.dispose();
+
+ return size;
+}
+public void setToolTipText (String string) {
+ super.setToolTipText (string);
+ appToolTipText = super.getToolTipText();
+}
+/**
+ * Return the Label's text.
+ *
+ * @return the text of the label or null
+ */
+public String getText() {
+ //checkWidget();
+ return text;
+}
+public String getToolTipText () {
+ checkWidget();
+ return appToolTipText;
+}
+/**
+ * Paint the Label's border.
+ */
+private void paintBorder(GC gc, Rectangle r) {
+ Display disp= getDisplay();
+
+ Color c1 = null;
+ Color c2 = null;
+
+ int style = getStyle();
+ if ((style & SWT.SHADOW_IN) != 0) {
+ c1 = disp.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW);
+ c2 = disp.getSystemColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW);
+ }
+ if ((style & SWT.SHADOW_OUT) != 0) {
+ c1 = disp.getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW);
+ c2 = disp.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW);
+ }
+
+ if (c1 != null && c2 != null) {
+ gc.setLineWidth(1);
+ drawBevelRect(gc, r.x, r.y, r.width-1, r.height-1, c1, c2);
+ }
+}
+private void initAccessible() {
+ Accessible accessible = getAccessible();
+ accessible.addAccessibleListener(new AccessibleAdapter() {
+ public void getName(AccessibleEvent e) {
+ e.result = getText();
+ }
+
+ public void getHelp(AccessibleEvent e) {
+ e.result = getToolTipText();
+ }
+ });
+
+ accessible.addAccessibleControlListener(new AccessibleControlAdapter() {
+ public void getChildAtPoint(AccessibleControlEvent e) {
+ Point pt = toControl(new Point(e.x, e.y));
+ e.childID = (getBounds().contains(pt)) ? ACC.CHILDID_SELF : ACC.CHILDID_NONE;
+ }
+
+ public void getLocation(AccessibleControlEvent e) {
+ Rectangle location = getBounds();
+ Point pt = toDisplay(new Point(location.x, location.y));
+ e.x = pt.x;
+ e.y = pt.y;
+ e.width = location.width;
+ e.height = location.height;
+ }
+
+ public void getChildCount(AccessibleControlEvent e) {
+ e.detail = 0;
+ }
+
+ public void getRole(AccessibleControlEvent e) {
+ e.detail = ACC.ROLE_LABEL;
+ }
+
+ public void getState(AccessibleControlEvent e) {
+ e.detail = ACC.STATE_READONLY;
+ }
+ });
+}
+private void onDispose(DisposeEvent event) {
+ gradientColors = null;
+ gradientPercents = null;
+ backgroundImage = null;
+ text = null;
+ image = null;
+ appToolTipText = null;
+}
+/*
+ * Process the paint event
+ */
+private void onPaint(PaintEvent event) {
+ Rectangle rect = getClientArea();
+ if (rect.width == 0 || rect.height == 0) return;
+
+ boolean shortenText = false;
+ String t = text;
+ Image img = image;
+ int availableWidth = rect.width - 2*hIndent;
+ Point extent = getTotalSize(img, t);
+ if (extent.x > availableWidth) {
+ img = null;
+ extent = getTotalSize(img, t);
+ if (extent.x > availableWidth) {
+ shortenText = true;
+ }
+ }
+
+ GC gc = event.gc;
+
+ // shorten the text
+ if (shortenText) {
+ t = shortenText(gc, text, availableWidth);
+ extent = getTotalSize(img, t);
+ if (appToolTipText == null) {
+ super.setToolTipText(text);
+ }
+ } else {
+ super.setToolTipText(appToolTipText);
+ }
+
+ // determine horizontal position
+ int x = rect.x + hIndent;
+ if (align == SWT.CENTER) {
+ x = (rect.width-extent.x)/2;
+ }
+ if (align == SWT.RIGHT) {
+ x = rect.width-extent.x - hIndent;
+ }
+
+ // draw a background image behind the text
+ try {
+ if (backgroundImage != null) {
+ // draw a background image behind the text
+ Rectangle imageRect = backgroundImage.getBounds();
+ gc.drawImage(backgroundImage, 0, 0, imageRect.width, imageRect.height,
+ 0, 0, rect.width, rect.height);
+ } else if (gradientColors != null) {
+ // draw a gradient behind the text
+ final Color oldBackground = gc.getBackground();
+ if (gradientColors.length == 1) {
+ if (gradientColors[0] != null) gc.setBackground(gradientColors[0]);
+ gc.fillRectangle(0, 0, rect.width, rect.height);
+ } else {
+ final Color oldForeground = gc.getForeground();
+ Color lastColor = gradientColors[0];
+ if (lastColor == null) lastColor = oldBackground;
+ for (int i = 0, pos = 0; i < gradientPercents.length; ++i) {
+ gc.setForeground(lastColor);
+ lastColor = gradientColors[i + 1];
+ if (lastColor == null) lastColor = oldBackground;
+ gc.setBackground(lastColor);
+ final int gradientWidth = (gradientPercents[i] * rect.width / 100) - pos;
+ gc.fillGradientRectangle(pos, 0, gradientWidth, rect.height, false);
+ pos += gradientWidth;
+ }
+ gc.setForeground(oldForeground);
+ }
+ gc.setBackground(oldBackground);
+ } else {
+ if ((getStyle() & SWT.NO_BACKGROUND) != 0) {
+ gc.setBackground(getBackground());
+ gc.fillRectangle(rect);
+ }
+ }
+ } catch (SWTException e) {
+ if ((getStyle() & SWT.NO_BACKGROUND) != 0) {
+ gc.setBackground(getBackground());
+ gc.fillRectangle(rect);
+ }
+ }
+
+ // draw border
+ int style = getStyle();
+ if ((style & SWT.SHADOW_IN) != 0 || (style & SWT.SHADOW_OUT) != 0) {
+ paintBorder(gc, rect);
+ }
+ // draw the image
+ if (img != null) {
+ Rectangle imageRect = img.getBounds();
+ gc.drawImage(img, 0, 0, imageRect.width, imageRect.height,
+ x, (rect.height-imageRect.height)/2, imageRect.width, imageRect.height);
+ x += imageRect.width + GAP;
+ }
+ // draw the text
+ if (t != null) {
+ int textHeight = gc.getFontMetrics().getHeight();
+ gc.setForeground(getForeground());
+ gc.drawText(t, x, rect.y + (rect.height-textHeight)/2, true);
+ }
+}
+/**
+ * Set the alignment of the CLabel.
+ * Use the values LEFT, CENTER and RIGHT to align image and text within the available space.
+ *
+ * @param align the alignment style of LEFT, RIGHT or CENTER
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the value of align is not one of SWT.LEFT, SWT.RIGHT or SWT.CENTER</li>
+ * </ul>
+ */
+public void setAlignment(int align) {
+ checkWidget();
+ if (align != SWT.LEFT && align != SWT.RIGHT && align != SWT.CENTER) {
+ SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+ if (this.align != align) {
+ this.align = align;
+ redraw();
+ }
+}
+
+public void setBackground (Color color) {
+ super.setBackground (color);
+ // Are these settings the same as before?
+ if (color != null && backgroundImage == null &&
+ gradientColors == null && gradientPercents == null) {
+ Color background = getBackground();
+ if (color.equals(background)) {
+ return;
+ }
+ }
+ backgroundImage = null;
+ gradientColors = null;
+ gradientPercents = null;
+ redraw ();
+}
+
+/**
+ * Specify a gradient of colours to be drawn in the background of the CLabel.
+ * <p>For example, to draw a gradient that varies from dark blue to blue and then to
+ * white and stays white for the right hald of the label, use the following call
+ * to setBackground:</p>
+ * <pre>
+ * clabel.setBackground(new Color[]{display.getSystemColor(SWT.COLOR_DARK_BLUE),
+ * display.getSystemColor(SWT.COLOR_BLUE),
+ * display.getSystemColor(SWT.COLOR_WHITE),
+ * display.getSystemColor(SWT.COLOR_WHITE)},
+ * new int[] {25, 50, 100});
+ * </pre>
+ *
+ * @param colors an array of Color that specifies the colors to appear in the gradient
+ * in order of appearance from left to right; The value <code>null</code>
+ * clears the background gradient; the value <code>null</code> can be used
+ * inside the array of Color to specify the background color.
+ * @param percents an array of integers between 0 and 100 specifying the percent of the width
+ * of the widget at which the color should change; the size of the percents
+ * array must be one less than the size of the colors array.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the values of colors and percents are not consistant</li>
+ * </ul>
+ */
+public void setBackground(Color[] colors, int[] percents) {
+ checkWidget();
+ if (colors != null) {
+ if (percents == null || percents.length != colors.length - 1) {
+ SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+ if (getDisplay().getDepth() < 15) {
+ // Don't use gradients on low color displays
+ colors = new Color[] { colors[0] };
+ percents = new int[] { };
+ }
+ for (int i = 0; i < percents.length; i++) {
+ if (percents[i] < 0 || percents[i] > 100) {
+ SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+ if (i > 0 && percents[i] < percents[i-1]) {
+ SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+ }
+ }
+
+ // Are these settings the same as before?
+ final Color background = getBackground();
+ if (backgroundImage == null) {
+ if ((gradientColors != null) && (colors != null) &&
+ (gradientColors.length == colors.length)) {
+ boolean same = false;
+ for (int i = 0; i < gradientColors.length; i++) {
+ same = (gradientColors[i] == colors[i]) ||
+ ((gradientColors[i] == null) && (colors[i] == background)) ||
+ ((gradientColors[i] == background) && (colors[i] == null));
+ if (!same) break;
+ }
+ if (same) {
+ for (int i = 0; i < gradientPercents.length; i++) {
+ same = gradientPercents[i] == percents[i];
+ if (!same) break;
+ }
+ }
+ if (same) return;
+ }
+ } else {
+ backgroundImage = null;
+ }
+ // Store the new settings
+ if (colors == null) {
+ gradientColors = null;
+ gradientPercents = null;
+ } else {
+ gradientColors = new Color[colors.length];
+ for (int i = 0; i < colors.length; ++i)
+ gradientColors[i] = (colors[i] != null) ? colors[i] : background;
+ gradientPercents = new int[percents.length];
+ for (int i = 0; i < percents.length; ++i)
+ gradientPercents[i] = percents[i];
+ }
+ // Refresh with the new settings
+ redraw();
+}
+/**
+ * Set the image to be drawn in the background of the label.
+ *
+ * @param image the image to be drawn in the background
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setBackground(Image image) {
+ checkWidget();
+ if (image == backgroundImage) return;
+ if (image != null) {
+ gradientColors = null;
+ gradientPercents = null;
+ }
+ backgroundImage = image;
+ redraw();
+
+}
+public void setFont(Font font) {
+ super.setFont(font);
+ redraw();
+}
+/**
+ * Set the label's Image.
+ * The value <code>null</code> clears it.
+ *
+ * @param image the image to be displayed in the label or null
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setImage(Image image) {
+ checkWidget();
+ if (image != this.image) {
+ this.image = image;
+ redraw();
+ }
+}
+/**
+ * Set the label's text.
+ * The value <code>null</code> clears it.
+ *
+ * @param text the text to be displayed in the label or null
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setText(String text) {
+ checkWidget();
+ if (text == null) text = ""; //$NON-NLS-1$
+ if (! text.equals(this.text)) {
+ this.text = text;
+ redraw();
+ }
+}
+/**
+ * Shorten the given text <code>t</code> so that its length doesn't exceed
+ * the given width. The default implementation replaces characters in the
+ * center of the original string with an ellipsis ("...").
+ * Override if you need a different strategy.
+ */
+protected String shortenText(GC gc, String t, int width) {
+ if (t == null) return null;
+ int w = gc.textExtent(ellipsis).x;
+ int l = t.length();
+ int pivot = l/2;
+ int s = pivot;
+ int e = pivot+1;
+ while (s >= 0 && e < l) {
+ String s1 = t.substring(0, s);
+ String s2 = t.substring(e, l);
+ int l1 = gc.textExtent(s1).x;
+ int l2 = gc.textExtent(s2).x;
+ if (l1+w+l2 < width) {
+ t = s1 + ellipsis + s2;
+ break;
+ }
+ s--;
+ e++;
+ }
+ return t;
+}
+}
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 7406e5a0f1..029413724f 100755
--- 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
@@ -1,2102 +1,2102 @@
-package org.eclipse.swt.custom;
-
-/*
+package org.eclipse.swt.custom;
+
+/*
* Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
* This file is made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- */
-
-import org.eclipse.swt.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.accessibility.*;
-
-/**
- * Instances of this class implement the notebook user interface
- * metaphor. It allows the user to select a notebook page from
- * set of pages.
- * <p>
- * The item children that may be added to instances of this class
- * must be of type <code>CTabItem</code>.
- * <code>Control</code> children are created and then set into a
- * tab item using <code>CTabItem#setControl</code>.
- * </p><p>
- * Note that although this class is a subclass of <code>Composite</code>,
- * it does not make sense to set a layout on it.
- * </p><p>
- * <dl>
- * <dt><b>Styles:</b></dt>
- * <dd>TOP, BOTTOM, FLAT</dd>
- * <dt><b>Events:</b></dt>
- * <dd>Selection</dd>
- * <dd>"CTabFolder"</dd>
- * </dl>
- * <p>
- * Note: Only one of the styles TOP and BOTTOM
- * may be specified.
- * </p><p>
- * IMPORTANT: This class is <em>not</em> intended to be subclassed.
- * </p>
- */
-
-public class CTabFolder extends Composite {
-
- /**
- * marginWidth specifies the number of pixels of horizontal margin
- * that will be placed along the left and right edges of the form.
- *
- * The default value is 0.
- */
- public int marginWidth = 0;
- /**
- * marginHeight specifies the number of pixels 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;
-
- /**
- * Color of innermost line of drop shadow border.
- */
- public static RGB borderInsideRGB = new RGB (132, 130, 132);
- /**
- * Color of middle line of drop shadow border.
- */
- public static RGB borderMiddleRGB = new RGB (143, 141, 138);
- /**
- * Color of outermost line of drop shadow border.
- */
- public static RGB borderOutsideRGB = new RGB (171, 168, 165);
-
- /*
- * 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.
- */
- public int MIN_TAB_WIDTH = 3;
-
- /* sizing, positioning */
- int xClient, yClient;
- boolean onBottom = false;
- boolean fixedTabHeight;
- int tabHeight;
-
- /* item management */
- private CTabItem items[] = new CTabItem[0];
- private int selectedIndex = -1;
- int topTabIndex = -1; // index of the left most visible tab.
-
- /* External Listener management */
- private CTabFolderListener[] tabListeners = new CTabFolderListener[0];
-
- /* Color appearance */
- Image backgroundImage;
- Color[] gradientColors;
- int[] gradientPercents;
- Color selectionForeground;
- Color background;
-
- // internal constants
- private static final int DEFAULT_WIDTH = 64;
- private static final int DEFAULT_HEIGHT = 64;
-
- // scrolling arrows
- private ToolBar arrowBar;
- private Image arrowLeftImage;
- private Image arrowRightImage;
-
- private Control topRight;
-
- // close button
- boolean showClose = false;
- private Image closeImage;
- ToolBar closeBar;
- private ToolBar inactiveCloseBar;
- private CTabItem inactiveItem;
-
- // borders
- boolean showBorders = false;
- private int borderBottom = 0;
- private int borderLeft = 0;
- private int borderRight = 0;
- private int borderTop = 0;
- private Color borderColor1;
- private Color borderColor2;
- private Color borderColor3;
-
- // when disposing CTabFolder, don't try to layout the items or
- // change the selection as each child is destroyed.
- private boolean inDispose = false;
-
- // keep track of size changes in order to redraw only affected area
- // on Resize
- private Point oldSize;
- private Font oldFont;
-
- // insertion marker
- int insertionIndex = -2; // Index of insert marker. Marker always shown after index.
- // -2 means no insert marker
-
- // tool tip
- private Shell tip;
- private Label label;
- private boolean showToolTip = false;
- private CTabItem toolTipItem;
-
-/**
- * Constructs a new instance of this class given its parent
- * and a style value describing its behavior and appearance.
- * <p>
- * The style value is either one of the style constants defined in
- * class <code>SWT</code> which is applicable to instances of this
- * class, or must be built by <em>bitwise OR</em>'ing together
- * (that is, using the <code>int</code> "|" operator) two or more
- * of those <code>SWT</code> style constants. The class description
- * lists the style constants that are applicable to the class.
- * Style bits are also inherited from superclasses.
- * </p>
- *
- * @param parent a widget which will be the parent of the new instance (cannot be null)
- * @param style the style of widget to construct
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
- * </ul>
- *
- * @see SWT#TOP
- * @see SWT#BOTTOM
- * @see SWT#FLAT
- * @see #getStyle
- */
-public CTabFolder(Composite parent, int style) {
- super(parent, checkStyle (style));
-
- onBottom = (getStyle() & SWT.BOTTOM) != 0;
-
- borderColor1 = new Color(getDisplay(), borderInsideRGB);
- borderColor2 = new Color(getDisplay(), borderMiddleRGB);
- borderColor3 = new Color(getDisplay(), borderOutsideRGB);
-
- // tool tip support
- tip = new Shell (getShell(), SWT.ON_TOP);
- label = new Label (tip, SWT.CENTER);
-
- // Add all listeners
- Listener listener = new Listener() {
- public void handleEvent(Event event) {
- switch (event.type) {
- case SWT.Dispose: onDispose(); break;
- case SWT.Paint: onPaint(event); break;
- case SWT.Resize: onResize(); break;
- case SWT.MouseDoubleClick: onMouseDoubleClick(event); break;
- case SWT.MouseDown: onMouseDown(event); break;
- case SWT.MouseExit: onMouseExit(event); break;
- case SWT.MouseHover: onMouseHover(event); break;
- case SWT.MouseMove: onMouseMove(event); break;
- case SWT.FocusIn: onFocus(event); break;
- case SWT.FocusOut: onFocus(event); break;
- case SWT.KeyDown: onKeyDown(event); break;
- case SWT.Traverse: onTraverse(event); break;
- }
- }
- };
-
- int[] folderEvents = new int[]{
- SWT.Dispose,
- SWT.Paint,
- SWT.Resize,
- SWT.MouseDoubleClick,
- SWT.MouseDown,
- SWT.MouseExit,
- SWT.MouseHover,
- SWT.MouseMove,
- SWT.FocusIn,
- SWT.FocusOut,
- SWT.KeyDown,
- SWT.Traverse,
- };
- for (int i = 0; i < folderEvents.length; i++) {
- addListener(folderEvents[i], listener);
- }
-
- createArrowBar();
- createCloseBar();
-
- setBorderVisible((style & SWT.BORDER) != 0);
-
- initAccessible();
-
-}
-private static int checkStyle (int style) {
- int mask = SWT.TOP | SWT.BOTTOM | SWT.FLAT;
- style = style & mask;
- // TOP and BOTTOM are mutually exlusive.
- // TOP is the default
- if ((style & SWT.TOP) != 0)
- style = style & ~(SWT.TOP | SWT.BOTTOM) | SWT.TOP;
- // reduce the flash by not redrawing the entire area on a Resize event
- style |= SWT.NO_REDRAW_RESIZE;
- return style;
-}
-/**
-* Adds the listener to receive events.
-* <p>
-*
-* @param listener the listener
-*
-* @exception SWTError <ul>
-* <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
-* <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
-* <li>ERROR_NULL_ARGUMENT when listener is null</li>
-* </ul>
-*/
-public void addSelectionListener(SelectionListener listener) {
- checkWidget();
- if (listener == null) {
- SWT.error(SWT.ERROR_NULL_ARGUMENT);
- }
- TypedListener typedListener = new TypedListener(listener);
- addListener(SWT.Selection, typedListener);
- addListener(SWT.DefaultSelection, typedListener);
-}
-/**
- * Adds the listener to the collection of listeners who will
- * be notified when a tab item is closed.
- *
- * @param listener the listener which should be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- *
- * @see CTabFolderListener
- * @see #removeCTabFolderListener
- */
-public void addCTabFolderListener(CTabFolderListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- // add to array
- CTabFolderListener[] newTabListeners = new CTabFolderListener[tabListeners.length + 1];
- System.arraycopy(tabListeners, 0, newTabListeners, 0, tabListeners.length);
- tabListeners = newTabListeners;
- tabListeners[tabListeners.length - 1] = listener;
- showClose = true;
- setButtonBounds();
-}
-private void closeNotify(CTabItem item, int time) {
- if (item == null) return;
-
- CTabFolderEvent event = new CTabFolderEvent(this);
- event.widget = this;
- event.time = time;
- event.item = item;
- event.doit = true;
- if (tabListeners != null) {
- for (int i = 0; i < tabListeners.length; i++) {
- tabListeners[i].itemClosed(event);
- }
- }
- if (event.doit) {
- item.dispose();
- }
-}
-public Point computeSize (int wHint, int hHint, boolean changed) {
- checkWidget();
- int minWidth = 0;
- int minHeight = 0;
-
- // preferred width of tab area to show all tabs
- GC gc = new GC(this);
- for (int i = 0; i < items.length; i++) {
- minWidth += items[i].preferredWidth(gc);
- }
- gc.dispose();
-
- // preferred size of controls in tab items
- for (int i = 0; i < items.length; i++) {
- Control control = items[i].getControl();
- if (control != null && !control.isDisposed()){
- Point size = control.computeSize (wHint, hHint);
- minWidth = Math.max (minWidth, size.x);
- minHeight = Math.max (minHeight, size.y);
- }
- }
- if (minWidth == 0) minWidth = DEFAULT_WIDTH;
- if (minHeight == 0) minHeight = DEFAULT_HEIGHT;
-
- if (wHint != SWT.DEFAULT) minWidth = wHint;
- if (hHint != SWT.DEFAULT) minHeight = hHint;
-
- Rectangle trim = computeTrim(0, 0, minWidth, minHeight);
- return new Point (trim.width, trim.height);
-}
-public Rectangle computeTrim (int x, int y, int width, int height) {
- checkWidget();
- if (items.length == 0) {
- if (!showBorders) return new Rectangle(x, y, width, height);
- int trimX = x - borderRight - 1;
- int trimY = y - borderBottom - 1;
- int trimWidth = width + borderRight + 2;
- int trimHeight = height + borderBottom + 2;
- return new Rectangle (trimX, trimY, trimWidth, trimHeight);
- } else {
- int trimX = x - marginWidth - borderLeft;
- int trimY = y - marginHeight - tabHeight - borderTop - 1;
- // -1 is for the line at the bottom of the tabs
- if (onBottom) {
- trimY = y - marginHeight - borderTop;
- }
- int trimWidth = width + borderLeft + borderRight + 2*marginWidth;
- int trimHeight = height + borderTop + borderBottom + 2*marginHeight + tabHeight + 1;
- return new Rectangle (trimX, trimY, trimWidth, trimHeight);
- }
-}
-/**
- * Create the specified item at 'index'.
- */
-void createItem (CTabItem item, int index) {
- if (0 > index || index > getItemCount ()){
- SWT.error (SWT.ERROR_INVALID_RANGE);
- }
- // grow by one and rearrange the array.
- CTabItem[] newItems = new CTabItem [items.length + 1];
- System.arraycopy(items, 0, newItems, 0, index);
- newItems[index] = item;
- System.arraycopy(items, index, newItems, index + 1, items.length - index);
- items = newItems;
-
- item.parent = this;
-
- if (selectedIndex >= index) {
- selectedIndex ++;
- }
- if (items.length == 1) {
- topTabIndex = 0;
- resetTabSize(true);
- } else {
- setItemBounds();
- showItem(item);
- }
-
- if (items.length == 1) {
- redraw();
- } else {
- redrawTabArea(-1);
- }
-}
-
-private void createArrowBar() {
- // create arrow buttons for scrolling
- arrowBar = new ToolBar(this, SWT.FLAT);
- arrowBar.setVisible(false);
- arrowBar.setBackground(background);
- ToolItem scrollLeft = new ToolItem(arrowBar, SWT.PUSH);
- scrollLeft.setEnabled(false);
- ToolItem scrollRight = new ToolItem(arrowBar, SWT.PUSH);
- scrollRight.setEnabled(false);
-
- scrollLeft.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event event) {
- scroll_scrollLeft();
- }
- });
- scrollRight.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event event) {
- scroll_scrollRight();
- }
- });
-
-}
-private void createCloseBar() {
- closeBar = new ToolBar(this, SWT.FLAT);
- closeBar.setVisible(false);
- if (gradientColors != null && gradientColors.length > 0) {
- closeBar.setBackground(gradientColors[gradientColors.length - 1]);
- } else {
- closeBar.setBackground(background);
- }
- ToolItem closeItem = new ToolItem(closeBar, SWT.PUSH);
-
- inactiveCloseBar = new ToolBar(this, SWT.FLAT);
- inactiveCloseBar.setVisible(false);
- inactiveCloseBar.setBackground(background);
- ToolItem inactiveCloseItem = new ToolItem(inactiveCloseBar, SWT.PUSH);
-
- closeItem.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event event) {
- closeNotify(getSelection(), event.time);
- }
- });
- inactiveCloseItem.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event event) {
- closeNotify(inactiveItem, event.time);
- inactiveCloseBar.setVisible(false);
- inactiveItem = null;
- }
- });
- inactiveCloseBar.addListener (SWT.MouseExit, new Listener() {
- public void handleEvent(Event event) {
- if (inactiveItem != null) {
- Rectangle itemBounds = inactiveItem.getBounds();
- if (itemBounds.contains(event.x, event.y)) return;
- }
- inactiveCloseBar.setVisible(false);
- inactiveItem = null;
- }
- });
-
-}
-/**
- * Destroy the specified item.
- */
-void destroyItem (CTabItem item) {
- if (inDispose) return;
-
- int index = indexOf(item);
- if (index == -1) return; // should this trigger an error?
-
- insertionIndex = -2;
-
- if (items.length == 1) {
- items = new CTabItem[0];
- selectedIndex = -1;
- topTabIndex = 0;
-
- Control control = item.getControl();
- if (control != null && !control.isDisposed()) {
- control.setVisible(false);
- }
- closeBar.setVisible(false);
- if (!fixedTabHeight) tabHeight = 0;
- redraw();
- return;
- }
-
- // shrink by one and rearrange the array.
- CTabItem[] newItems = new CTabItem [items.length - 1];
- System.arraycopy(items, 0, newItems, 0, index);
- System.arraycopy(items, index + 1, newItems, index, items.length - index - 1);
- items = newItems;
-
- if (topTabIndex == items.length) {
- --topTabIndex;
- }
-
- // move the selection if this item is selected
- if (selectedIndex == index) {
- Control control = item.getControl();
- if (control != null && !control.isDisposed()) {
- control.setVisible(false);
- }
- selectedIndex = -1;
- setSelection(Math.max(0, index - 1), true);
- } else if (selectedIndex > index) {
- selectedIndex --;
- }
-
- setItemBounds();
- redrawTabArea(-1);
-}
-private void onKeyDown(Event e) {
- if (e.keyCode == SWT.ARROW_LEFT) {
- if (selectedIndex > 0) {
- setSelection(selectedIndex - 1, true);
- }
- }
- if (e.keyCode == SWT.ARROW_RIGHT) {
- if (selectedIndex < items.length - 1) {
- setSelection(selectedIndex + 1, true);
- }
- }
-}
-/**
- * Dispose the items of the receiver
- */
-private void onDispose() {
- /*
- * Usually when an item is disposed, destroyItem will change the size of the items array,
- * reset the bounds of all the tabs and manage the widget associated with the tab.
- * Since the whole folder is being disposed, this is not necessary. For speed
- * the inDispose flag is used to skip over this part of the item dispose.
- */
- inDispose = true;
-
- int length = items.length;
- for (int i = 0; i < length; i++) {
- if (items[i] != null) {
- items[i].dispose();
- }
- }
-
- // clean up resources
- if (tip != null && !tip.isDisposed()) {
- tip.dispose();
- tip = null;
- label = null;
- }
-
- if (arrowLeftImage != null) arrowLeftImage.dispose();
- arrowLeftImage = null;
- if (arrowRightImage != null) arrowRightImage.dispose();
- arrowRightImage = null;
- if (closeImage != null) closeImage.dispose();
- closeImage = null;
-
- gradientColors = null;
- gradientPercents = null;
- backgroundImage = null;
-
- if (borderColor1 != null) borderColor1.dispose();
- borderColor1 = null;
-
- if (borderColor2 != null) borderColor2.dispose();
- borderColor2 = null;
-
- if (borderColor3 != null) borderColor3.dispose();
- borderColor3 = null;
-}
-private void onFocus(Event e) {
- checkWidget();
- if (selectedIndex >= 0) {
- redrawTabArea(selectedIndex);
- } else {
- setSelection(0, true);
- }
-}
-/**
- * Draw a border around the receiver.
- */
-private void drawBorder(GC gc) {
-
- Rectangle d = super.getClientArea();
-
- if (showBorders) {
- if ((getStyle() & SWT.FLAT) != 0) {
- gc.setForeground(borderColor1);
- gc.drawRectangle(d.x, d.y, d.x + d.width - 1, d.y + d.height - 1);
- } else {
- gc.setForeground(borderColor1);
- gc.drawRectangle(d.x, d.y, d.x + d.width - 3, d.y + d.height - 3);
-
- gc.setForeground(borderColor2);
- gc.drawLine(d.x + 1, d.y + d.height - 2, d.x + d.width - 1, d.y + d.height - 2);
- gc.drawLine(d.x + d.width - 2, d.y + 1, d.x + d.width - 2, d.y + d.height - 1);
-
- gc.setForeground(borderColor3);
- gc.drawLine(d.x + 2, d.y + d.height - 1, d.x + d.width - 2, d.y + d.height - 1);
- gc.drawLine(d.x + d.width - 1, d.y + 2, d.x + d.width - 1, d.y + d.height - 2);
-
- // fill in corners with parent's background
- gc.setForeground(getParent().getBackground());
- gc.drawLine(d.x + d.width - 2, d.y, d.x + d.width - 1, d.y);
- gc.drawLine(d.x + d.width - 1, d.y + 1, d.x + d.width - 1, d.y + 1);
-
- gc.drawLine(d.x, d.y + d.height - 2, d.x, d.y + d.height - 2);
- gc.drawLine(d.x, d.y + d.height - 1, d.x + 1, d.y + d.height - 1);
-
- gc.drawLine(d.x + d.width - 1, d.y + d.height - 1, d.x + d.width - 1, d.y + d.height - 1);
- }
-
- }
-
- // draw a separator line
- if (items.length > 0) {
- int lineY = d.y + borderTop + tabHeight;
- if (onBottom) {
- lineY = d.y + d.height - borderBottom - tabHeight - 1;
- }
- gc.setForeground(borderColor1);
- gc.drawLine(d.x + borderLeft, lineY, d.x + d.width - borderRight, lineY);
- }
-
- gc.setForeground(getForeground());
-}
-public Rectangle getClientArea() {
- checkWidget();
- Point size = getSize();
- if (items.length == 0) {
- if (!showBorders) return super.getClientArea();
- int width = size.x - borderRight - 2;
- int height = size.y - borderBottom - 2;
- return new Rectangle(borderRight + 1, borderBottom + 1, width, height);
- } else {
- int width = size.x - 2*marginWidth - borderLeft - borderRight;
- int height = size.y - 2*marginHeight - borderTop - borderBottom - tabHeight - 1;
- return new Rectangle(xClient, yClient, width, height);
- }
-}
-/**
- * Returns the height of the tab
- *
- * @return the height of the tab
- *
- * @exception SWTError <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * </ul>
- */
-public int getTabHeight(){
- checkWidget();
- return tabHeight;
-}
-
-/**
- * Return the tab that is located at the specified index.
- *
- * @return the item at the specified index
- */
-public CTabItem getItem (int index) {
- //checkWidget();
- if (index < 0 || index >= items.length)
- SWT.error(SWT.ERROR_INVALID_RANGE);
- return items [index];
-}
-/**
-* Gets the item at a point in the widget.
-* <p>
-*
-* @return the item at a point
-*/
-public CTabItem getItem (Point pt) {
- //checkWidget();
- if (items.length == 0) return null;
- int lastItem = getLastItem();
- lastItem = Math.min(items.length - 1, lastItem + 1);
- for (int i = topTabIndex; i <= lastItem; i++) {
- Rectangle bounds = items[i].getBounds();
- if (bounds.contains(pt)) return items[i];
- }
- return null;
-}
-/**
- * Return the number of tabs in the folder.
- *
- * @return the number of tabs in the folder
- */
-public int getItemCount(){
- //checkWidget();
- return items.length;
-}
-/**
- * Return the tab items.
- *
- * @return the tab items
- */
-public CTabItem [] getItems() {
- //checkWidget();
- CTabItem[] tabItems = new CTabItem [items.length];
- System.arraycopy(items, 0, tabItems, 0, items.length);
- return tabItems;
-}
-
-private int getLastItem(){
- if (items.length == 0) return -1;
- Rectangle area = getClientArea();
- if (area.width <= 0) return 0;
- Rectangle toolspace = getToolSpace();
- if (toolspace.width == 0) return items.length -1;
- int width = area.width - toolspace.width;
- int index = topTabIndex;
- int tabWidth = items[index].width;
- while (index < items.length - 1) {
- tabWidth += items[index + 1].width;
- if (tabWidth > width) break;
- index++;
- }
- return index;
-}
-/**
- * Return the selected tab item, or an empty array if there
- * is no selection.
- *
- * @return the selected tab item
- */
-public CTabItem getSelection() {
- //checkWidget();
- if (selectedIndex == -1) return null;
- return items[selectedIndex];
-}
-/**
- * Return the index of the selected tab item, or -1 if there
- * is no selection.
- *
- * @return the index of the selected tab item or -1
- */
-public int getSelectionIndex() {
- //checkWidget();
- return selectedIndex;
-}
-private Rectangle getToolSpace() {
- boolean showArrows = scroll_leftVisible() || scroll_rightVisible();
- if (!showArrows && topRight == null) return new Rectangle(0, 0, 0, 0);
- Rectangle toolspace;
- if (showArrows) {
- toolspace = arrowBar.getBounds();
- toolspace.width += borderRight;
- if (topRight != null) toolspace.width += topRight.getSize().x;
- } else {
- toolspace = topRight.getBounds();
- toolspace.width += borderRight;
- }
- return toolspace;
-}
-/**
- * Returns the control in the top right corner of the tab folder.
- * Typically this is a close button or a composite with a menu and close button.
- *
- * @since 2.1
- *
- * @return the control in the top right corner of the tab folder or null
- *
- * @exception SWTError <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * </ul>
- */
-public Control getTopRight() {
- checkWidget();
- return topRight;
-}
-
-/**
- * Return the index of the specified tab or -1 if the tab is not
- * in the receiver.
- *
- * @return the index of the specified tab item or -1
- *
- * @exception SWTError <ul>
- * <li>ERROR_NULL_ARGUMENT when the item is null</li>
- * </ul>
- */
-public int indexOf(CTabItem item) {
- //checkWidget();
- if (item == null) {
- SWT.error(SWT.ERROR_NULL_ARGUMENT);
- }
- for (int i = 0; i < items.length; i++) {
- if (items[i] == item) return i;
- }
- return -1;
-}
-
-private void initAccessible() {
- final Accessible accessible = getAccessible();
- accessible.addAccessibleListener(new AccessibleAdapter() {
- public void getName(AccessibleEvent e) {
- String name = null;
- int childID = e.childID;
- if (childID >= 0 && childID < items.length) {
- name = items[childID].getText();
- int index = name.indexOf('&');
- if (index > 0) {
- name = name.substring(0, index) + name.substring(index + 1);
- }
- }
- e.result = name;
- }
-
- public void getHelp(AccessibleEvent e) {
- String help = null;
- int childID = e.childID;
- if (childID == ACC.CHILDID_SELF) {
- help = getToolTipText();
- } else if (childID >= 0 && childID < items.length) {
- help = items[childID].getToolTipText();
- }
- e.result = help;
- }
-
- public void getKeyboardShortcut(AccessibleEvent e) {
- String shortcut = null;
- int childID = e.childID;
- if (childID >= 0 && childID < items.length) {
- String text = items[childID].getText();
- if (text != null) {
- char mnemonic = getMnemonic(text);
- if (mnemonic != '\0') {
- shortcut = "Alt+"+mnemonic; //$NON-NLS-1$
- }
- }
- }
- e.result = shortcut;
- }
- });
-
- accessible.addAccessibleControlListener(new AccessibleControlAdapter() {
- public void getChildAtPoint(AccessibleControlEvent e) {
- Point testPoint = toControl(new Point(e.x, e.y));
- int childID = ACC.CHILDID_NONE;
- for (int i = 0; i < items.length; i++) {
- if (items[i].getBounds().contains(testPoint)) {
- childID = i;
- break;
- }
- }
- if (childID == ACC.CHILDID_NONE) {
- Rectangle location = getBounds();
- location.height = location.height - getClientArea().height;
- if (location.contains(testPoint)) {
- childID = ACC.CHILDID_SELF;
- }
- }
- e.childID = childID;
- }
-
-
- public void getLocation(AccessibleControlEvent e) {
- Rectangle location = null;
- int childID = e.childID;
- if (childID == ACC.CHILDID_SELF) {
- location = getBounds();
- }
- if (childID >= 0 && childID < items.length) {
- location = items[childID].getBounds();
- }
- if (location != null) {
- Point pt = toDisplay(new Point(location.x, location.y));
- e.x = pt.x;
- e.y = pt.y;
- e.width = location.width;
- e.height = location.height;
- }
- }
-
- public void getChildCount(AccessibleControlEvent e) {
- e.detail = items.length;
- }
-
- public void getDefaultAction(AccessibleControlEvent e) {
- String action = null;
- int childID = e.childID;
- if (childID >= 0 && childID < items.length) {
- action = "Switch"; //$NON-NLS-1$
- }
- e.result = action;
- }
-
- public void getFocus(AccessibleControlEvent e) {
- int childID = ACC.CHILDID_NONE;
- if (isFocusControl()) {
- if (selectedIndex == -1) {
- childID = ACC.CHILDID_SELF;
- } else {
- childID = selectedIndex;
- }
- }
- e.childID = childID;
- }
-
- public void getRole(AccessibleControlEvent e) {
- int role = 0;
- int childID = e.childID;
- if (childID == ACC.CHILDID_SELF) {
- role = ACC.ROLE_TABFOLDER;
- } else if (childID >= 0 && childID < items.length) {
- role = ACC.ROLE_TABITEM;
- }
- e.detail = role;
- }
-
- public void getSelection(AccessibleControlEvent e) {
- e.childID = (selectedIndex == -1) ? ACC.CHILDID_NONE : selectedIndex;
- }
-
- public void getState(AccessibleControlEvent e) {
- int state = 0;
- int childID = e.childID;
- if (childID == ACC.CHILDID_SELF) {
- state = ACC.STATE_NORMAL;
- } else if (childID >= 0 && childID < items.length) {
- state = ACC.STATE_SELECTABLE;
- if (isFocusControl()) {
- state |= ACC.STATE_FOCUSABLE;
- }
- if (selectedIndex == childID) {
- state |= ACC.STATE_SELECTED;
- if (isFocusControl()) {
- state |= ACC.STATE_FOCUSED;
- }
- }
- }
- e.detail = state;
- }
-
- public void getChildren(AccessibleControlEvent e) {
- Object[] children = new Object[items.length];
- for (int i = 0; i < items.length; i++) {
- children[i] = new Integer(i);
- }
- e.children = children;
- }
- });
-
- addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event event) {
- if (isFocusControl()) {
- if (selectedIndex == -1) {
- accessible.setFocus(ACC.CHILDID_SELF);
- } else {
- accessible.setFocus(selectedIndex);
- }
- }
- }
- });
-
- addListener(SWT.FocusIn, new Listener() {
- public void handleEvent(Event event) {
- if (selectedIndex == -1) {
- accessible.setFocus(ACC.CHILDID_SELF);
- } else {
- accessible.setFocus(selectedIndex);
- }
- }
- });
-}
-
-private void setButtonBounds() {
-
- updateArrowBar();
- updateCloseBar();
-
- Rectangle area = super.getClientArea();
-
- int offset = 0;
- if (topRight != null) {
- Point size = topRight.computeSize(SWT.DEFAULT, tabHeight);
- int x = area.x + area.width - borderRight - size.x;
- int y = onBottom ? area.y + area.height - borderBottom - size.y : area.y + borderTop;
- topRight.setBounds(x, y, size.x, size.y);
- offset = size.x;
- }
- boolean leftVisible = scroll_leftVisible();
- boolean rightVisible = scroll_rightVisible();
- if (leftVisible || rightVisible) {
- Point size = arrowBar.computeSize(SWT.DEFAULT, tabHeight);
- int x = area.x + area.width - borderRight - size.x - offset;
- int y = (onBottom) ? area.y + area.height - borderBottom - size.y : area.y + borderTop;
-
- arrowBar.setBounds(x, y, size.x, size.y);
- ToolItem[] items = arrowBar.getItems();
- items[0].setEnabled(leftVisible);
- items[1].setEnabled(rightVisible);
- arrowBar.setVisible(true);
- } else {
- arrowBar.setVisible(false);
- }
-
- // When the close button is right at the edge of the Tab folder, hide it because
- // otherwise it may block off a part of the border on the right
- if (showClose) {
- inactiveCloseBar.setVisible(false);
- CTabItem item = getSelection();
- if (item == null) {
- closeBar.setVisible(false);
- } else {
- int toolbarHeight = tabHeight - CTabItem.TOP_MARGIN - CTabItem.BOTTOM_MARGIN + 2; // +2 to ignore gap between focus rectangle
- Point size = closeBar.computeSize(SWT.DEFAULT, toolbarHeight);
- int x = item.x + item.width - size.x - 2; // -2 to not overlap focus rectangle and trim
- int y = item.y + Math.max(0, (item.height - toolbarHeight)/2);
- closeBar.setBounds(x, y, size.x, toolbarHeight);
- Rectangle toolspace = getToolSpace();
- Point folderSize = getSize();
- boolean visible = (toolspace.width == 0 || x < toolspace.x) && x + size.x < folderSize.x - borderRight;
- closeBar.setVisible(visible);
- }
- }
-}
-private boolean setItemLocation() {
- if (items.length == 0) return false;
- Rectangle area = super.getClientArea();
- int x = area.x;
- int y = area.y + borderTop;
- if (onBottom) y = Math.max(0, area.y + area.height - borderBottom - tabHeight);
-
- boolean changed = false;
- for (int i = topTabIndex - 1; i>=0; i--) {
- // if the first visible tab is not the first tab
- CTabItem tab = items[i];
- x -= tab.width;
- if (!changed && (tab.x != x || tab.y != y) ) changed = true;
- // layout tab items from right to left thus making them invisible
- tab.x = x;
- tab.y = y;
- }
-
- x = area.x + borderLeft;
- for (int i = topTabIndex; i < items.length; i++) {
- // continue laying out remaining, visible items left to right
- CTabItem tab = items[i];
- tab.x = x;
- tab.y = y;
- x = x + tab.width;
- }
- setButtonBounds();
- return changed;
-}
-private void setLastItem(int index) {
- if (index < 0 || index > items.length - 1) return;
- Rectangle area = getClientArea();
- if (area.width <= 0) return;
- int maxWidth = area.width;
- Rectangle toolspace = getToolSpace();
- if (toolspace.width > 0){
- maxWidth -= toolspace.width;
- }
- int tabWidth = items[index].width;
- while (index > 0) {
- tabWidth += items[index - 1].width;
- if (tabWidth > maxWidth) break;
- index--;
- }
- topTabIndex = index;
- setItemLocation();
- redrawTabArea(-1);
-}
-/**
- * Layout the items and store the client area size.
- */
-boolean setItemBounds() {
- boolean changed = false;
- if (isDisposed()) return changed;
- Rectangle area = super.getClientArea();
-
- xClient = area.x + borderLeft + marginWidth;
- if (onBottom) {
- yClient = area.y + borderTop + marginHeight;
- } else {
- yClient = area.y + borderTop + tabHeight + 1 + marginHeight;
- // +1 is for the line at the bottom of the tabs
- }
-
- if (area.width <= 0 || area.height <= 0 || items.length == 0) return changed;
-
- int[] widths = new int[items.length];
- GC gc = new GC(this);
- for (int i = 0; i < items.length; i++) {
- widths[i] = items[i].preferredWidth(gc);
- }
- gc.dispose();
-
- int oldAverageWidth = 0;
- int averageWidth = (area.width - borderLeft - borderRight) / items.length;
- while (averageWidth > oldAverageWidth) {
- int width = area.width - borderLeft - borderRight;
- int count = items.length;
- for (int i = 0; i < items.length; i++) {
- if (widths[i] < averageWidth) {
- width -= widths[i];
- count--;
- }
- }
- oldAverageWidth = averageWidth;
- if (count > 0) {
- averageWidth = width / count;
- }
- }
- averageWidth = Math.max(averageWidth, MIN_TAB_WIDTH * tabHeight);
- for (int i = 0; i < items.length; i++) {
- if (widths[i] > averageWidth) {
- widths[i] = averageWidth;
- }
- }
-
- int totalWidth = 0;
- for (int i = 0; i < items.length; i++) {
- CTabItem tab = items[i];
- if (tab.height != tabHeight || tab.width != widths[i]) changed = true;
- tab.height = tabHeight;
- tab.width = widths[i];
- totalWidth += widths[i];
- }
-
- int areaWidth = area.x + area.width - borderRight;
- if (totalWidth <= areaWidth) {
- topTabIndex = 0;
- }
- if (setItemLocation()) changed = true;
-
- // Is there a gap after last item showing
- if (correctLastItem()) changed = true;
- return changed;
-}
-private boolean onMnemonic (Event event) {
- char key = event.character;
- for (int i = 0; i < items.length; i++) {
- if (items[i] != null) {
- char mnemonic = getMnemonic (items[i].getText ());
- if (mnemonic != '\0') {
- if (Character.toUpperCase (key) == Character.toUpperCase (mnemonic)) {
- setSelection(i, true);
- return true;
- }
- }
- }
- }
- return false;
-}
-/**
- * Paint the receiver.
- */
-private void onPaint(Event event) {
- Font font = getFont();
- if (oldFont == null || !oldFont.equals(font)) {
- oldFont = font;
- resetTabSize(true);
- }
- GC gc = event.gc;
- Rectangle rect = super.getClientArea();
- if (items.length == 0) {
- if (showBorders) {
- if ((getStyle() & SWT.FLAT) != 0) {
- gc.setForeground(borderColor1);
- gc.drawRectangle(rect.x, rect.y, rect.x + rect.width - 1, rect.y + rect.height - 1);
- } else {
- gc.setForeground(borderColor1);
- gc.drawRectangle(rect.x, rect.y, rect.x + rect.width - 3, rect.y + rect.height - 3);
-
- // fill in right and bottom edges with parent's background
- gc.setBackground(getParent().getBackground());
- gc.fillRectangle(rect.x + rect.width - 2, rect.y, 2, rect.height);
- gc.fillRectangle(rect.x, rect.y + rect.height - 2, rect.width, 2);
- }
- gc.setForeground(getForeground());
- }
- return;
- }
-
- // redraw the Border
- drawBorder(gc);
-
- rect.x += borderLeft;
- rect.y += borderTop;
- rect.width -= borderLeft + borderRight;
- rect.height -= borderTop + borderBottom;
- Rectangle clip = gc.getClipping ();
- gc.setClipping(clip.intersection(rect));
-
- // Draw the unselected tabs first.
- for (int i=0; i < items.length; i++) {
- if (i != selectedIndex && event.getBounds().intersects(items[i].getBounds())) {
- items[i].onPaint(gc, false);
- }
- }
- // Selected tab comes last
- if (selectedIndex != -1) {
- items[selectedIndex].onPaint(gc, true);
- }
-
- // draw insertion mark
- if (insertionIndex > -2) {
- gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION));
- if (insertionIndex == -1) {
- Rectangle bounds = items[0].getBounds();
- gc.drawLine(bounds.x, bounds.y, bounds.x, bounds.y + bounds.height - 1);
- gc.drawLine(bounds.x - 2, bounds.y, bounds.x + 2, bounds.y);
- gc.drawLine(bounds.x - 1, bounds.y + 1, bounds.x + 1, bounds.y + 1);
- gc.drawLine(bounds.x - 1, bounds.y + bounds.height - 2, bounds.x + 1, bounds.y + bounds.height - 2);
- gc.drawLine(bounds.x - 2, bounds.y + bounds.height - 1, bounds.x + 2, bounds.y + bounds.height - 1);
-
- } else {
- Rectangle bounds = items[insertionIndex].getBounds();
- gc.drawLine(bounds.x + bounds.width, bounds.y, bounds.x + bounds.width, bounds.y + bounds.height - 1);
- gc.drawLine(bounds.x + bounds.width - 2, bounds.y, bounds.x + bounds.width + 2, bounds.y);
- gc.drawLine(bounds.x + bounds.width - 1, bounds.y + 1, bounds.x + bounds.width + 1, bounds.y + 1);
- gc.drawLine(bounds.x + bounds.width - 1, bounds.y + bounds.height - 2, bounds.x + bounds.width + 1, bounds.y + bounds.height - 2);
- gc.drawLine(bounds.x + bounds.width - 2, bounds.y + bounds.height - 1, bounds.x + bounds.width + 2, bounds.y + bounds.height - 1);
- }
- }
-
- gc.setForeground(getForeground());
- gc.setBackground(getBackground());
-}
-private void redrawTabArea(int index) {
- int x = 0, y = 0, width = 0, height = 0;
- if (index == -1) {
- Rectangle area = super.getClientArea();
- if (area.width == 0 || area.height == 0) return;
- width = area.x + area.width - borderLeft - borderRight;
- height = tabHeight + 1; // +1 causes top line between content and tabs to be redrawn
- x = area.x + borderLeft;
- y = area.y + borderTop;
- if (onBottom) {
- y = Math.max(0, area.y + area.height - borderBottom - height);
- }
- } else {
- CTabItem item = items[index];
- x = item.x;
- y = item.y;
- Rectangle area = super.getClientArea();
- width = area.x + area.width - x;
- height = item.height;
- }
- redraw(x, y, width, height, false);
-}
-
-/**
- * Removes the listener.
- *
- * @param listener the listener
- *
- * @exception SWTError
- * <ul><li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * <li>ERROR_NULL_ARGUMENT when listener is null</li></ul>
- */
-public void removeSelectionListener(SelectionListener listener) {
- checkWidget();
- if (listener == null) {
- SWT.error(SWT.ERROR_NULL_ARGUMENT);
- }
- removeListener(SWT.Selection, listener);
- removeListener(SWT.DefaultSelection, listener);
-}
-/**
- * Removes the listener.
- *
- * @param listener the listener
- *
- * @exception SWTError
- * <ul><li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * <li>ERROR_NULL_ARGUMENT when listener is null</li></ul>
- */
-public void removeCTabFolderListener(CTabFolderListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- if (tabListeners.length == 0) return;
- int index = -1;
- for (int i = 0; i < tabListeners.length; i++) {
- if (listener == tabListeners[i]){
- index = i;
- break;
- }
- }
- if (index == -1) return;
- if (tabListeners.length == 1) {
- tabListeners = new CTabFolderListener[0];
- showClose = false;
- setButtonBounds();
- return;
- }
- CTabFolderListener[] newTabListeners = new CTabFolderListener[tabListeners.length - 1];
- System.arraycopy(tabListeners, 0, newTabListeners, 0, index);
- System.arraycopy(tabListeners, index + 1, newTabListeners, index, tabListeners.length - index - 1);
- tabListeners = newTabListeners;
-}
-
-/**
- * The widget was resized. Adjust the size of the currently selected page.
- */
-private void onResize() {
-
- if (items.length == 0) {
- redraw();
- return;
- }
-
- if (setItemBounds()) {
- redrawTabArea(-1);
- }
-
- Point size = getSize();
- if (oldSize == null) {
- redraw();
- } else {
- if (onBottom && size.y != oldSize.y) {
- redraw();
- } else {
- int x1 = Math.min(size.x, oldSize.x);
- if (size.x != oldSize.x) x1 -= 10;
- int y1 = Math.min(size.y, oldSize.y);
- if (size.y != oldSize.y) y1 -= 10;
- int x2 = Math.max(size.x, oldSize.x);
- int y2 = Math.max(size.y, oldSize.y);
- redraw(0, y1, x2 + 10, y2 - y1, false);
- redraw(x1, 0, x2 - x1, y2, false);