From 17c83319eacee5a797aa2bb9139a59d29263c43f Mon Sep 17 00:00:00 2001 From: cvs2svn Date: Tue, 16 Dec 2003 20:53:37 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'v3034c'. Sprout from master 2003-12-15 22:20:16 UTC Veronika Irvine 'bug 48470' Cherrypick from master 2003-12-16 20:53:36 UTC Veronika Irvine '*** empty log message ***': bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CBanner.java bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder2.java Delete: bundles/org.eclipse.swt.opengl/.classpath_gtk bundles/org.eclipse.swt.opengl/.classpath_motif bundles/org.eclipse.swt.opengl/.classpath_win32 bundles/org.eclipse.swt.opengl/.cvsignore bundles/org.eclipse.swt.opengl/.project bundles/org.eclipse.swt.opengl/about.html bundles/org.eclipse.swt.opengl/common/gl_library/gl.c bundles/org.eclipse.swt.opengl/common/gl_library/glu.c bundles/org.eclipse.swt.opengl/common/gl_library/swt.h bundles/org.eclipse.swt.opengl/common/org/eclipse/swt/opengl/GL.java bundles/org.eclipse.swt.opengl/common/org/eclipse/swt/opengl/GLU.java bundles/org.eclipse.swt.opengl/common/org/eclipse/swt/opengl/GLYPHMETRICSFLOAT.java bundles/org.eclipse.swt.opengl/common/org/eclipse/swt/opengl/ImageDataUtil.java bundles/org.eclipse.swt.opengl/common/org/eclipse/swt/opengl/Library.java bundles/org.eclipse.swt.opengl/gtk/gl_library/build.sh bundles/org.eclipse.swt.opengl/gtk/gl_library/glx.c bundles/org.eclipse.swt.opengl/gtk/gl_library/make_gtk.mak bundles/org.eclipse.swt.opengl/gtk/gl_library/structs.c bundles/org.eclipse.swt.opengl/gtk/gl_library/structs.h bundles/org.eclipse.swt.opengl/gtk/gl_library/xgtk.c bundles/org.eclipse.swt.opengl/gtk/org/eclipse/swt/opengl/GLContext.java bundles/org.eclipse.swt.opengl/gtk/org/eclipse/swt/opengl/internal/gtk/XGL.java bundles/org.eclipse.swt.opengl/gtk/org/eclipse/swt/opengl/internal/gtk/XGTK.java bundles/org.eclipse.swt.opengl/gtk/org/eclipse/swt/opengl/internal/gtk/XVisualInfo.java bundles/org.eclipse.swt.opengl/motif/gl_library/build.csh bundles/org.eclipse.swt.opengl/motif/gl_library/glx.c bundles/org.eclipse.swt.opengl/motif/gl_library/make_aix.mak bundles/org.eclipse.swt.opengl/motif/gl_library/make_hpux.mak bundles/org.eclipse.swt.opengl/motif/gl_library/make_linux.mak bundles/org.eclipse.swt.opengl/motif/gl_library/make_solaris.mak bundles/org.eclipse.swt.opengl/motif/gl_library/structs.c bundles/org.eclipse.swt.opengl/motif/gl_library/structs.h bundles/org.eclipse.swt.opengl/motif/org/eclipse/swt/opengl/GLContext.java bundles/org.eclipse.swt.opengl/motif/org/eclipse/swt/opengl/internal/motif/XGL.java bundles/org.eclipse.swt.opengl/motif/org/eclipse/swt/opengl/internal/motif/XVisualInfo.java bundles/org.eclipse.swt.opengl/plugin.properties bundles/org.eclipse.swt.opengl/plugin.xml bundles/org.eclipse.swt.opengl/win32/gl_library/build.bat bundles/org.eclipse.swt.opengl/win32/gl_library/glw.c bundles/org.eclipse.swt.opengl/win32/gl_library/make_win32.mak bundles/org.eclipse.swt.opengl/win32/gl_library/structs.c bundles/org.eclipse.swt.opengl/win32/gl_library/structs.h bundles/org.eclipse.swt.opengl/win32/gl_library/swt.rc bundles/org.eclipse.swt.opengl/win32/org/eclipse/swt/opengl/GLContext.java bundles/org.eclipse.swt.opengl/win32/org/eclipse/swt/opengl/internal/win32/LAYERPLANEDESCRIPTOR.java bundles/org.eclipse.swt.opengl/win32/org/eclipse/swt/opengl/internal/win32/PIXELFORMATDESCRIPTOR.java bundles/org.eclipse.swt.opengl/win32/org/eclipse/swt/opengl/internal/win32/POINTFLOAT.java bundles/org.eclipse.swt.opengl/win32/org/eclipse/swt/opengl/internal/win32/WGL.java examples/org.eclipse.swt.examples.browser/.classpath examples/org.eclipse.swt.examples.browser/.project examples/org.eclipse.swt.examples.browser/about.html examples/org.eclipse.swt.examples.browser/build.properties examples/org.eclipse.swt.examples.browser/doc-html/hglegal.htm examples/org.eclipse.swt.examples.browser/doc-html/ngibmcpy.gif examples/org.eclipse.swt.examples.browser/doc-html/swt_browser_ex.html examples/org.eclipse.swt.examples.browser/icons/browser_example.gif examples/org.eclipse.swt.examples.browser/plugin.properties examples/org.eclipse.swt.examples.browser/plugin.xml examples/org.eclipse.swt.examples.browser/src/import.properties examples/org.eclipse.swt.examples.browser/src/org/eclipse/swt/examples/browserexample/BrowserPlugin.java examples/org.eclipse.swt.examples.browser/src/org/eclipse/swt/examples/browserexample/BrowserView.java examples/org.eclipse.swt.examples.controls/.classpath examples/org.eclipse.swt.examples.controls/.cvsignore examples/org.eclipse.swt.examples.controls/.project examples/org.eclipse.swt.examples.controls/about.html examples/org.eclipse.swt.examples.controls/build.properties examples/org.eclipse.swt.examples.controls/doc-html/hglegal.htm examples/org.eclipse.swt.examples.controls/doc-html/ngibmcpy.gif examples/org.eclipse.swt.examples.controls/doc-html/swt_controls_ex.html examples/org.eclipse.swt.examples.controls/doc-html/swt_customcontrols_ex.html examples/org.eclipse.swt.examples.controls/icons/controls_example.gif examples/org.eclipse.swt.examples.controls/plugin.properties examples/org.eclipse.swt.examples.controls/plugin.xml examples/org.eclipse.swt.examples.controls/src/import.properties examples/org.eclipse.swt.examples.controls/src/org/eclipse/swt/examples/controls/ControlPlugin.java examples/org.eclipse.swt.examples.controls/src/org/eclipse/swt/examples/controls/ControlView.java examples/org.eclipse.swt.examples.controls/src/org/eclipse/swt/examples/controls/CustomControlView.java examples/org.eclipse.swt.examples.launcher/.classpath examples/org.eclipse.swt.examples.launcher/.cvsignore examples/org.eclipse.swt.examples.launcher/.project examples/org.eclipse.swt.examples.launcher/about.html examples/org.eclipse.swt.examples.launcher/build.properties examples/org.eclipse.swt.examples.launcher/doc-html/hglegal.htm examples/org.eclipse.swt.examples.launcher/doc-html/ngibmcpy.gif examples/org.eclipse.swt.examples.launcher/doc-html/swt_launcher_ex.html examples/org.eclipse.swt.examples.launcher/doc/org.eclipse.swt.examples.launcher.launchItems.html examples/org.eclipse.swt.examples.launcher/icons/closedFolder.gif examples/org.eclipse.swt.examples.launcher/icons/generic_example.gif examples/org.eclipse.swt.examples.launcher/icons/launcher_example.gif examples/org.eclipse.swt.examples.launcher/icons/openFolder.gif examples/org.eclipse.swt.examples.launcher/plugin.properties examples/org.eclipse.swt.examples.launcher/plugin.xml examples/org.eclipse.swt.examples.launcher/schema/org.eclipse.swt.examples.launcher.launchItems.exsd examples/org.eclipse.swt.examples.launcher/src/import.properties examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/ItemDescriptor.java examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/ItemTreeNode.java examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/LauncherPlugin.java examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/LauncherView.java examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/SplitLayout.java examples/org.eclipse.swt.examples.layouts/.classpath examples/org.eclipse.swt.examples.layouts/.cvsignore examples/org.eclipse.swt.examples.layouts/.project examples/org.eclipse.swt.examples.layouts/about.html examples/org.eclipse.swt.examples.layouts/build.properties examples/org.eclipse.swt.examples.layouts/doc-html/hglegal.htm examples/org.eclipse.swt.examples.layouts/doc-html/ngibmcpy.gif examples/org.eclipse.swt.examples.layouts/doc-html/swt_layout_ex.html examples/org.eclipse.swt.examples.layouts/icons/layouts_example.gif examples/org.eclipse.swt.examples.layouts/plugin.properties examples/org.eclipse.swt.examples.layouts/plugin.xml examples/org.eclipse.swt.examples.layouts/src/import.properties examples/org.eclipse.swt.examples.layouts/src/org/eclipse/swt/examples/layouts/LayoutPlugin.java examples/org.eclipse.swt.examples.layouts/src/org/eclipse/swt/examples/layouts/LayoutView.java examples/org.eclipse.swt.examples.ole.win32/.classpath examples/org.eclipse.swt.examples.ole.win32/.cvsignore examples/org.eclipse.swt.examples.ole.win32/.project examples/org.eclipse.swt.examples.ole.win32/about.html examples/org.eclipse.swt.examples.ole.win32/build.properties examples/org.eclipse.swt.examples.ole.win32/doc-html/hglegal.htm examples/org.eclipse.swt.examples.ole.win32/doc-html/ngibmcpy.gif examples/org.eclipse.swt.examples.ole.win32/doc-html/swt_ole_ex.html examples/org.eclipse.swt.examples.ole.win32/icons/backward_nav.gif examples/org.eclipse.swt.examples.ole.win32/icons/forward_nav.gif examples/org.eclipse.swt.examples.ole.win32/icons/home_nav.gif examples/org.eclipse.swt.examples.ole.win32/icons/refresh_nav.gif examples/org.eclipse.swt.examples.ole.win32/icons/search_nav.gif examples/org.eclipse.swt.examples.ole.win32/icons/stop_nav.gif examples/org.eclipse.swt.examples.ole.win32/icons/webbrowser_example.gif examples/org.eclipse.swt.examples.ole.win32/plugin.properties examples/org.eclipse.swt.examples.ole.win32/plugin.xml examples/org.eclipse.swt.examples.ole.win32/src/import.properties examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OleBrowserView.java examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OlePlugin.java examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OleWebBrowser.java examples/org.eclipse.swt.examples.paint/.classpath examples/org.eclipse.swt.examples.paint/.cvsignore examples/org.eclipse.swt.examples.paint/.project examples/org.eclipse.swt.examples.paint/about.html examples/org.eclipse.swt.examples.paint/build.properties examples/org.eclipse.swt.examples.paint/doc-html/hglegal.htm examples/org.eclipse.swt.examples.paint/doc-html/ngibmcpy.gif examples/org.eclipse.swt.examples.paint/doc-html/swt_paint_ex.html examples/org.eclipse.swt.examples.paint/icons/fill_none.gif examples/org.eclipse.swt.examples.paint/icons/fill_outline.gif examples/org.eclipse.swt.examples.paint/icons/fill_solid.gif examples/org.eclipse.swt.examples.paint/icons/linestyle_dash.gif examples/org.eclipse.swt.examples.paint/icons/linestyle_dashdot.gif examples/org.eclipse.swt.examples.paint/icons/linestyle_dot.gif examples/org.eclipse.swt.examples.paint/icons/linestyle_solid.gif examples/org.eclipse.swt.examples.paint/icons/options_font.gif examples/org.eclipse.swt.examples.paint/icons/paint_example.gif examples/org.eclipse.swt.examples.paint/icons/tool_airbrush.gif examples/org.eclipse.swt.examples.paint/icons/tool_ellipse.gif examples/org.eclipse.swt.examples.paint/icons/tool_line.gif examples/org.eclipse.swt.examples.paint/icons/tool_pencil.gif examples/org.eclipse.swt.examples.paint/icons/tool_polyline.gif examples/org.eclipse.swt.examples.paint/icons/tool_rectangle.gif examples/org.eclipse.swt.examples.paint/icons/tool_roundedrectangle.gif examples/org.eclipse.swt.examples.paint/icons/tool_text.gif examples/org.eclipse.swt.examples.paint/plugin.properties examples/org.eclipse.swt.examples.paint/plugin.xml examples/org.eclipse.swt.examples.paint/src/import.properties examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/AirbrushTool.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/BasicPaintSession.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/ContainerFigure.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/ContinuousPaintSession.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/DragPaintSession.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/EllipseFigure.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/EllipseTool.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/Figure.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/FigureDrawContext.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/LineFigure.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/LineTool.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintPlugin.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintSession.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintSurface.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintTool.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintView.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PencilTool.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PointFigure.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PolyLineTool.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RectangleFigure.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RectangleTool.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RoundedRectangleFigure.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RoundedRectangleTool.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SegmentedPaintSession.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidEllipseFigure.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidPolygonFigure.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidRectangleFigure.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidRoundedRectangleFigure.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/TextFigure.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/TextTool.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/ToolSettings.java examples/org.eclipse.swt.examples/.classpath examples/org.eclipse.swt.examples/.cvsignore examples/org.eclipse.swt.examples/.project examples/org.eclipse.swt.examples/about.html examples/org.eclipse.swt.examples/build.properties examples/org.eclipse.swt.examples/doc-html/hglegal.htm examples/org.eclipse.swt.examples/doc-html/ngibmcpy.gif examples/org.eclipse.swt.examples/doc-html/swt_addressbook_ex.html examples/org.eclipse.swt.examples/doc-html/swt_clipboard_ex.html examples/org.eclipse.swt.examples/doc-html/swt_fileviewer_ex.html examples/org.eclipse.swt.examples/doc-html/swt_helloworld_ex.html examples/org.eclipse.swt.examples/doc-html/swt_hoverhelp_ex.html examples/org.eclipse.swt.examples/doc-html/swt_imageanalyzer_ex.html examples/org.eclipse.swt.examples/doc-html/swt_javaviewer_ex.html examples/org.eclipse.swt.examples/doc-html/swt_manual_setup.html examples/org.eclipse.swt.examples/doc-html/swt_texteditor_ex.html examples/org.eclipse.swt.examples/plugin.properties examples/org.eclipse.swt.examples/plugin.xml examples/org.eclipse.swt.examples/src/examples_addressbook.properties examples/org.eclipse.swt.examples/src/examples_browser.properties examples/org.eclipse.swt.examples/src/examples_control.properties examples/org.eclipse.swt.examples/src/examples_fileviewer.properties examples/org.eclipse.swt.examples/src/examples_helloworld.properties examples/org.eclipse.swt.examples/src/examples_hoverhelp.properties examples/org.eclipse.swt.examples/src/examples_images.properties examples/org.eclipse.swt.examples/src/examples_javaviewer.properties examples/org.eclipse.swt.examples/src/examples_layout.properties examples/org.eclipse.swt.examples/src/examples_texteditor.properties examples/org.eclipse.swt.examples/src/import.properties examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/AddressBook.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/DataEntryDialog.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/FindListener.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/SearchDialog.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/BrowserExample.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse01.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse02.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse03.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse04.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse05.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse06.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse07.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse08.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse09.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse10.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse11.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse12.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/ClipboardExample.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/MyType.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/MyTypeTransfer.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/AlignableTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ButtonTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CComboTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CLabelTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CTabFolderTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CanvasTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ComboTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CoolBarTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CustomControlExample.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/DialogTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/GroupTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/LabelTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ListTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ProgressBarTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/RangeTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SashFormTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SashTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ScrollableTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ShellTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SliderTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/StyledTextTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/Tab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TabFolderTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TableTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TableTreeTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TextTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ToolBarTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TreeTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/bold.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/bold_mask.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/closedFolder.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/openFolder.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/red.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/red_mask.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/target.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/yellow.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/yellow_mask.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/dnd/DNDExample.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/dnd/ImageTransfer.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/FileViewer.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/IconCache.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Copy.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Cut.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Delete.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Parent.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Paste.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Print.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Refresh.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Rename.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Search.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/generic_example.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/icon_ClosedDrive.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/icon_ClosedFolder.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/icon_File.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/icon_OpenDrive.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/icon_OpenFolder.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld1.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld2.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld3.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld4.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld5.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/hoverhelp/HoverHelp.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/hoverhelp/information.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/hoverhelp/warning.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/imageanalyzer/ImageAnalyzer.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaLineStyler.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaViewer.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/FillLayoutTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/FormLayoutTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/GridLayoutTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/LayoutExample.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/RowLayoutTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/Tab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/Images.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/TextEditor.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/blue.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/blue_mask.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/bold.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/bold_mask.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/erase.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/erase_mask.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/green.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/green_mask.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/red.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/red_mask.bmp examples/org.eclipse.swt.opengl.examples/.classpath examples/org.eclipse.swt.opengl.examples/.project examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/AntialiasingTab.java examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/AreaTab.java examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/BezierTab.java examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/BitmapTextTab.java examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/ColorSelectionGroup.java examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/FogTab.java examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/GradientTab.java examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/IColorSelectionListener.java examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/LightTab.java examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/NurbTab.java examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/ObjectsTab.java examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/OpenGLExample.java examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/OpenGLTab.java examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/OutlineTextTab.java examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/ReflectionTab.java examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/SelectionTab.java examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/StencilTab.java examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/TextureTab.java examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/TransparencyTab.java examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/images/Ball.jpg examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/images/Box.bmp examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/images/Floor.jpg examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/images/splash.bmp examples/org.eclipse.swt.opengl.examples/src/org/eclipse/swt/opengl/examples/images/untitled.jpg tests/org.eclipse.swt.tests/.classpath tests/org.eclipse.swt.tests/.cvsignore tests/org.eclipse.swt.tests/.project tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/AllBrowserTests.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/AllGraphicsTests.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/AllTests.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/AllWidgetTests.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/EmulatedWidgetsTests.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/StyledTextContentSpec.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtJunit.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtTestCase.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_SWT.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_SWTError.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_SWTException.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_ACC.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_Accessible.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_AccessibleAdapter.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_AccessibleControlAdapter.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_AccessibleControlEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_AccessibleControlListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_AccessibleEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_accessibility_AccessibleListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_CloseWindowListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_LocationAdapter.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_LocationListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_OpenWindowListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_ProgressAdapter.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_ProgressListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_StatusTextListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_VisibilityWindowAdapter.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_VisibilityWindowListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_AnimatedProgress.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_BidiSegmentEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_BidiSegmentListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_BusyIndicator.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CCombo.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CLabel.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CTabFolder.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CTabFolderAdapter.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CTabFolderEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CTabFolderListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CTabItem.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_ControlEditor.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_ExtendedModifyEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_ExtendedModifyListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_LineBackgroundEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_LineBackgroundListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_LineStyleEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_LineStyleListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_PopupList.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_ST.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_SashForm.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_ScrolledComposite.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StackLayout.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyleRange.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledTextContent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TableCursor.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TableEditor.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TableTree.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TableTreeEditor.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TableTreeItem.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TextChangeListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TextChangedEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TextChangingEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TreeEditor.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_VerifyKeyListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_ViewForm.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_ByteArrayTransfer.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_Clipboard.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_DND.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_DragSource.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_DragSourceAdapter.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_DragSourceEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_DragSourceListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_DropTarget.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_DropTargetAdapter.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_DropTargetEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_DropTargetListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_FileTransfer.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_RTFTransfer.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_TextTransfer.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_Transfer.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_TransferData.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_ArmEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_ArmListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_ControlAdapter.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_ControlEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_ControlListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_DisposeEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_DisposeListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_FocusAdapter.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_FocusEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_FocusListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_HelpEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_HelpListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_KeyAdapter.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_KeyEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_KeyListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_MenuAdapter.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_MenuEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_MenuListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_ModifyEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_ModifyListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_MouseAdapter.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_MouseEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_MouseListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_MouseMoveListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_MouseTrackAdapter.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_MouseTrackListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_PaintEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_PaintListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_SelectionAdapter.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_SelectionEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_SelectionListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_ShellAdapter.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_ShellEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_ShellListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_TraverseEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_TraverseListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_TreeAdapter.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_TreeEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_TreeListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_TypedEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_VerifyEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_VerifyListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Color.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Cursor.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Device.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_DeviceData.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Drawable.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Font.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_FontData.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_FontMetrics.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_GC.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_GCData.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Image.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_ImageData.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_ImageLoader.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_ImageLoaderEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_ImageLoaderListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_PaletteData.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Point.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_RGB.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Rectangle.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Region.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_layout_FillLayout.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_layout_FormAttachment.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_layout_FormData.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_layout_FormLayout.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_layout_GridData.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_layout_GridLayout.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_layout_RowData.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_layout_RowLayout.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_ole_win32_OLE.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_ole_win32_OleAutomation.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_ole_win32_OleClientSite.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_ole_win32_OleControlSite.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_ole_win32_OleEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_ole_win32_OleFrame.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_ole_win32_OleFunctionDescription.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_ole_win32_OleListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_ole_win32_OleParameterDescription.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_ole_win32_OlePropertyDescription.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_ole_win32_Variant.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_printing_PrintDialog.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_printing_Printer.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_printing_PrinterData.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_program_Program.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Button.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Canvas.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Caret.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ColorDialog.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Combo.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Composite.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Control.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_CoolBar.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_CoolItem.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Decorations.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Dialog.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_DirectoryDialog.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Display.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Event.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_FileDialog.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_FontDialog.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Group.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Item.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Label.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Layout.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_List.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Listener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Menu.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_MenuItem.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_MessageBox.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Monitor.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ProgressBar.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Sash.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Scale.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ScrollBar.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Scrollable.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Shell.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Slider.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Synchronizer.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TabFolder.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TabItem.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Table.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableColumn.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableItem.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Text.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ToolBar.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ToolItem.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Tracker.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Tree.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeItem.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TypedListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Widget.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/browser/Browser1.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/browser/Browser2.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/browser/Browser3.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/browser/Browser4.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/browser/Browser5.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/browser/Test_BrowserSuite.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/empty.txt tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/folder.bmp tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/folder.gif tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/folder.jpg tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/folder.png tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/folderOpen.bmp tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/folderOpen.gif tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/folderOpen.jpg tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/folderOpen.png tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/interlaced_target.png tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/junitGen.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/target.bmp tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/target.gif tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/target.jpg tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/target.png tests/org.eclipse.swt.tests/about.html tests/org.eclipse.swt.tests/build.properties tests/org.eclipse.swt.tests/data/browser3.html tests/org.eclipse.swt.tests/data/browser4.html tests/org.eclipse.swt.tests/data/browser4a.html tests/org.eclipse.swt.tests/data/browser5.html tests/org.eclipse.swt.tests/plugin.properties tests/org.eclipse.swt.tests/plugin.xml tests/org.eclipse.swt.tests/test.xml --- .../src/examples_addressbook.properties | 69 - .../src/examples_browser.properties | 20 - .../src/examples_control.properties | 179 -- .../src/examples_fileviewer.properties | 69 - .../src/examples_helloworld.properties | 11 - .../src/examples_hoverhelp.properties | 26 - .../src/examples_images.properties | 111 -- .../src/examples_javaviewer.properties | 17 - .../src/examples_layout.properties | 51 - .../src/examples_texteditor.properties | 18 - .../org.eclipse.swt.examples/src/import.properties | 26 - .../swt/examples/addressbook/AddressBook.java | 873 -------- .../swt/examples/addressbook/DataEntryDialog.java | 163 -- .../swt/examples/addressbook/FindListener.java | 18 - .../swt/examples/addressbook/SearchDialog.java | 202 -- .../examples/browserexample/BrowserExample.java | 318 --- .../swt/examples/browserexample/eclipse01.bmp | Bin 6966 -> 0 bytes .../swt/examples/browserexample/eclipse02.bmp | Bin 6966 -> 0 bytes .../swt/examples/browserexample/eclipse03.bmp | Bin 6966 -> 0 bytes .../swt/examples/browserexample/eclipse04.bmp | Bin 6966 -> 0 bytes .../swt/examples/browserexample/eclipse05.bmp | Bin 6966 -> 0 bytes .../swt/examples/browserexample/eclipse06.bmp | Bin 6966 -> 0 bytes .../swt/examples/browserexample/eclipse07.bmp | Bin 6966 -> 0 bytes .../swt/examples/browserexample/eclipse08.bmp | Bin 6966 -> 0 bytes .../swt/examples/browserexample/eclipse09.bmp | Bin 6966 -> 0 bytes .../swt/examples/browserexample/eclipse10.bmp | Bin 6966 -> 0 bytes .../swt/examples/browserexample/eclipse11.bmp | Bin 6966 -> 0 bytes .../swt/examples/browserexample/eclipse12.bmp | Bin 6966 -> 0 bytes .../swt/examples/clipboard/ClipboardExample.java | 370 ---- .../org/eclipse/swt/examples/clipboard/MyType.java | 16 - .../swt/examples/clipboard/MyTypeTransfer.java | 92 - .../swt/examples/controlexample/AlignableTab.java | 89 - .../swt/examples/controlexample/ButtonTab.java | 205 -- .../swt/examples/controlexample/CComboTab.java | 115 -- .../swt/examples/controlexample/CLabelTab.java | 138 -- .../swt/examples/controlexample/CTabFolderTab.java | 165 -- .../swt/examples/controlexample/CanvasTab.java | 306 --- .../swt/examples/controlexample/ComboTab.java | 140 -- .../examples/controlexample/ControlExample.java | 205 -- .../swt/examples/controlexample/CoolBarTab.java | 439 ----- .../controlexample/CustomControlExample.java | 59 - .../swt/examples/controlexample/DialogTab.java | 469 ----- .../swt/examples/controlexample/GroupTab.java | 159 -- .../swt/examples/controlexample/LabelTab.java | 190 -- .../swt/examples/controlexample/ListTab.java | 85 - .../examples/controlexample/ProgressBarTab.java | 145 -- .../swt/examples/controlexample/RangeTab.java | 183 -- .../swt/examples/controlexample/SashFormTab.java | 100 - .../swt/examples/controlexample/SashTab.java | 184 -- .../swt/examples/controlexample/ScrollableTab.java | 63 - .../swt/examples/controlexample/ShellTab.java | 292 --- .../swt/examples/controlexample/SliderTab.java | 253 --- .../swt/examples/controlexample/StyledTextTab.java | 244 --- .../eclipse/swt/examples/controlexample/Tab.java | 937 --------- .../swt/examples/controlexample/TabFolderTab.java | 131 -- .../swt/examples/controlexample/TableTab.java | 338 ---- .../swt/examples/controlexample/TableTreeTab.java | 225 --- .../swt/examples/controlexample/TextTab.java | 138 -- .../swt/examples/controlexample/ToolBarTab.java | 282 --- .../swt/examples/controlexample/TreeTab.java | 269 --- .../eclipse/swt/examples/controlexample/bold.bmp | Bin 134 -> 0 bytes .../swt/examples/controlexample/bold_mask.bmp | Bin 134 -> 0 bytes .../swt/examples/controlexample/closedFolder.gif | Bin 906 -> 0 bytes .../swt/examples/controlexample/openFolder.gif | Bin 184 -> 0 bytes .../eclipse/swt/examples/controlexample/red.bmp | Bin 334 -> 0 bytes .../swt/examples/controlexample/red_mask.bmp | Bin 134 -> 0 bytes .../eclipse/swt/examples/controlexample/target.gif | Bin 917 -> 0 bytes .../eclipse/swt/examples/controlexample/yellow.bmp | Bin 352 -> 0 bytes .../swt/examples/controlexample/yellow_mask.bmp | Bin 134 -> 0 bytes .../org/eclipse/swt/examples/dnd/DNDExample.java | 1174 ----------- .../eclipse/swt/examples/dnd/ImageTransfer.java | 76 - .../swt/examples/fileviewer/FileViewer.java | 1717 ---------------- .../eclipse/swt/examples/fileviewer/IconCache.java | 156 -- .../eclipse/swt/examples/fileviewer/cmd_Copy.gif | Bin 167 -> 0 bytes .../eclipse/swt/examples/fileviewer/cmd_Cut.gif | Bin 152 -> 0 bytes .../eclipse/swt/examples/fileviewer/cmd_Delete.gif | Bin 143 -> 0 bytes .../eclipse/swt/examples/fileviewer/cmd_Parent.gif | Bin 132 -> 0 bytes .../eclipse/swt/examples/fileviewer/cmd_Paste.gif | Bin 245 -> 0 bytes .../eclipse/swt/examples/fileviewer/cmd_Print.gif | Bin 227 -> 0 bytes .../swt/examples/fileviewer/cmd_Refresh.gif | Bin 182 -> 0 bytes .../eclipse/swt/examples/fileviewer/cmd_Rename.gif | Bin 163 -> 0 bytes .../eclipse/swt/examples/fileviewer/cmd_Search.gif | Bin 153 -> 0 bytes .../swt/examples/fileviewer/generic_example.gif | Bin 158 -> 0 bytes .../swt/examples/fileviewer/icon_ClosedDrive.gif | Bin 217 -> 0 bytes .../swt/examples/fileviewer/icon_ClosedFolder.gif | Bin 160 -> 0 bytes .../eclipse/swt/examples/fileviewer/icon_File.gif | Bin 152 -> 0 bytes .../swt/examples/fileviewer/icon_OpenDrive.gif | Bin 231 -> 0 bytes .../swt/examples/fileviewer/icon_OpenFolder.gif | Bin 152 -> 0 bytes .../swt/examples/helloworld/HelloWorld1.java | 36 - .../swt/examples/helloworld/HelloWorld2.java | 42 - .../swt/examples/helloworld/HelloWorld3.java | 49 - .../swt/examples/helloworld/HelloWorld4.java | 45 - .../swt/examples/helloworld/HelloWorld5.java | 56 - .../eclipse/swt/examples/hoverhelp/HoverHelp.java | 350 ---- .../eclipse/swt/examples/hoverhelp/information.gif | Bin 92 -> 0 bytes .../org/eclipse/swt/examples/hoverhelp/warning.gif | Bin 152 -> 0 bytes .../swt/examples/imageanalyzer/ImageAnalyzer.java | 2080 -------------------- .../swt/examples/javaviewer/JavaLineStyler.java | 378 ---- .../swt/examples/javaviewer/JavaViewer.java | 180 -- .../swt/examples/layoutexample/FillLayoutTab.java | 179 -- .../swt/examples/layoutexample/FormLayoutTab.java | 762 ------- .../swt/examples/layoutexample/GridLayoutTab.java | 590 ------ .../swt/examples/layoutexample/LayoutExample.java | 114 -- .../swt/examples/layoutexample/RowLayoutTab.java | 413 ---- .../eclipse/swt/examples/layoutexample/Tab.java | 646 ------ .../eclipse/swt/examples/texteditor/Images.java | 58 - .../swt/examples/texteditor/TextEditor.java | 348 ---- .../org/eclipse/swt/examples/texteditor/blue.bmp | Bin 334 -> 0 bytes .../eclipse/swt/examples/texteditor/blue_mask.bmp | Bin 134 -> 0 bytes .../org/eclipse/swt/examples/texteditor/bold.bmp | Bin 134 -> 0 bytes .../eclipse/swt/examples/texteditor/bold_mask.bmp | Bin 134 -> 0 bytes .../org/eclipse/swt/examples/texteditor/erase.bmp | Bin 334 -> 0 bytes .../eclipse/swt/examples/texteditor/erase_mask.bmp | Bin 134 -> 0 bytes .../org/eclipse/swt/examples/texteditor/green.bmp | Bin 334 -> 0 bytes .../eclipse/swt/examples/texteditor/green_mask.bmp | Bin 134 -> 0 bytes .../org/eclipse/swt/examples/texteditor/red.bmp | Bin 334 -> 0 bytes .../eclipse/swt/examples/texteditor/red_mask.bmp | Bin 134 -> 0 bytes 117 files changed, 18646 deletions(-) delete mode 100644 examples/org.eclipse.swt.examples/src/examples_addressbook.properties delete mode 100644 examples/org.eclipse.swt.examples/src/examples_browser.properties delete mode 100644 examples/org.eclipse.swt.examples/src/examples_control.properties delete mode 100644 examples/org.eclipse.swt.examples/src/examples_fileviewer.properties delete mode 100644 examples/org.eclipse.swt.examples/src/examples_helloworld.properties delete mode 100644 examples/org.eclipse.swt.examples/src/examples_hoverhelp.properties delete mode 100644 examples/org.eclipse.swt.examples/src/examples_images.properties delete mode 100644 examples/org.eclipse.swt.examples/src/examples_javaviewer.properties delete mode 100644 examples/org.eclipse.swt.examples/src/examples_layout.properties delete mode 100644 examples/org.eclipse.swt.examples/src/examples_texteditor.properties delete mode 100644 examples/org.eclipse.swt.examples/src/import.properties delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/AddressBook.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/DataEntryDialog.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/FindListener.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/SearchDialog.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/BrowserExample.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse01.bmp delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse02.bmp delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse03.bmp delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse04.bmp delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse05.bmp delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse06.bmp delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse07.bmp delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse08.bmp delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse09.bmp delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse10.bmp delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse11.bmp delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse12.bmp delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/ClipboardExample.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/MyType.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/MyTypeTransfer.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/AlignableTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ButtonTab.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CComboTab.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CLabelTab.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CTabFolderTab.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CanvasTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ComboTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CoolBarTab.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CustomControlExample.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/DialogTab.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/GroupTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/LabelTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ListTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ProgressBarTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/RangeTab.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SashFormTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SashTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ScrollableTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ShellTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SliderTab.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/StyledTextTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/Tab.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TabFolderTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TableTab.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TableTreeTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TextTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ToolBarTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TreeTab.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/bold.bmp delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/bold_mask.bmp delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/closedFolder.gif delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/openFolder.gif delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/red.bmp delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/red_mask.bmp delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/target.gif delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/yellow.bmp delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/yellow_mask.bmp delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/dnd/DNDExample.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/dnd/ImageTransfer.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/FileViewer.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/IconCache.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Copy.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Cut.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Delete.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Parent.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Paste.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Print.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Refresh.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Rename.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Search.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/generic_example.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/icon_ClosedDrive.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/icon_ClosedFolder.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/icon_File.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/icon_OpenDrive.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/icon_OpenFolder.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld1.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld2.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld3.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld4.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld5.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/hoverhelp/HoverHelp.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/hoverhelp/information.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/hoverhelp/warning.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/imageanalyzer/ImageAnalyzer.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaLineStyler.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaViewer.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/FillLayoutTab.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/FormLayoutTab.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/GridLayoutTab.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/LayoutExample.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/RowLayoutTab.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/Tab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/Images.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/TextEditor.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/blue.bmp delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/blue_mask.bmp delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/bold.bmp delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/bold_mask.bmp delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/erase.bmp delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/erase_mask.bmp delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/green.bmp delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/green_mask.bmp delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/red.bmp delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/red_mask.bmp (limited to 'examples/org.eclipse.swt.examples/src') diff --git a/examples/org.eclipse.swt.examples/src/examples_addressbook.properties b/examples/org.eclipse.swt.examples/src/examples_addressbook.properties deleted file mode 100644 index 19e36dd2c6..0000000000 --- a/examples/org.eclipse.swt.examples/src/examples_addressbook.properties +++ /dev/null @@ -1,69 +0,0 @@ -############################################################################### -# Copyright (c) 2000, 2003 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are 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 -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -Last_name = Last Name -First_name = First Name -Business_phone = Business Phone -Home_phone = Home Phone -Email = Email -Fax = Fax -Close_save = The address book contents have changed.\nDo you want to save the changes? -New_title = Untitled -Column = Column: -Book_extension = .adr -Book_filter_name = Address Books -All_filter_name = All Files -File = File -Does_not_exist = does not exist. -File_not_found = File not found: -IO_error_read = IO error reading text file: -IO_error_write = IO error writing text file: -IO_error_close = IO error closing text file: -Title_bar = Address Book - -Save_as_title = Save As -Query_overwrite = already exists.\nDo you want to replace it? -File_menu_title = &File -New_contact = &New Contact...\tCtrl+N -Edit_contact = &Edit Contact...\tCtrl+E -New_address_book = New Address &Book\tCtrl+B -Open_address_book = &Open Address Book...\tCtrl+O -Save_address_book = &Save Address Book\tCtrl+S -Save_book_as = Save &Address Book As...\tCtrl+A -Exit = E&xit -Edit_menu_title = &Edit -Edit = &Edit...\tCtrl+E -Copy = &Copy\tCtrl+C -Paste = &Paste\tCtrl+V -Delete = De&lete\tDel -Sort = &Sort -Search_menu_title = &Search -Find = &Find...\tCtrl+F -Find_next = Find &Next...\tF3 -Pop_up_new = &New... -Pop_up_edit = &Edit... -Pop_up_copy = &Copy -Pop_up_paste = &Paste -Pop_up_delete = &Delete -Pop_up_find = &Find... -Help_menu_title = &Help -About = &About Address Book... -About_1 = About -About_2 = \nversion 1.0 -OK = OK -Cancel = Cancel -Search_dialog_title = Find -Dialog_find_what = Fi&nd what: -Dialog_match_case = Match &case -Dialog_match_word = Match &whole word -Dialog_direction = Direction -Dialog_dir_up = &Up -Dialog_dir_down = &Down -Dialog_find = &Find -Cannot_find = Cannot find \ No newline at end of file diff --git a/examples/org.eclipse.swt.examples/src/examples_browser.properties b/examples/org.eclipse.swt.examples/src/examples_browser.properties deleted file mode 100644 index e102cfd52c..0000000000 --- a/examples/org.eclipse.swt.examples/src/examples_browser.properties +++ /dev/null @@ -1,20 +0,0 @@ -############################################################################### -# Copyright (c) 2000, 2003 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are 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 -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -error.CouldNotLoadResources = Unable to load resources -window.title = SWT Browser - -Back = Back -BrowserNotCreated = Error - The Browser widget could not be instantiated. Please check the Browser widget is supported on this platform. Supported platforms and software requirements for the Browser widget are listed on the SWT FAQ web page. -Forward = Forward -Stop = Stop -Refresh = Refresh -Go = Go -Startup = http://www.eclipse.org diff --git a/examples/org.eclipse.swt.examples/src/examples_control.properties b/examples/org.eclipse.swt.examples/src/examples_control.properties deleted file mode 100644 index 29d819572e..0000000000 --- a/examples/org.eclipse.swt.examples/src/examples_control.properties +++ /dev/null @@ -1,179 +0,0 @@ -############################################################################### -# Copyright (c) 2000, 2003 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are 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 -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -error.CouldNotLoadResources = Unable to load resources -window.title = SWT Controls -custom.window.title = SWT Custom Controls - -Text_Buttons = Text Buttons -Size = Size -Alignment = Alignment -Left = Left -Right = Right -Up = Up -Down = Down -Center = Center -One = One -Two = Two -Three = Three -Image_Buttons = Image Buttons -Control_Example = Control Example -Parameters = Parameters -Other = Other -Enabled = Enabled -Visible = Visible -Preferred = Preferred -Styles = Styles -Listeners = Listeners -Select_Listeners = Select Listeners -Listen = Listen -Clear = Clear -Select_All = Select All -Deselect_All = Deselect All -OK = OK -FillDamage = Fill Damaged Area With Color -Title_Text = Title Text -Text_Labels = Text Labels -Image_Labels = Image Labels -Custom_Labels = Custom Labels -Custom_Combo = Custom Combo -One_Two_Three = One Two Three -Text_ToolBar = Text ToolBar -Image_ToolBar = Image ToolBar -Maximum = Maximum -Minimum = Minimum -Selection = Selection -Increment = Increment -Page_Increment = Page Increment -Thumb = Thumb -Tree_With_Images = Tree With Images -Dialog_Type = Dialog Type -Create_Dialog = Create Dialog -Button_Styles = Button Styles -Icon_Styles = Icon Styles -Modal_Styles = Modal Styles -File_Dialog_Styles = File Dialog Styles -Item_Styles = Item Styles -Dialog_Result = Dialog Result -ColorDialog = ColorDialog -DirectoryDialog = DirectoryDialog -FileDialog = FileDialog -FontDialog = FontDialog -PrintDialog = PrintDialog -MessageBox = MessageBox -Multi_line = A multi line text widget. -Example_string = The quick brown fox jumps over the lazy dog. -Header_Visible = Header Visible -Lines_Visible = Lines Visible -Locked = Locked -Node_1 = Node 1 -Node_2 = Node 2 -Node_3 = Node 3 -Node_4 = Node 4 -Node_1_1 = Node 1.1 -Node_2_1 = Node 2.1 -Node_3_1 = Node 3.1 -Node_2_2 = Node 2.2 -Node_2_2_1 = Node 2.2.1 -Parent = Parent -No_Parent = No Parent -Decoration_Styles = Decoration Styles -Create_Shell = Create Shell -Close_All_Shells = Close All Shells -Push = Push -Radio = Radio -Check = Check -Drop_Down = Drop Down -Images_failed = Warning: Failed to load images -readme_txt = readme.txt -Index = Index: -Title = Title: -Close = Close -Result = Result: {0} -FilterName_0 = Text Files -FilterName_1 = Batch Files -FilterName_2 = Doc Files -TableTitle_0 = Name -TableTitle_1 = Type -TableTitle_2 = Size -TableTitle_3 = Modified -TableLine0_0 = -TableLine0_1 = classes -TableLine0_2 = 0 -TableLine0_3 = today -TableLine1_0 = -TableLine1_1 = databases -TableLine1_2 = 2556 -TableLine1_3 = -TableLine2_0 = -TableLine2_1 = images -TableLine2_2 = 91571 -TableLine2_3 = yesterday -ListData0_0 = Line 1 -ListData0_1 = Line 2 -ListData0_2 = Line 3 -ListData0_3 = Line 4 -ListData0_4 = Line 5 -ListData0_5 = Line 6 -ListData0_6 = Line 7 -ListData0_7 = Line 8 -ListData0_8 = Longest Line In List -ListData1_0 = Apples -ListData1_1 = Oranges -ListData1_2 = Bananas -ListData1_3 = Grapefruit -ListData1_4 = Peaches -ListData1_5 = Kiwi -ListData1_6 = Apricots -ListData1_7 = Strawberries -ListData1_8 = The Longest String -DropDownData_0 = Apples -DropDownData_1 = Oranges -DropDownData_2 = -DropDownData_3 = Grapefruit -DropDownData_4 = Peaches -DropDownData_5 = Kiwi -DropDownData_6 = -DropDownData_7 = Strawberries -DropDownData_8 = The Longest String -Colors = Colors and Font -Table_Item_Colors = Index:0 Table Item Colors -Tree_Item_Colors = Node 1 Tree Item Colors -Background_Color = Background Color -Foreground_Color = Foreground Color -Item_Background_Color = Item Background Color -Item_Foreground_Color = Item Foreground Color -Font = &Font... -Defaults = &Defaults -Wrap_Text = Jack and Jill went up the hill to fetch a pail of water, \ - Jack fell down and broke his crown and Jill came tumbling after! -Foreground_Style = Foreground Style -Background_Style = Background Style -StyledText_Styles = Text Styles -StyledText_Style_Instructions = Select text, then style. -Bold = Bold -Fill = Horizontal Fill -TabItem1_0 = Tab 0 -TabItem1_1 = Tab 1 -TabItem1_2 = Tab 2 -TabItem_content = TabItem Content -CTabItem1_0 = CTab 0 -CTabItem1_1 = CTab 1 -CTabItem1_2 = CTab 2 -CItem_Colors = CTabItem Colors -CTabItem_content = CTabItem Content -TableTree_column = Column -MenuItem_Cut = Cu&t Ctrl+X -MenuItem_Copy = &Copy Ctrl+C -MenuItem_Paste = &Paste Ctrl+V -MenuItem_SelectAll = Select &All Ctrl+A -Orientation = Orientation -Default = Default (Inherit) - diff --git a/examples/org.eclipse.swt.examples/src/examples_fileviewer.properties b/examples/org.eclipse.swt.examples/src/examples_fileviewer.properties deleted file mode 100644 index 9948e091f0..0000000000 --- a/examples/org.eclipse.swt.examples/src/examples_fileviewer.properties +++ /dev/null @@ -1,69 +0,0 @@ -############################################################################### -# Copyright (c) 2000, 2003 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are 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 -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -Title = SWT FileViewer - {0} - -menu.File.text = &File -menu.File.Close.text = &Close -menu.File.SimulateOnly.text = Simulate File Operations -menu.Help.text = &Help -menu.Help.About.text = &About - -tool.Cut.tiptext = Cut -tool.Copy.tiptext = Copy -tool.Delete.tiptext = Delete -tool.Parent.tiptext = Parent -tool.Paste.tiptext = Paste -tool.Print.tiptext = Print -tool.Refresh.tiptext = Refresh -tool.Rename.tiptext = Rename -tool.Search.tiptext = Search - -details.AllFolders.text = All Folders -details.ContentsOf.text = Contents of ''{0}'' -details.FileSize.text = {0} bytes -details.DirNumberOfObjects.text = {0} object(s) -details.NumberOfSelectedFiles.text = {0} object(s) selected - -table.Name.title = Name -table.Size.title = Size -table.Type.title = Type -table.Modified.title = Modified - -filetype.Unknown = {0} File -filetype.None = File -filetype.Folder = Folder -filesize.KB = {0} kb - -dialog.About.title = About SWT FileViewer -dialog.About.description = SWT FileViewer\n\nVersion: 0.9\n\nRunning on: {0} - -dialog.NotImplemented.title = Not Implemented -dialog.ActionNotImplemented.description = Sorry! The action you selected has not been implemented. - -dialog.FailedCopy.title = Copy Files Error -dialog.FailedCopy.description = An error occured while trying to copy "{0}" to "{1}". - -dialog.FailedDelete.title = Delete Files Error -dialog.FailedDelete.description = An error occured while trying to delete "{0}". - -progressDialog.cancelButton.text = Cancel -progressDialog.Copy.title = Copy Files -progressDialog.Copy.description = Copying files. -progressDialog.Copy.operation = Copying... {0} -progressDialog.Move.title = Move Files -progressDialog.Move.description = Moving files. -progressDialog.Delete.operation = Deleting... {0} - -simulate.CopyFromTo.text = Simulated copy from "{0}" to "{1}". -simulate.DirectoriesCreated.text = Simulated directories created for "{0}". -simulate.Delete.text = Simulated delete of "{0}". - -error.FailedLaunch.message = Could not launch "{0}" diff --git a/examples/org.eclipse.swt.examples/src/examples_helloworld.properties b/examples/org.eclipse.swt.examples/src/examples_helloworld.properties deleted file mode 100644 index a8cb9f6f92..0000000000 --- a/examples/org.eclipse.swt.examples/src/examples_helloworld.properties +++ /dev/null @@ -1,11 +0,0 @@ -############################################################################### -# Copyright (c) 2000, 2003 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are 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 -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -Hello_world = Hello World \ No newline at end of file diff --git a/examples/org.eclipse.swt.examples/src/examples_hoverhelp.properties b/examples/org.eclipse.swt.examples/src/examples_hoverhelp.properties deleted file mode 100644 index 69300e3367..0000000000 --- a/examples/org.eclipse.swt.examples/src/examples_hoverhelp.properties +++ /dev/null @@ -1,26 +0,0 @@ -############################################################################### -# Copyright (c) 2000, 2003 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are 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 -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -error.CouldNotLoadResources = Unable to load resources : {0} - -ToolItem.text = ToolItem {0} -ToolItem.tooltip = Tooltip for {0}. Try F1 on me. -ToolItem.help = Help text for {0}. - -TableItem.text = TableItem {0} -TableItem.tooltip = Tooltip for {0}. Try F1 on me. -TableItem.help = Help text for {0}. - -TreeItem.text = TreeItem {0} -TreeItem.tooltip = Tooltip for {0}. Try F1 on me. -TreeItem.help = Help text for {0}. - -Hello.text = Hello -Hello.tooltip = Greetings! diff --git a/examples/org.eclipse.swt.examples/src/examples_images.properties b/examples/org.eclipse.swt.examples/src/examples_images.properties deleted file mode 100644 index 859d256e7d..0000000000 --- a/examples/org.eclipse.swt.examples/src/examples_images.properties +++ /dev/null @@ -1,111 +0,0 @@ -############################################################################### -# Copyright (c) 2000, 2003 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are 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 -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -Image_analyzer = Image Analyzer -None = None -White = White -Black = Black -Red = Red -Green = Green -Blue = Blue -X_scale = X Scale -Y_scale = Y Scale -Alpha_K = Alpha-K -Display = Display -Incremental = Incremental -Transparent = Transparent -Transparent_lc = transparent -Mask = Mask -Background = Background -Animation = Animation -Previous = < &Previous -Next = &Next > -Animate = &Animate -Type_initial = Type: -Type_string = Type: {0} -Type_index = Type: {0} [{1,number,integer} of {2,number,integer}] -Size_initial = Size: -Size_value = Size: {0,number,integer} x {1,number,integer} -Depth_initial = Depth: -Depth_value = Depth: {0} -Transparent_pixel_initial = Transparent pixel: -Transparent_pixel_value = Transparent pixel: {0} -Time_to_load_initial = Time to load: -Time_to_load_value = Time to load: {0} ms -Animation_size_initial = Animation size: -Animation_size_value = Animation size: {0,number,integer} x {1,number,integer} -Background_pixel_initial = Background pixel: -Background_pixel_value = Background pixel: {0} -Image_location_initial = Image location: -Image_location_value = Image location: ({0,number,integer}, {1,number,integer}) -Disposal_initial = Disposal: -Disposal_value = Disposal: {0,number,integer} ({1}) -Delay_initial = Delay: -Delay_value = Delay: {0,number,integer} ms (using {1,number,integer} ms) -Delay_used = Delay: {0,number,integer} ms -Repeats_initial = Repeats: -Repeats_value = Repeats: {0,number,integer} -Repeats_forever = Repeats: {0,number,integer} (forever) -Palette_initial = Palette: -Palette_direct = Palette: Direct -Palette_value = Palette size: {0,number,integer} -Pixel_data_initial = Pixel data: -Pixel_data_value = Pixel data: Bytes per line: {0,number,integer} \ - Scanline pad: {1,number,integer} {2} -File = &File -OpenFile = &Open File...\tCtrl+O -OpenURL = Open &URL...\tCtrl+U -Reopen = &Reopen -Save = &Save\tCtrl+S -Save_as = Save &As... -Save_mask_as = Save &Mask As... -Print = &Print\tCtrl+P -Exit = E&xit -Alpha = Alpha -OpenURLDialog = Open URL -EnterURL = Enter the URL for an image (bmp, gif, ico, jpg, jpeg, png): -All_images = All Image Files -Loading_lc = loading -Saving_lc = saving -Unknown_extension = Unknown file extension: {0}\nPlease use bmp, gif, ico, \ - jpg, jpeg, or png. -Overwrite = Overwrite {0}? -Analyzer_on = Image Analyzer on: {0} -Reloading_lc = reloading -Color_at = Image color at ({0,number,integer}, {1,number,integer}) \ - index {2,number,integer} (0x{3}) is {4} -Color_at_trans = Image color at ({0,number,integer}, {1,number,integer}) \ - index {2,number,integer} (0x{3}) is {4} (transparent) -Creating_image = Creating image # {0,number,integer} from -OK = OK -Cancel = Cancel -Stop = &Stop -Creating_from = Creating image read from -Palette_direct = Palette: Direct -Palette_size = Palette size: {0,number,integer} -Bytes_per_line = Bytes per line: -Scanline_pad = Scanline pad: -Printing_error = Printing error: -Error = Error {0} file\n{1}\n\n -Pixels_per_byte = pixels per byte -Byte_per_pixel = byte per pixel -Bytes_per_pixel = bytes per pixel -Unsupported_lc = unsupported -None_lc = none -Background_lc = background -Previous_lc = previous -Unspecified_lc = unspecified -Unknown_ac = UNKNOWN -Forever_lc = forever -Depth_info = Depth: {0,number,integer} -- {1} -One_byte = 1 byte per pixel -Multi_bytes = {0,number,integer} bytes per pixel -Multi_pixels = {0,number,integer} pixels per byte {1} -Max_length_string = Transparent pixel: -1 (none) \ No newline at end of file diff --git a/examples/org.eclipse.swt.examples/src/examples_javaviewer.properties b/examples/org.eclipse.swt.examples/src/examples_javaviewer.properties deleted file mode 100644 index c877154c3c..0000000000 --- a/examples/org.eclipse.swt.examples/src/examples_javaviewer.properties +++ /dev/null @@ -1,17 +0,0 @@ -############################################################################### -# Copyright (c) 2000, 2003 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are 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 -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -Open_menuitem=&Open...\tCtrl+O -Exit_menuitem=E&xit -File_menuitem=&File -Window_title=SWT Java Viewer -Err_file_no_exist=File {0} does not exist. -Err_file_io=IO error reading file:\n{0} -Err_file_not_found=File not found:\n{0} \ No newline at end of file diff --git a/examples/org.eclipse.swt.examples/src/examples_layout.properties b/examples/org.eclipse.swt.examples/src/examples_layout.properties deleted file mode 100644 index 5e01c8f801..0000000000 --- a/examples/org.eclipse.swt.examples/src/examples_layout.properties +++ /dev/null @@ -1,51 +0,0 @@ -############################################################################### -# Copyright (c) 2000, 2003 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are 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 -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -window.title = SWT Layouts - -Add = &Add -Delete = &Delete -Clear = &Clear -Children = Children -Type = Type -Layout = Layout -Preferred_Size = Preferred Size -Code = C&ode -Generated_Code = Generated Code -Parameters = Parameters -Properties = Properties -Margins = Margins -Margins_Spacing = Margins and Spacing -Columns = Columns -Attach_Edit = Edit -Left_Attachment = Edit Left Attachment -Right_Attachment = Edit Right Attachment -Top_Attachment = Edit Top Attachment -Bottom_Attachment = Edit Bottom Attachment -Position = Position -Control = Control -Offset = Offset [+/-] -Item = Item {0} -Combo_Index = Combo {0} -Group_Index = Group {0} -Label_Index = Label {0} -Button_Index = Button {0} -StyledText_Index = StyledText {0} -Text_Index = Text {0} -OK = OK -Cancel = Cancel -Edit = &Edit -Select_All = Select &All\tCtrl+A -Copy = &Copy\tCtrl+C -Exit = E&xit -Name_Title = Enter Names -Name_Label = Enter names for your controls -Invalid_Name = Invalid Name - Please enter valid variable names for your controls -Default = Default \ No newline at end of file diff --git a/examples/org.eclipse.swt.examples/src/examples_texteditor.properties b/examples/org.eclipse.swt.examples/src/examples_texteditor.properties deleted file mode 100644 index b66d829d95..0000000000 --- a/examples/org.eclipse.swt.examples/src/examples_texteditor.properties +++ /dev/null @@ -1,18 +0,0 @@ -############################################################################### -# Copyright (c) 2000, 2003 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are 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 -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -Exit_menuitem=E&xit -Cut_menuitem=Cu&t\tCtrl+X -Copy_menuitem=&Copy\tCtrl+C -Paste_menuitem=&Paste\tCtrl+V -Window_title=SWT Text Editor -Font_menuitem=Set &Font... -Edit_menuitem=&Edit -File_menuitem=&File \ No newline at end of file diff --git a/examples/org.eclipse.swt.examples/src/import.properties b/examples/org.eclipse.swt.examples/src/import.properties deleted file mode 100644 index 6f750b8e34..0000000000 --- a/examples/org.eclipse.swt.examples/src/import.properties +++ /dev/null @@ -1,26 +0,0 @@ -############################################################################### -# Copyright (c) 2000, 2003 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are 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 -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -# Persist project settings for later import -natures = org.eclipse.jdt.core.javanature; org.eclipse.pde.PluginNature -builders = org.eclipse.jdt.core.javabuilder; org.eclipse.pde.ManifestBuilder; org.eclipse.pde.SchemaBuilder -var.ECLIPSE_PLUGINS = <> -vmargs.org/eclipse/swt/examples/addressbook/AddressBook.java%AddressBook = "-Djava.library.path=<>" -vmargs.org/eclipse/swt/examples/controlexample/ControlExample.java%ControlExample = "-Djava.library.path=<>" -vmargs.org/eclipse/swt/examples/fileviewer/FileViewer.java%FileViewer = "-Djava.library.path=<>" -vmargs.org/eclipse/swt/examples/helloworld/HelloWorld1.java%HelloWorld1 = "-Djava.library.path=<>" -vmargs.org/eclipse/swt/examples/helloworld/HelloWorld2.java%HelloWorld2 = "-Djava.library.path=<>" -vmargs.org/eclipse/swt/examples/helloworld/HelloWorld3.java%HelloWorld3 = "-Djava.library.path=<>" -vmargs.org/eclipse/swt/examples/helloworld/HelloWorld4.java%HelloWorld4 = "-Djava.library.path=<>" -vmargs.org/eclipse/swt/examples/helloworld/HelloWorld5.java%HelloWorld5 = "-Djava.library.path=<>" -vmargs.org/eclipse/swt/examples/hoverhelp/HoverHelp.java%HoverHelp = "-Djava.library.path=<>" -vmargs.org/eclipse/swt/examples/imageanalyzer/ImageAnalyzer.java%ImageAnalyzer = "-Djava.library.path=<>" -vmargs.org/eclipse/swt/examples/javaviewer/JavaViewer.java%JavaViewer = "-Djava.library.path=<>" -vmargs.org/eclipse/swt/examples/texteditor/TextEditor.java%TextEditor = "-Djava.library.path=<>" diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/AddressBook.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/AddressBook.java deleted file mode 100755 index f73fa4e80e..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/AddressBook.java +++ /dev/null @@ -1,873 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.examples.addressbook; - - -/* Imports */ -import java.io.*; -import java.util.*; - -import org.eclipse.swt.*; -import org.eclipse.swt.events.*; -import org.eclipse.swt.graphics.*; -import org.eclipse.swt.layout.*; -import org.eclipse.swt.widgets.*; - -/** - * AddressBookExample is an example that uses org.eclipse.swt - * libraries to implement a simple address book. This application has - * save, load, sorting, and searching functions common - * to basic address books. - */ -public class AddressBook { - - private static ResourceBundle resAddressBook = ResourceBundle.getBundle("examples_addressbook"); - private Shell shell; - - private Table table; - private SearchDialog searchDialog; - - private File file; - private boolean isModified; - - private String[] copyBuffer; - - private int lastSortColumn= -1; - - private static final String DELIMITER = "\t"; - private static final String[] columnNames = {resAddressBook.getString("Last_name"), - resAddressBook.getString("First_name"), - resAddressBook.getString("Business_phone"), - resAddressBook.getString("Home_phone"), - resAddressBook.getString("Email"), - resAddressBook.getString("Fax")}; - -public static void main(String[] args) { - Display display = new Display(); - AddressBook application = new AddressBook(); - Shell shell = application.open(display); - while(!shell.isDisposed()){ - if(!display.readAndDispatch()) - display.sleep(); - } - display.dispose(); -} -public Shell open(Display display) { - shell = new Shell(display); - shell.setLayout(new FillLayout()); - shell.addShellListener(new ShellAdapter() { - public void shellClosed(ShellEvent e) { - e.doit = closeAddressBook(); - } - }); - - createMenuBar(); - - searchDialog = new SearchDialog(shell); - searchDialog.setSearchAreaNames(columnNames); - searchDialog.setSearchAreaLabel(resAddressBook.getString("Column")); - searchDialog.addFindListener(new FindListener () { - public boolean find() { - return findEntry(); - } - }); - - table = new Table(shell, SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION); - table.setHeaderVisible(true); - table.setMenu(createPopUpMenu()); - table.addSelectionListener(new SelectionAdapter() { - public void widgetDefaultSelected(SelectionEvent e) { - TableItem[] items = table.getSelection(); - if (items.length > 0) editEntry(items[0]); - } - }); - for(int i = 0; i < columnNames.length; i++) { - TableColumn column = new TableColumn(table, SWT.NONE); - column.setText(columnNames[i]); - column.setWidth(150); - final int columnIndex = i; - column.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - sort(columnIndex); - } - }); - } - - newAddressBook(); - - shell.setSize(table.computeSize(SWT.DEFAULT, SWT.DEFAULT).x, 300); - shell.open(); - return shell; -} - -private boolean closeAddressBook() { - if(isModified) { - //ask user if they want to save current address book - MessageBox box = new MessageBox(shell, SWT.ICON_WARNING | SWT.YES | SWT.NO | SWT.CANCEL); - box.setText(shell.getText()); - box.setMessage(resAddressBook.getString("Close_save")); - - int choice = box.open(); - if(choice == SWT.CANCEL) { - return false; - } else if(choice == SWT.YES) { - if (!save()) return false; - } - } - - TableItem[] items = table.getItems(); - for (int i = 0; i < items.length; i ++) { - items[i].dispose(); - } - - return true; -} -/** - * Creates the menu at the top of the shell where most - * of the programs functionality is accessed. - * - * @return The Menu widget that was created - */ -private Menu createMenuBar() { - Menu menuBar = new Menu(shell, SWT.BAR); - shell.setMenuBar(menuBar); - - //create each header and subMenu for the menuBar - createFileMenu(menuBar); - createEditMenu(menuBar); - createSearchMenu(menuBar); - createHelpMenu(menuBar); - - return menuBar; -} - -/** - * Converts an encoded String to a String array representing a table entry. - */ -private String[] decodeLine(String line) { - if(line == null) return null; - - String[] parsedLine = new String[table.getColumnCount()]; - for(int i = 0; i < parsedLine.length - 1; i++) { - int index = line.indexOf(DELIMITER); - if (index > -1) { - parsedLine[i] = line.substring(0, index); - line = line.substring(index + DELIMITER.length(), line.length()); - } else { - return null; - } - } - - if (line.indexOf(DELIMITER) != -1) return null; - - parsedLine[parsedLine.length - 1] = line; - - return parsedLine; -} -private void displayError(String msg) { - MessageBox box = new MessageBox(shell, SWT.ICON_ERROR); - box.setMessage(msg); - box.open(); -} -private void editEntry(TableItem item) { - DataEntryDialog dialog = new DataEntryDialog(shell); - dialog.setLabels(columnNames); - String[] values = new String[table.getColumnCount()]; - for (int i = 0; i < values.length; i++) { - values[i] = item.getText(i); - } - dialog.setValues(values); - values = dialog.open(); - if (values != null) { - item.setText(values); - isModified = true; - } -} -private String encodeLine(String[] tableItems) { - String line = ""; - for (int i = 0; i < tableItems.length - 1; i++) { - line += tableItems[i] + DELIMITER; - } - line += tableItems[tableItems.length - 1] + "\n"; - - return line; -} -private boolean findEntry() { - Cursor waitCursor = new Cursor(shell.getDisplay(), SWT.CURSOR_WAIT); - shell.setCursor(waitCursor); - - boolean matchCase = searchDialog.getMatchCase(); - boolean matchWord = searchDialog.getMatchWord(); - String searchString = searchDialog.getSearchString(); - int column = searchDialog.getSelectedSearchArea(); - - searchString = matchCase ? searchString : searchString.toLowerCase(); - - boolean found = false; - if (searchDialog.getSearchDown()) { - for(int i = table.getSelectionIndex() + 1; i < table.getItemCount(); i++) { - if (found = findMatch(searchString, table.getItem(i), column, matchWord, matchCase)){ - table.setSelection(i); - break; - } - } - } else { - for(int i = table.getSelectionIndex() - 1; i > -1; i--) { - if (found = findMatch(searchString, table.getItem(i), column, matchWord, matchCase)){ - table.setSelection(i); - break; - } - } - } - - shell.setCursor(null); - if (waitCursor != null) - waitCursor.dispose(); - - return found; -} -private boolean findMatch(String searchString, TableItem item, int column, boolean matchWord, boolean matchCase) { - - String tableText = matchCase ? item.getText(column) : item.getText(column).toLowerCase(); - if (matchWord) { - if (tableText != null && tableText.equals(searchString)) { - return true; - } - - } else { - if(tableText!= null && tableText.indexOf(searchString) != -1) { - return true; - } - } - return false; -} -private void newAddressBook() { - shell.setText(resAddressBook.getString("Title_bar") + resAddressBook.getString("New_title")); - file = null; - isModified = false; -} -private void newEntry() { - DataEntryDialog dialog = new DataEntryDialog(shell); - dialog.setLabels(columnNames); - String[] data = dialog.open(); - if (data != null) { - TableItem item = new TableItem(table, SWT.NONE); - item.setText(data); - isModified = true; - } -} - -private void openAddressBook() { - FileDialog fileDialog = new FileDialog(shell, SWT.OPEN); - - fileDialog.setFilterExtensions(new String[] {"*.adr;", "*.*"}); - fileDialog.setFilterNames(new String[] {resAddressBook.getString("Book_filter_name") + " (*.adr)", - resAddressBook.getString("All_filter_name") + " (*.*)"}); - String name = fileDialog.open(); - - if(name == null) return; - File file = new File(name); - if (!file.exists()) { - displayError(resAddressBook.getString("File")+file.getName()+" "+resAddressBook.getString("Does_not_exist")); - return; - } - - Cursor waitCursor = new Cursor(shell.getDisplay(), SWT.CURSOR_WAIT); - shell.setCursor(waitCursor); - - FileReader fileReader = null; - BufferedReader bufferedReader = null; - String[] data = new String[0]; - try { - fileReader = new FileReader(file.getAbsolutePath()); - bufferedReader = new BufferedReader(fileReader); - String nextLine = bufferedReader.readLine(); - while (nextLine != null){ - String[] newData = new String[data.length + 1]; - System.arraycopy(data, 0, newData, 0, data.length); - newData[data.length] = nextLine; - data = newData; - nextLine = bufferedReader.readLine(); - } - } catch(FileNotFoundException e) { - displayError(resAddressBook.getString("File_not_found") + "\n" + file.getName()); - return; - } catch (IOException e ) { - displayError(resAddressBook.getString("IO_error_read") + "\n" + file.getName()); - return; - } finally { - - shell.setCursor(null); - waitCursor.dispose(); - - if(fileReader != null) { - try { - fileReader.close(); - } catch(IOException e) { - displayError(resAddressBook.getString("IO_error_close") + "\n" + file.getName()); - return; - } - } - } - - String[][] tableInfo = new String[data.length][table.getColumnCount()]; - for (int i = 0; i < data.length; i++) { - tableInfo[i] = decodeLine(data[i]); - } - - Arrays.sort(tableInfo, new RowComparator(0)); - - for (int i = 0; i < tableInfo.length; i++) { - TableItem item = new TableItem(table, SWT.NONE); - item.setText(tableInfo[i]); - } - shell.setText(resAddressBook.getString("Title_bar")+fileDialog.getFileName()); - isModified = false; - this.file = file; -} -private boolean save() { - if(file == null) return saveAs(); - - Cursor waitCursor = new Cursor(shell.getDisplay(), SWT.CURSOR_WAIT); - shell.setCursor(waitCursor); - - TableItem[] items = table.getItems(); - String[] lines = new String[items.length]; - for(int i = 0; i < items.length; i++) { - String[] itemText = new String[table.getColumnCount()]; - for (int j = 0; j < itemText.length; j++) { - itemText[j] = items[i].getText(j); - } - lines[i] = encodeLine(itemText); - } - - FileWriter fileWriter = null; - try { - fileWriter = new FileWriter(file.getAbsolutePath(), false); - for (int i = 0; i < lines.length; i++) { - fileWriter.write(lines[i]); - } - } catch(FileNotFoundException e) { - displayError(resAddressBook.getString("File_not_found") + "\n" + file.getName()); - return false; - } catch(IOException e ) { - displayError(resAddressBook.getString("IO_error_write") + "\n" + file.getName()); - return false; - } finally { - shell.setCursor(null); - waitCursor.dispose(); - - if(fileWriter != null) { - try { - fileWriter.close(); - } catch(IOException e) { - displayError(resAddressBook.getString("IO_error_close") + "\n" + file.getName()); - return false; - } - } - } - - shell.setText(resAddressBook.getString("Title_bar")+file.getName()); - isModified = false; - return true; -} -private boolean saveAs() { - - FileDialog saveDialog = new FileDialog(shell, SWT.SAVE); - saveDialog.setFilterExtensions(new String[] {"*.adr;", "*.*"}); - saveDialog.setFilterNames(new String[] {"Address Books (*.adr)", "All Files "}); - - saveDialog.open(); - String name = saveDialog.getFileName(); - - if(name.equals("")) return false; - - if(name.indexOf(".adr") != name.length() - 4) { - name += ".adr"; - } - - File file = new File(saveDialog.getFilterPath(), name); - if(file.exists()) { - MessageBox box = new MessageBox(shell, SWT.ICON_WARNING | SWT.YES | SWT.NO); - box.setText(resAddressBook.getString("Save_as_title")); - box.setMessage(resAddressBook.getString("File") + file.getName()+" "+resAddressBook.getString("Query_overwrite")); - if(box.open() != SWT.YES) { - return false; - } - } - this.file = file; - return save(); -} -private void sort(int column) { - if(table.getItemCount() <= 1) return; - - TableItem[] items = table.getItems(); - String[][] data = new String[items.length][table.getColumnCount()]; - for(int i = 0; i < items.length; i++) { - for(int j = 0; j < table.getColumnCount(); j++) { - data[i][j] = items[i].getText(j); - } - } - - Arrays.sort(data, new RowComparator(column)); - - if (lastSortColumn != column) { - for (int i = 0; i < data.length; i++) { - items[i].setText(data[i]); - } - lastSortColumn = column; - } else { - // reverse order if the current column is selected again - int j = data.length -1; - for (int i = 0; i < data.length; i++) { - items[i].setText(data[j--]); - } - lastSortColumn = -1; - } - -} -/** - * Creates all the items located in the File submenu and - * associate all the menu items with their appropriate - * functions. - * - * @param menuBar Menu - * the Menu that file contain - * the File submenu. - */ -private void createFileMenu(Menu menuBar) { - //File menu. - MenuItem item = new MenuItem(menuBar, SWT.CASCADE); - item.setText(resAddressBook.getString("File_menu_title")); - Menu menu = new Menu(shell, SWT.DROP_DOWN); - item.setMenu(menu); - /** - * Adds a listener to handle enabling and disabling - * some items in the Edit submenu. - */ - menu.addMenuListener(new MenuAdapter() { - public void menuShown(MenuEvent e) { - Menu menu = (Menu)e.widget; - MenuItem[] items = menu.getItems(); - items[1].setEnabled(table.getSelectionCount() != 0); // edit contact - items[5].setEnabled((file != null) && isModified); // save - items[6].setEnabled(table.getItemCount() != 0); // save as - } - }); - - - //File -> New Contact - MenuItem subItem = new MenuItem(menu, SWT.NULL); - subItem.setText(resAddressBook.getString("New_contact")); - subItem.setAccelerator(SWT.MOD1 + 'N'); - subItem.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - newEntry(); - } - }); - subItem = new MenuItem(menu, SWT.NULL); - subItem.setText(resAddressBook.getString("Edit_contact")); - subItem.setAccelerator(SWT.MOD1 + 'E'); - subItem.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - TableItem[] items = table.getSelection(); - if (items.length == 0) return; - editEntry(items[0]); - } - }); - - - new MenuItem(menu, SWT.SEPARATOR); - - //File -> New Address Book - subItem = new MenuItem(menu, SWT.NULL); - subItem.setText(resAddressBook.getString("New_address_book")); - subItem.setAccelerator(SWT.MOD1 + 'B'); - subItem.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - if (closeAddressBook()) { - newAddressBook(); - } - } - }); - - //File -> Open - subItem = new MenuItem(menu, SWT.NULL); - subItem.setText(resAddressBook.getString("Open_address_book")); - subItem.setAccelerator(SWT.MOD1 + 'O'); - subItem.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - if (closeAddressBook()) { - openAddressBook(); - } - } - }); - - //File -> Save. - subItem = new MenuItem(menu, SWT.NULL); - subItem.setText(resAddressBook.getString("Save_address_book")); - subItem.setAccelerator(SWT.MOD1 + 'S'); - subItem.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - save(); - } - }); - - //File -> Save As. - subItem = new MenuItem(menu, SWT.NULL); - subItem.setText(resAddressBook.getString("Save_book_as")); - subItem.setAccelerator(SWT.MOD1 + 'A'); - subItem.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - saveAs(); - } - }); - - - new MenuItem(menu, SWT.SEPARATOR); - - //File -> Exit. - subItem = new MenuItem(menu, SWT.NULL); - subItem.setText(resAddressBook.getString("Exit")); - subItem.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - shell.close(); - } - }); -} - -/** - * Creates all the items located in the Edit submenu and - * associate all the menu items with their appropriate - * functions. - * - * @param menuBar Menu - * the Menu that file contain - * the Edit submenu. - * - * @see #createSortMenu() - */ -private MenuItem createEditMenu(Menu menuBar) { - //Edit menu. - MenuItem item = new MenuItem(menuBar, SWT.CASCADE); - item.setText(resAddressBook.getString("Edit_menu_title")); - Menu menu = new Menu(shell, SWT.DROP_DOWN); - item.setMenu(menu); - - /** - * Add a listener to handle enabling and disabling - * some items in the Edit submenu. - */ - menu.addMenuListener(new MenuAdapter() { - public void menuShown(MenuEvent e) { - Menu menu = (Menu)e.widget; - MenuItem[] items = menu.getItems(); - int count = table.getSelectionCount(); - items[0].setEnabled(count != 0); // edit - items[1].setEnabled(count != 0); // copy - items[2].setEnabled(copyBuffer != null); // paste - items[3].setEnabled(count != 0); // delete - items[5].setEnabled(table.getItemCount() != 0); // sort - } - }); - - //Edit -> Edit - MenuItem subItem = new MenuItem(menu, SWT.CASCADE); - subItem.setText(resAddressBook.getString("Edit")); - subItem.setAccelerator(SWT.MOD1 + 'E'); - subItem.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - TableItem[] items = table.getSelection(); - if (items.length == 0) return; - editEntry(items[0]); - } - }); - - //Edit -> Copy - subItem = new MenuItem(menu, SWT.NULL); - subItem.setText(resAddressBook.getString("Copy")); - subItem.setAccelerator(SWT.MOD1 + 'C'); - subItem.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - TableItem[] items = table.getSelection(); - if (items.length == 0) return; - copyBuffer = new String[table.getColumnCount()]; - for (int i = 0; i < copyBuffer.length; i++) { - copyBuffer[i] = items[0].getText(i); - } - } - }); - - //Edit -> Paste - subItem = new MenuItem(menu, SWT.NULL); - subItem.setText(resAddressBook.getString("Paste")); - subItem.setAccelerator(SWT.MOD1 + 'V'); - subItem.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - if (copyBuffer == null) return; - TableItem item = new TableItem(table, SWT.NONE); - item.setText(copyBuffer); - isModified = true; - } - }); - - //Edit -> Delete - subItem = new MenuItem(menu, SWT.NULL); - subItem.setText(resAddressBook.getString("Delete")); - subItem.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - TableItem[] items = table.getSelection(); - if (items.length == 0) return; - items[0].dispose(); - isModified = true; } - }); - - new MenuItem(menu, SWT.SEPARATOR); - - //Edit -> Sort(Cascade) - subItem = new MenuItem(menu, SWT.CASCADE); - subItem.setText(resAddressBook.getString("Sort")); - Menu submenu = createSortMenu(); - subItem.setMenu(submenu); - - return item; - -} - -/** - * Creates all the items located in the Sort cascading submenu and - * associate all the menu items with their appropriate - * functions. - * - * @return Menu - * The cascading menu with all the sort menu items on it. - */ -private Menu createSortMenu() { - Menu submenu = new Menu(shell, SWT.DROP_DOWN); - MenuItem subitem; - for(int i = 0; i < columnNames.length; i++) { - subitem = new MenuItem (submenu, SWT.NULL); - subitem.setText(columnNames [i]); - final int column = i; - subitem.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - sort(column); - } - }); - - } - - return submenu; -} - -/** - * Creates all the items located in the Search submenu and - * associate all the menu items with their appropriate - * functions. - * - * @param menuBar Menu - * the Menu that file contain - * the Search submenu. - */ -private void createSearchMenu(Menu menuBar) { - //Search menu. - MenuItem item = new MenuItem(menuBar, SWT.CASCADE); - item.setText(resAddressBook.getString("Search_menu_title")); - Menu searchMenu = new Menu(shell, SWT.DROP_DOWN); - item.setMenu(searchMenu); - - //Search -> Find... - item = new MenuItem(searchMenu, SWT.NULL); - item.setText(resAddressBook.getString("Find")); - item.setAccelerator(SWT.MOD1 + 'F'); - item.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - searchDialog.setMatchCase(false); - searchDialog.setMatchWord(false); - searchDialog.setSearchDown(true); - searchDialog.setSearchString(""); - searchDialog.setSelectedSearchArea(0); - searchDialog.open(); - } - }); - - //Search -> Find Next - item = new MenuItem(searchMenu, SWT.NULL); - item.setText(resAddressBook.getString("Find_next")); - item.setAccelerator(SWT.F3); - item.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - searchDialog.open(); - } - }); -} - -/** - * Creates all items located in the popup menu and associates - * all the menu items with their appropriate functions. - * - * @return Menu - * The created popup menu. - */ -private Menu createPopUpMenu() { - Menu popUpMenu = new Menu(shell, SWT.POP_UP); - - /** - * Adds a listener to handle enabling and disabling - * some items in the Edit submenu. - */ - popUpMenu.addMenuListener(new MenuAdapter() { - public void menuShown(MenuEvent e) { - Menu menu = (Menu)e.widget; - MenuItem[] items = menu.getItems(); - int count = table.getSelectionCount(); - items[2].setEnabled(count != 0); // edit - items[3].setEnabled(count != 0); // copy - items[4].setEnabled(copyBuffer != null); // paste - items[5].setEnabled(count != 0); // delete - items[7].setEnabled(table.getItemCount() != 0); // find - } - }); - - //New - MenuItem item = new MenuItem(popUpMenu, SWT.CASCADE); - item.setText(resAddressBook.getString("Pop_up_new")); - item.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - newEntry(); - } - }); - - new MenuItem(popUpMenu, SWT.SEPARATOR); - - //Edit - item = new MenuItem(popUpMenu, SWT.CASCADE); - item.setText(resAddressBook.getString("Pop_up_edit")); - item.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - TableItem[] items = table.getSelection(); - if (items.length == 0) return; - editEntry(items[0]); - } - }); - - //Copy - item = new MenuItem(popUpMenu, SWT.CASCADE); - item.setText(resAddressBook.getString("Pop_up_copy")); - item.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - TableItem[] items = table.getSelection(); - if (items.length == 0) return; - copyBuffer = new String[table.getColumnCount()]; - for (int i = 0; i < copyBuffer.length; i++) { - copyBuffer[i] = items[0].getText(i); - } - } - }); - - //Paste - item = new MenuItem(popUpMenu, SWT.CASCADE); - item.setText(resAddressBook.getString("Pop_up_paste")); - item.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - if (copyBuffer == null) return; - TableItem item = new TableItem(table, SWT.NONE); - item.setText(copyBuffer); - isModified = true; - } - }); - - //Delete - item = new MenuItem(popUpMenu, SWT.CASCADE); - item.setText(resAddressBook.getString("Pop_up_delete")); - item.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - TableItem[] items = table.getSelection(); - if (items.length == 0) return; - items[0].dispose(); - isModified = true; - } - }); - - new MenuItem(popUpMenu, SWT.SEPARATOR); - - //Find... - item = new MenuItem(popUpMenu, SWT.NULL); - item.setText(resAddressBook.getString("Pop_up_find")); - item.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - searchDialog.open(); - } - }); - - return popUpMenu; -} - -/** - * Creates all the items located in the Help submenu and - * associate all the menu items with their appropriate - * functions. - * - * @param menuBar Menu - * the Menu that file contain - * the Help submenu. - */ -private void createHelpMenu(Menu menuBar) { - - //Help Menu - MenuItem item = new MenuItem(menuBar, SWT.CASCADE); - item.setText(resAddressBook.getString("Help_menu_title")); - Menu menu = new Menu(shell, SWT.DROP_DOWN); - item.setMenu(menu); - - //Help -> About Text Editor - MenuItem subItem = new MenuItem(menu, SWT.NULL); - subItem.setText(resAddressBook.getString("About")); - subItem.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - MessageBox box = new MessageBox(shell, SWT.NONE); - box.setText(resAddressBook.getString("About_1") + shell.getText()); - box.setMessage(shell.getText() + resAddressBook.getString("About_2")); - box.open(); - } - }); -} - -/** - * To compare entries (rows) by the given column - */ -private class RowComparator implements Comparator { - private int column; - - /** - * Constructs a RowComparator given the column index - * @param col The index (starting at zero) of the column - */ - public RowComparator(int col) { - column = col; - } - - /** - * Compares two rows (type String[]) using the specified - * column entry. - * @param obj1 First row to compare - * @param obj2 Second row to compare - * @return negative if obj1 less than obj2, positive if - * obj1 greater than obj2, and zero if equal. - */ - public int compare(Object obj1, Object obj2) { - String[] row1 = (String[])obj1; - String[] row2 = (String[])obj2; - - return row1[column].compareTo(row2[column]); - } -} -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/DataEntryDialog.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/DataEntryDialog.java deleted file mode 100755 index 17b48660d7..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/DataEntryDialog.java +++ /dev/null @@ -1,163 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.examples.addressbook; - - -/* Imports */ -import org.eclipse.swt.*; -import org.eclipse.swt.events.*; -import org.eclipse.swt.layout.*; -import org.eclipse.swt.widgets.*; -import java.util.ResourceBundle; - -/** - * DataEntryDialog class uses org.eclipse.swt - * libraries to implement a dialog that accepts basic personal information that - * is added to a Table widget or edits a TableItem entry - * to represent the entered data. - */ -public class DataEntryDialog { - - private static ResourceBundle resAddressBook = ResourceBundle.getBundle("examples_addressbook"); - - Shell shell; - String[] values; - String[] labels; - -public DataEntryDialog(Shell parent) { - shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.PRIMARY_MODAL); - shell.setLayout(new GridLayout()); -} - -private void addTextListener(final Text text) { - text.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e){ - Integer index = (Integer)(text.getData("index")); - values[index.intValue()] = text.getText(); - } - }); -} -private void createControlButtons() { - Composite composite = new Composite(shell, SWT.NULL); - composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER)); - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - composite.setLayout(layout); - - Button okButton = new Button(composite, SWT.PUSH); - okButton.setText(resAddressBook.getString("OK")); - okButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - shell.close(); - } - }); - - Button cancelButton = new Button(composite, SWT.PUSH); - cancelButton.setText(resAddressBook.getString("Cancel")); - cancelButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - values = null; - shell.close(); - } - }); - - shell.setDefaultButton(okButton); -} - -private void createTextWidgets() { - if (labels == null) return; - - Composite composite = new Composite(shell, SWT.NULL); - composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - GridLayout layout= new GridLayout(); - layout.numColumns = 2; - composite.setLayout(layout); - - if (values == null) - values = new String[labels.length]; - - for (int i = 0; i < labels.length; i++) { - Label label = new Label(composite, SWT.RIGHT); - label.setText(labels[i]); - Text text = new Text(composite, SWT.BORDER); - GridData gridData = new GridData(); - gridData.widthHint = 400; - text.setLayoutData(gridData); - if (values[i] != null) { - text.setText(values[i]); - } - text.setData("index", new Integer(i)); - addTextListener(text); - } -} - -public String[] getLabels() { - return labels; -} -public String getTitle() { - return shell.getText(); -} -/** - * Returns the contents of the Text widgets in the dialog in a - * String array. - * - * @return String[] - * The contents of the text widgets of the dialog. - * May return null if all text widgets are empty. - */ -public String[] getValues() { - return values; -} -/** - * Opens the dialog in the given state. Sets Text widget contents - * and dialog behaviour accordingly. - * - * @param dialogState int - * The state the dialog should be opened in. - */ -public String[] open() { - createTextWidgets(); - createControlButtons(); - shell.pack(); - shell.open(); - Display display = shell.getDisplay(); - while(!shell.isDisposed()){ - if(!display.readAndDispatch()) - display.sleep(); - } - - return getValues(); -} -public void setLabels(String[] labels) { - this.labels = labels; -} -public void setTitle(String title) { - shell.setText(title); -} -/** - * Sets the values of the Text widgets of the dialog to - * the values supplied in the parameter array. - * - * @param itemInfo String[] - * The values to which the dialog contents will be set. - */ -public void setValues(String[] itemInfo) { - if (labels == null) return; - - if (values == null) - values = new String[labels.length]; - - int numItems = Math.min(values.length, itemInfo.length); - for(int i = 0; i < numItems; i++) { - values[i] = itemInfo[i]; - } -} -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/FindListener.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/FindListener.java deleted file mode 100755 index 12ad2d796d..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/FindListener.java +++ /dev/null @@ -1,18 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.examples.addressbook; - - -public interface FindListener { - -public boolean find(); - -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/SearchDialog.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/SearchDialog.java deleted file mode 100755 index 0c42630f17..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/SearchDialog.java +++ /dev/null @@ -1,202 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.examples.addressbook; - - -/* Imports */ -import org.eclipse.swt.*; -import org.eclipse.swt.widgets.*; -import org.eclipse.swt.layout.*; -import org.eclipse.swt.events.*; -import java.util.ResourceBundle; - -/** - * SearchDialog is a simple class that uses org.eclipse.swt - * libraries to implement a basic search dialog. - */ -public class SearchDialog { - - private static ResourceBundle resAddressBook = ResourceBundle.getBundle("examples_addressbook"); - - Shell shell; - Text searchText; - Combo searchArea; - Label searchAreaLabel; - Button matchCase; - Button matchWord; - Button findButton; - Button down; - FindListener findHandler; - -/** - * Class constructor that sets the parent shell and the table widget that - * the dialog will search. - * - * @param parent Shell - * The shell that is the parent of the dialog. - */ -public SearchDialog(Shell parent) { - shell = new Shell(parent, SWT.CLOSE | SWT.BORDER | SWT.TITLE); - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - shell.setLayout(layout); - shell.setText(resAddressBook.getString("Search_dialog_title")); - shell.addShellListener(new ShellAdapter(){ - public void shellClosed(ShellEvent e) { - // don't dispose of the shell, just hide it for later use - e.doit = false; - shell.setVisible(false); - } - }); - - Label label = new Label(shell, SWT.LEFT); - label.setText(resAddressBook.getString("Dialog_find_what")); - searchText = new Text(shell, SWT.BORDER); - GridData gridData = new GridData(GridData.FILL_HORIZONTAL); - gridData.widthHint = 200; - searchText.setLayoutData(gridData); - searchText.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - boolean enableFind = (searchText.getCharCount() != 0); - findButton.setEnabled(enableFind); - } - }); - - searchAreaLabel = new Label(shell, SWT.LEFT); - searchArea = new Combo(shell, SWT.DROP_DOWN | SWT.READ_ONLY); - gridData = new GridData(GridData.FILL_HORIZONTAL); - gridData.widthHint = 200; - searchArea.setLayoutData(gridData); - - matchCase = new Button(shell, SWT.CHECK); - matchCase.setText(resAddressBook.getString("Dialog_match_case")); - gridData = new GridData(); - gridData.horizontalSpan = 2; - matchCase.setLayoutData(gridData); - - matchWord = new Button(shell, SWT.CHECK); - matchWord.setText(resAddressBook.getString("Dialog_match_word")); - gridData = new GridData(); - gridData.horizontalSpan = 2; - matchWord.setLayoutData(gridData); - - Group direction = new Group(shell, SWT.NONE); - gridData = new GridData(); - gridData.horizontalSpan = 2; - direction.setLayoutData(gridData); - direction.setLayout (new FillLayout ()); - direction.setText(resAddressBook.getString("Dialog_direction")); - - Button up = new Button(direction, SWT.RADIO); - up.setText(resAddressBook.getString("Dialog_dir_up")); - up.setSelection(false); - - down = new Button(direction, SWT.RADIO); - down.setText(resAddressBook.getString("Dialog_dir_down")); - down.setSelection(true); - - Composite composite = new Composite(shell, SWT.NONE); - gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - gridData.horizontalSpan = 2; - composite.setLayoutData(gridData); - layout = new GridLayout(); - layout.numColumns = 2; - layout.makeColumnsEqualWidth = true; - composite.setLayout(layout); - - findButton = new Button(composite, SWT.PUSH); - findButton.setText(resAddressBook.getString("Dialog_find")); - findButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); - findButton.setEnabled(false); - findButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - if (!findHandler.find()){ - MessageBox box = new MessageBox(shell, SWT.ICON_INFORMATION | SWT.OK | SWT.PRIMARY_MODAL); - box.setText(shell.getText()); - box.setMessage(resAddressBook.getString("Cannot_find") + "\"" + searchText.getText() + "\""); - box.open(); - } - } - }); - - Button cancelButton = new Button(composite, SWT.PUSH); - cancelButton.setText(resAddressBook.getString("Cancel")); - cancelButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING)); - cancelButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - shell.setVisible(false); - } - }); - - shell.pack(); -} -public String getSearchAreaLabel(String label) { - return searchAreaLabel.getText(); -} - -public String[] getsearchAreaNames() { - return searchArea.getItems(); -} -public boolean getMatchCase() { - return matchCase.getSelection(); -} -public boolean getMatchWord() { - return matchWord.getSelection(); -} -public String getSearchString() { - return searchText.getText(); -} -public boolean getSearchDown(){ - return down.getSelection(); -} -public int getSelectedSearchArea() { - return searchArea.getSelectionIndex(); -} -public void open() { - if (shell.isVisible()) { - shell.setFocus(); - } else { - shell.open(); - } - searchText.setFocus(); -} -public void setSearchAreaNames(String[] names) { - for (int i = 0; i < names.length; i++) { - searchArea.add(names[i]); - } - searchArea.select(0); -} -public void setSearchAreaLabel(String label) { - searchAreaLabel.setText(label); -} -public void setMatchCase(boolean match) { - matchCase.setSelection(match); -} -public void setMatchWord(boolean match) { - matchWord.setSelection(match); -} -public void setSearchDown(boolean searchDown){ - down.setSelection(searchDown); -} -public void setSearchString(String searchString) { - searchText.setText(searchString); -} - -public void setSelectedSearchArea(int index) { - searchArea.select(index); -} -public void addFindListener(FindListener listener) { - this.findHandler = listener; -} -public void removeFindListener(FindListener listener) { - this.findHandler = null; -} -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/BrowserExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/BrowserExample.java deleted file mode 100644 index 3ab86486b4..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/BrowserExample.java +++ /dev/null @@ -1,318 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.examples.browserexample; - -import org.eclipse.swt.*; -import org.eclipse.swt.browser.*; -import org.eclipse.swt.graphics.*; -import org.eclipse.swt.layout.*; -import org.eclipse.swt.widgets.*; - -import java.text.*; -import java.util.*; - -public class BrowserExample { - static ResourceBundle resourceBundle = ResourceBundle.getBundle("examples_browser"); - int index; - boolean busy; - Image images[]; - Text location; - Browser browser; - static final String[] imageLocations = { - "eclipse01.bmp", "eclipse02.bmp", "eclipse03.bmp", "eclipse04.bmp", "eclipse05.bmp", - "eclipse06.bmp", "eclipse07.bmp", "eclipse08.bmp", "eclipse09.bmp", "eclipse10.bmp", - "eclipse11.bmp", "eclipse12.bmp",}; - -/** - * Creates an instance of a ControlExample embedded inside - * the supplied parent Composite. - * - * @param parent the container of the example - */ -public BrowserExample(Composite parent) { - initResources(); - final Display display = parent.getDisplay(); - FormLayout layout = new FormLayout(); - parent.setLayout(layout); - ToolBar toolbar = new ToolBar(parent, SWT.NONE); - final ToolItem itemBack = new ToolItem(toolbar, SWT.PUSH); - itemBack.setText(getResourceString("Back")); - final ToolItem itemForward = new ToolItem(toolbar, SWT.PUSH); - itemForward.setText(getResourceString("Forward")); - final ToolItem itemStop = new ToolItem(toolbar, SWT.PUSH); - itemStop.setText(getResourceString("Stop")); - final ToolItem itemRefresh = new ToolItem(toolbar, SWT.PUSH); - itemRefresh.setText(getResourceString("Refresh")); - final ToolItem itemGo = new ToolItem(toolbar, SWT.PUSH); - itemGo.setText(getResourceString("Go")); - - location = new Text(parent, SWT.BORDER); - - final Canvas canvas = new Canvas(parent, SWT.NO_BACKGROUND); - final Rectangle rect = images[0].getBounds(); - canvas.addListener(SWT.Paint, new Listener() { - public void handleEvent(Event e) { - Point pt = canvas.getSize(); - e.gc.drawImage(images[index], 0, 0, rect.width, rect.height, 0, 0, pt.x, pt.y); - } - }); - canvas.addListener(SWT.MouseDown, new Listener() { - public void handleEvent(Event e) { - browser.setUrl(getResourceString("Startup")); - } - }); - - display.asyncExec(new Runnable() { - public void run() { - if (canvas.isDisposed()) return; - if (busy) { - index++; - if (index == images.length) index = 0; - canvas.redraw(); - } - display.timerExec(150, this); - } - }); - - final Label status = new Label(parent, SWT.NONE); - final ProgressBar progressBar = new ProgressBar(parent, SWT.NONE); - - FormData data = new FormData(); - data.top = new FormAttachment(0, 5); - toolbar.setLayoutData(data); - - data = new FormData(); - data.left = new FormAttachment(0, 0); - data.right = new FormAttachment(100, 0); - data.top = new FormAttachment(canvas, 5, SWT.DEFAULT); - data.bottom = new FormAttachment(status, -5, SWT.DEFAULT); - try { - browser = new Browser(parent, SWT.NONE); - browser.setLayoutData(data); - } catch (SWTError e) { - /* Browser widget could not be instantiated */ - Label label = new Label(parent, SWT.CENTER | SWT.WRAP); - label.setText(getResourceString("BrowserNotCreated")); - label.setLayoutData(data); - } - - data = new FormData(); - data.width = 24; - data.height = 24; - data.top = new FormAttachment(0, 5); - data.right = new FormAttachment(100, -5); - canvas.setLayoutData(data); - - data = new FormData(); - data.top = new FormAttachment(toolbar, 0, SWT.TOP); - data.left = new FormAttachment(toolbar, 5, SWT.RIGHT); - data.right = new FormAttachment(canvas, -5, SWT.DEFAULT); - location.setLayoutData(data); - - data = new FormData(); - data.left = new FormAttachment(0, 5); - data.right = new FormAttachment(progressBar, 0, SWT.DEFAULT); - data.bottom = new FormAttachment(100, -5); - status.setLayoutData(data); - - data = new FormData(); - data.right = new FormAttachment(100, -5); - data.bottom = new FormAttachment(100, -5); - progressBar.setLayoutData(data); - - if (browser != null) { - Listener listener = new Listener() { - public void handleEvent(Event event) { - ToolItem item = (ToolItem)event.widget; - if (item == itemBack) browser.back(); - else if (item == itemForward) browser.forward(); - else if (item == itemStop) browser.stop(); - else if (item == itemRefresh) browser.refresh(); - else if (item == itemGo) browser.setUrl(location.getText()); - } - }; - browser.addProgressListener(new ProgressListener() { - public void changed(ProgressEvent event) { - if (event.total == 0) return; - int ratio = event.current * 100 / event.total; - progressBar.setSelection(ratio); - busy = event.current != event.total; - if (!busy) { - index = 0; - canvas.redraw(); - } - } - public void completed(ProgressEvent event) { - progressBar.setSelection(0); - busy = false; - index = 0; - canvas.redraw(); - } - }); - browser.addStatusTextListener(new StatusTextListener() { - public void changed(StatusTextEvent event) { - status.setText(event.text); - } - }); - browser.addLocationListener(new LocationListener() { - public void changed(LocationEvent event) { - busy = true; - location.setText(event.location); - } - public void changing(LocationEvent event) { - } - }); - itemBack.addListener(SWT.Selection, listener); - itemForward.addListener(SWT.Selection, listener); - itemStop.addListener(SWT.Selection, listener); - itemRefresh.addListener(SWT.Selection, listener); - itemGo.addListener(SWT.Selection, listener); - location.addListener(SWT.DefaultSelection, new Listener() { - public void handleEvent(Event e) { - browser.setUrl(location.getText()); - } - }); - - initialize(display, browser); - browser.setUrl(getResourceString("Startup")); - } -} - -/** - * Gets a string from the resource bundle. - * We don't want to crash because of a missing String. - * Returns the key if not found. - */ -static String getResourceString(String key) { - try { - return resourceBundle.getString(key); - } catch (MissingResourceException e) { - return key; - } catch (NullPointerException e) { - return "!" + key + "!"; - } -} - -/** - * Gets a string from the resource bundle and binds it - * with the given arguments. If the key is not found, - * return the key. - */ -static String getResourceString(String key, Object[] args) { - try { - return MessageFormat.format(getResourceString(key), args); - } catch (MissingResourceException e) { - return key; - } catch (NullPointerException e) { - return "!" + key + "!"; - } -} - -static void initialize(final Display display, Browser browser) { - browser.addOpenWindowListener(new OpenWindowListener() { - public void open(WindowEvent event) { - Shell shell = new Shell(display); - shell.setLayout(new FillLayout()); - Browser browser = new Browser(shell, SWT.NONE); - initialize(display, browser); - event.browser = browser; - } - }); - browser.addVisibilityWindowListener(new VisibilityWindowListener() { - public void hide(WindowEvent event) { - } - public void show(WindowEvent event) { - Browser browser = (Browser)event.widget; - Shell shell = browser.getShell(); - if (event.location != null) shell.setLocation(event.location); - if (event.size != null) { - Point size = event.size; - shell.setSize(shell.computeSize(size.x, size.y)); - } - shell.open(); - } - }); - browser.addCloseWindowListener(new CloseWindowListener() { - public void close(WindowEvent event) { - Browser browser = (Browser)event.widget; - Shell shell = browser.getShell(); - shell.close(); - } - }); -} - -/** - * Disposes of all resources associated with a particular - * instance of the BrowserExample. - */ -public void dispose() { - freeResources(); -} - -/** - * Frees the resources - */ -void freeResources() { - if (images != null) { - for (int i = 0; i < images.length; ++i) { - final Image image = images[i]; - if (image != null) image.dispose(); - } - images = null; - } -} - -/** - * Grabs input focus. - */ -public void setFocus() { - location.setFocus(); -} - -/** - * Loads the resources - */ -void initResources() { - final Class clazz = this.getClass(); - if (resourceBundle != null) { - try { - if (images == null) { - images = new Image[imageLocations.length]; - for (int i = 0; i < imageLocations.length; ++i) { - ImageData source = new ImageData(clazz.getResourceAsStream(imageLocations[i])); - ImageData mask = source.getTransparencyMask(); - images[i] = new Image(null, source, mask); - } - } - return; - } catch (Throwable t) { - } - } - String error = (resourceBundle != null) ? getResourceString("error.CouldNotLoadResources") : "Unable to load resources"; - freeResources(); - throw new RuntimeException(error); -} - -public static void main(String [] args) { - Display display = new Display(); - Shell shell = new Shell(display); - shell.setLayout(new FillLayout()); - BrowserExample instance = new BrowserExample(shell); - shell.setText(getResourceString("window.title")); - shell.open(); - while (!shell.isDisposed()) { - if (!display.readAndDispatch()) - display.sleep(); - } - instance.dispose(); - display.dispose(); -} -} \ No newline at end of file diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse01.bmp b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse01.bmp deleted file mode 100644 index 43116e6d8e..0000000000 Binary files a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse01.bmp and /dev/null differ diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse02.bmp b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse02.bmp deleted file mode 100644 index 8db04efb6b..0000000000 Binary files a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse02.bmp and /dev/null differ diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse03.bmp b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse03.bmp deleted file mode 100644 index 5fc7b1003c..0000000000 Binary files a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse03.bmp and /dev/null differ diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse04.bmp b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse04.bmp deleted file mode 100644 index 2140654bb2..0000000000 Binary files a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse04.bmp and /dev/null differ diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse05.bmp b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse05.bmp deleted file mode 100644 index 7e45a99b5b..0000000000 Binary files a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse05.bmp and /dev/null differ diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse06.bmp b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse06.bmp deleted file mode 100644 index aaa888a67f..0000000000 Binary files a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse06.bmp and /dev/null differ diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse07.bmp b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse07.bmp deleted file mode 100644 index 50e22225ba..0000000000 Binary files a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse07.bmp and /dev/null differ diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse08.bmp b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse08.bmp deleted file mode 100644 index b1ac29dc96..0000000000 Binary files a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse08.bmp and /dev/null differ diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse09.bmp b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse09.bmp deleted file mode 100644 index 561f830ffc..0000000000 Binary files a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse09.bmp and /dev/null differ diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse10.bmp b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse10.bmp deleted file mode 100644 index 6ae79b2df8..0000000000 Binary files a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse10.bmp and /dev/null differ diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse11.bmp b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse11.bmp deleted file mode 100644 index a0c24a6815..0000000000 Binary files a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse11.bmp and /dev/null differ diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse12.bmp b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse12.bmp deleted file mode 100644 index 1cae71cf7e..0000000000 Binary files a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/eclipse12.bmp and /dev/null differ diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/ClipboardExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/ClipboardExample.java deleted file mode 100644 index d7e9086fac..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/ClipboardExample.java +++ /dev/null @@ -1,370 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.examples.clipboard; - -import org.eclipse.swt.*; -import org.eclipse.swt.custom.*; -import org.eclipse.swt.dnd.*; -import org.eclipse.swt.events.*; -import org.eclipse.swt.layout.*; -import org.eclipse.swt.widgets.*; - -public class ClipboardExample { - - Clipboard clipboard; - Shell shell; - Text copyText; - Text pasteText; - Text copyRtfText; - Text pasteRtfText; - Table copyFileTable; - Table pasteFileTable; - Text text; - Combo combo; - StyledText styledText; - Label status; - static final int SIZE = 60; - -public static void main( String[] args) { - Display display = new Display(); - new ClipboardExample().open(display); - display.dispose(); -} -public void open(Display display) { - clipboard = new Clipboard(display); - shell = new Shell (display); - shell.setText("SWT Clipboard"); - shell.setLayout(new GridLayout(2, true)); - - Group copyGroup = new Group(shell, SWT.NONE); - copyGroup.setText("Copy From:"); - GridData data = new GridData(GridData.FILL_BOTH); - copyGroup.setLayoutData(data); - copyGroup.setLayout(new GridLayout(3, false)); - - Group pasteGroup = new Group(shell, SWT.NONE); - pasteGroup.setText("Paste To:"); - data = new GridData(GridData.FILL_BOTH); - pasteGroup.setLayoutData(data); - pasteGroup.setLayout(new GridLayout(3, false)); - - Group controlGroup = new Group(shell, SWT.NONE); - controlGroup.setText("Control API:"); - data = new GridData(GridData.FILL_BOTH); - data.horizontalSpan = 2; - controlGroup.setLayoutData(data); - controlGroup.setLayout(new GridLayout(5, false)); - - Group typesGroup = new Group(shell, SWT.NONE); - typesGroup.setText("Available Types"); - data = new GridData(GridData.FILL_BOTH); - data.horizontalSpan = 2; - typesGroup.setLayoutData(data); - typesGroup.setLayout(new GridLayout(2, false)); - - status = new Label(shell, SWT.BORDER); - data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 2; - data.heightHint = 60; - status.setLayoutData(data); - - createTextTransfer(copyGroup, pasteGroup); - createRTFTransfer(copyGroup, pasteGroup); - createFileTransfer(copyGroup, pasteGroup); - createMyTransfer(copyGroup, pasteGroup); - createControlTransfer(controlGroup); - createAvailableTypes(typesGroup); - - shell.pack(); - shell.open(); - while (!shell.isDisposed ()) { - if (!display.readAndDispatch ()) display.sleep (); - } - clipboard.dispose(); -} -void createTextTransfer(Composite copyParent, Composite pasteParent) { - - // TextTransfer - Label l = new Label(copyParent, SWT.NONE); - l.setText("TextTransfer:"); //$NON-NLS-1$ - copyText = new Text(copyParent, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); - copyText.setText("some\nplain\ntext"); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - data.heightHint = data.widthHint = SIZE; - copyText.setLayoutData(data); - Button b = new Button(copyParent, SWT.PUSH); - b.setText("Copy"); - b.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - String data = copyText.getText(); - if (data.length() > 0) { - status.setText(""); - clipboard.setContents(new Object[] {data}, new Transfer[] {TextTransfer.getInstance()}); - } else { - status.setText("nothing to copy"); - } - } - }); - - l = new Label(pasteParent, SWT.NONE); - l.setText("TextTransfer:"); //$NON-NLS-1$ - pasteText = new Text(pasteParent, SWT.READ_ONLY | SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); - data = new GridData(GridData.FILL_HORIZONTAL); - data.heightHint = data.widthHint = SIZE; - pasteText.setLayoutData(data); - b = new Button(pasteParent, SWT.PUSH); - b.setText("Paste"); - b.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - String data = (String)clipboard.getContents(TextTransfer.getInstance()); - if (data != null && data.length() > 0) { - status.setText(""); - pasteText.setText("begin paste>"+data+" 0) { - status.setText(""); - data = "{\\rtf1{\\colortbl;\\red255\\green0\\blue0;}\\uc1\\b\\i " + data + "}"; - clipboard.setContents(new Object[] {data}, new Transfer[] {RTFTransfer.getInstance()}); - } else { - status.setText("nothing to copy"); - } - } - }); - - l = new Label(pasteParent, SWT.NONE); - l.setText("RTFTransfer:"); //$NON-NLS-1$ - pasteRtfText = new Text(pasteParent, SWT.READ_ONLY | SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); - data = new GridData(GridData.FILL_HORIZONTAL); - data.heightHint = data.widthHint = SIZE; - pasteRtfText.setLayoutData(data); - b = new Button(pasteParent, SWT.PUSH); - b.setText("Paste"); - b.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - String data = (String)clipboard.getContents(RTFTransfer.getInstance()); - if (data != null && data.length() > 0) { - status.setText(""); - pasteRtfText.setText("start paste>"+data+" 0){ - //copyFileTable.removeAll(); - String separator = System.getProperty("file.separator"); - String path = dialog.getFilterPath(); - String[] names = dialog.getFileNames(); - for (int i = 0; i < names.length; i++) { - TableItem item = new TableItem(copyFileTable, SWT.NONE); - item.setText(path+separator+names[i]); - } - } - } - }); - b = new Button(c, SWT.PUSH); - b.setText("Select directory"); - b.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - DirectoryDialog dialog = new DirectoryDialog(shell, SWT.OPEN); - String result = dialog.open(); - if (result != null && result.length() > 0){ - //copyFileTable.removeAll(); - TableItem item = new TableItem(copyFileTable, SWT.NONE); - item.setText(result); - } - } - }); - - b = new Button(copyParent, SWT.PUSH); - b.setText("Copy"); - b.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - TableItem[] items = copyFileTable.getItems(); - if (items.length > 0){ - status.setText(""); - String[] data = new String[items.length]; - for (int i = 0; i < data.length; i++) { - data[i] = items[i].getText(); - } - clipboard.setContents(new Object[] {data}, new Transfer[] {FileTransfer.getInstance()}); - } else { - status.setText("nothing to copy"); - } - } - }); - - l = new Label(pasteParent, SWT.NONE); - l.setText("FileTransfer:"); //$NON-NLS-1$ - pasteFileTable = new Table(pasteParent, SWT.MULTI | SWT.BORDER); - data = new GridData(GridData.FILL_HORIZONTAL); - data.heightHint = data.widthHint = SIZE; - pasteFileTable.setLayoutData(data); - b = new Button(pasteParent, SWT.PUSH); - b.setText("Paste"); - b.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - String[] data = (String[])clipboard.getContents(FileTransfer.getInstance()); - if (data != null && data.length > 0) { - status.setText(""); - pasteFileTable.removeAll(); - for (int i = 0; i < data.length; i++) { - TableItem item = new TableItem(pasteFileTable, SWT.NONE); - item.setText(data[i]); - } - } else { - status.setText("nothing to paste"); - } - } - }); -} -void createMyTransfer(Composite copyParent, Composite pasteParent){ - // MyType Transfer - // TODO -} -void createControlTransfer(Composite parent){ - Label l = new Label(parent, SWT.NONE); - l.setText("Text:"); - Button b = new Button(parent, SWT.PUSH); - b.setText("Cut"); - b.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - text.cut(); - } - }); - b = new Button(parent, SWT.PUSH); - b.setText("Copy"); - b.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - text.copy(); - } - }); - b = new Button(parent, SWT.PUSH); - b.setText("Paste"); - b.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - text.paste(); - } - }); - text = new Text(parent, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - data.heightHint = data.widthHint = SIZE; - text.setLayoutData(data); - - l = new Label(parent, SWT.NONE); - l.setText("Combo:"); - b = new Button(parent, SWT.PUSH); - b.setText("Cut"); - b.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - combo.cut(); - } - }); - b = new Button(parent, SWT.PUSH); - b.setText("Copy"); - b.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - combo.copy(); - } - }); - b = new Button(parent, SWT.PUSH); - b.setText("Paste"); - b.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - combo.paste(); - } - }); - combo = new Combo(parent, SWT.NONE); - combo.setItems(new String[] {"Item 1", "Item 2", "Item 3", "A longer Item"}); - - l = new Label(parent, SWT.NONE); - l.setText("StyledText:"); - l = new Label(parent, SWT.NONE); - l.setVisible(false); - b = new Button(parent, SWT.PUSH); - b.setText("Copy"); - b.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - styledText.copy(); - } - }); - b = new Button(parent, SWT.PUSH); - b.setText("Paste"); - b.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - styledText.paste(); - } - }); - styledText = new StyledText(parent, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); - data = new GridData(GridData.FILL_HORIZONTAL); - data.heightHint = data.widthHint = SIZE; - styledText.setLayoutData(data); -} -void createAvailableTypes(Composite parent){ - final List list = new List(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); - GridData data = new GridData(GridData.FILL_BOTH); - data.heightHint = 100; - list.setLayoutData(data); - Button b = new Button(parent, SWT.PUSH); - b.setText("Get Available Types"); - b.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - list.removeAll(); - String[] names = clipboard.getAvailableTypeNames(); - for (int i = 0; i < names.length; i++) { - list.add(names[i]); - } - } - }); -} -} \ No newline at end of file diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/MyType.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/MyType.java deleted file mode 100644 index f1fb79a6bb..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/MyType.java +++ /dev/null @@ -1,16 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.examples.clipboard; - -public class MyType { - String firstName; - String lastName; -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/MyTypeTransfer.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/MyTypeTransfer.java deleted file mode 100644 index 306a5de507..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/MyTypeTransfer.java +++ /dev/null @@ -1,92 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.examples.clipboard; - -import java.io.*; -import org.eclipse.swt.dnd.*; - -public class MyTypeTransfer extends ByteArrayTransfer { - - private static final String MYTYPENAME = "name_list"; //$NON-NLS-1$ - private static final int MYTYPEID = registerType(MYTYPENAME); - private static MyTypeTransfer _instance = new MyTypeTransfer(); - -public static MyTypeTransfer getInstance () { - return _instance; -} -public void javaToNative (Object object, TransferData transferData) { - if (object == null || !(object instanceof MyType[])) return; - - if (isSupportedType(transferData)) { - MyType[] myTypes = (MyType[]) object; - try { - // write data to a byte array and then ask super to convert to pMedium - ByteArrayOutputStream out = new ByteArrayOutputStream(); - DataOutputStream writeOut = new DataOutputStream(out); - for (int i = 0, length = myTypes.length; i < length; i++){ - byte[] buffer = myTypes[i].firstName.getBytes(); - writeOut.writeInt(buffer.length); - writeOut.write(buffer); - buffer = myTypes[i].firstName.getBytes(); - writeOut.writeInt(buffer.length); - writeOut.write(buffer); - } - byte[] buffer = out.toByteArray(); - writeOut.close(); - - super.javaToNative(buffer, transferData); - - } catch (IOException e) { - } - } -} -public Object nativeToJava(TransferData transferData){ - - if (isSupportedType(transferData)) { - - byte[] buffer = (byte[])super.nativeToJava(transferData); - if (buffer == null) return null; - - MyType[] myData = new MyType[0]; - try { - ByteArrayInputStream in = new ByteArrayInputStream(buffer); - DataInputStream readIn = new DataInputStream(in); - while(readIn.available() > 20) { - MyType datum = new MyType(); - int size = readIn.readInt(); - byte[] name = new byte[size]; - readIn.read(name); - datum.firstName = new String(name); - size = readIn.readInt(); - name = new byte[size]; - readIn.read(name); - datum.lastName = new String(name); - MyType[] newMyData = new MyType[myData.length + 1]; - System.arraycopy(myData, 0, newMyData, 0, myData.length); - newMyData[myData.length] = datum; - myData = newMyData; - } - readIn.close(); - } catch (IOException ex) { - return null; - } - return myData; - } - - return null; -} -protected String[] getTypeNames(){ - return new String[]{MYTYPENAME}; -} -protected int[] getTypeIds(){ - return new int[] {MYTYPEID}; -} -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/AlignableTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/AlignableTab.java deleted file mode 100755 index 271a9caca5..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/AlignableTab.java +++ /dev/null @@ -1,89 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.examples.controlexample; - - -import org.eclipse.swt.*; -import org.eclipse.swt.widgets.*; -import org.eclipse.swt.layout.*; -import org.eclipse.swt.events.*; - -/** - * AlignableTab is the abstract - * superclass of example controls that can be - * aligned. - */ -abstract class AlignableTab extends Tab { - - /* Alignment Controls */ - Button leftButton, rightButton, centerButton; - - /* Alignment Group */ - Group alignmentGroup; - - /** - * Creates the Tab within a given instance of ControlExample. - */ - AlignableTab(ControlExample instance) { - super(instance); - } - - /** - * Creates the "Control" group. - */ - void createControlGroup () { - super.createControlGroup (); - - /* Create the group */ - alignmentGroup = new Group (controlGroup, SWT.NONE); - alignmentGroup.setLayout (new GridLayout ()); - alignmentGroup.setLayoutData (new GridData(GridData.HORIZONTAL_ALIGN_FILL | - GridData.VERTICAL_ALIGN_FILL)); - alignmentGroup.setText (ControlExample.getResourceString("Alignment")); - - /* Create the controls */ - leftButton = new Button (alignmentGroup, SWT.RADIO); - leftButton.setText (ControlExample.getResourceString("Left")); - centerButton = new Button (alignmentGroup, SWT.RADIO); - centerButton.setText(ControlExample.getResourceString("Center")); - rightButton = new Button (alignmentGroup, SWT.RADIO); - rightButton.setText (ControlExample.getResourceString("Right")); - - /* Add the listeners */ - SelectionListener selectionListener = new SelectionAdapter () { - public void widgetSelected(SelectionEvent event) { - if (!((Button) event.widget).getSelection ()) return; - setExampleWidgetAlignment (); - }; - }; - leftButton.addSelectionListener (selectionListener); - centerButton.addSelectionListener (selectionListener); - rightButton.addSelectionListener (selectionListener); - } - - /** - * Sets the alignment of the "Example" widgets. - */ - abstract void setExampleWidgetAlignment (); - - /** - * Sets the state of the "Example" widgets. - */ - void setExampleWidgetState () { - super.setExampleWidgetState (); - Control [] controls = getExampleWidgets (); - if (controls.length != 0) { - leftButton.setSelection ((controls [0].getStyle () & SWT.LEFT) != 0); - centerButton.setSelection ((controls [0].getStyle () & SWT.CENTER) != 0); - rightButton.setSelection ((controls [0].getStyle () & SWT.RIGHT) != 0); - } - } -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ButtonTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ButtonTab.java deleted file mode 100755 index 7d35f3a83e..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ButtonTab.java +++ /dev/null @@ -1,205 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.examples.controlexample; - - -import org.eclipse.swt.*; -import org.eclipse.swt.widgets.*; -import org.eclipse.swt.layout.*; -import org.eclipse.swt.events.*; - -/** - * ButtonTab is the class that - * demonstrates SWT buttons. - */ -class ButtonTab extends AlignableTab { - - /* Example widgets and groups that contain them */ - Button button1, button2, button3, button4, button5, button6; - Group textButtonGroup, imageButtonGroup; - - /* Alignment widgets added to the "Control" group */ - Button upButton, downButton; - - /* Style widgets added to the "Style" group */ - Button pushButton, checkButton, radioButton, toggleButton, arrowButton, flatButton; - - /** - * Creates the Tab within a given instance of ControlExample. - */ - ButtonTab(ControlExample instance) { - super(instance); - } - - /** - * Creates the "Control" group. - */ - void createControlGroup () { - super.createControlGroup (); - - /* Create the controls */ - upButton = new Button (alignmentGroup, SWT.RADIO); - upButton.setText (ControlExample.getResourceString("Up")); - downButton = new Button (alignmentGroup, SWT.RADIO); - downButton.setText (ControlExample.getResourceString("Down")); - - /* Add the listeners */ - SelectionListener selectionListener = new SelectionAdapter() { - public void widgetSelected(SelectionEvent event) { - if (!((Button) event.widget).getSelection()) return; - setExampleWidgetAlignment (); - }; - }; - upButton.addSelectionListener(selectionListener); - downButton.addSelectionListener(selectionListener); - } - - /** - * Creates the "Example" group. - */ - void createExampleGroup () { - super.createExampleGroup (); - - /* Create a group for text buttons */ - textButtonGroup = new Group(exampleGroup, SWT.NONE); - GridLayout gridLayout = new GridLayout (); - textButtonGroup.setLayout(gridLayout); - gridLayout.numColumns = 3; - textButtonGroup.setLayoutData (new GridData (GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - textButtonGroup.setText (ControlExample.getResourceString("Text_Buttons")); - - /* Create a group for the image buttons */ - imageButtonGroup = new Group(exampleGroup, SWT.NONE); - gridLayout = new GridLayout(); - imageButtonGroup.setLayout(gridLayout); - gridLayout.numColumns = 3; - imageButtonGroup.setLayoutData (new GridData (GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - imageButtonGroup.setText (ControlExample.getResourceString("Image_Buttons")); - } - - /** - * Creates the "Example" widgets. - */ - void createExampleWidgets () { - - /* Compute the widget style */ - int style = getDefaultStyle(); - if (pushButton.getSelection()) style |= SWT.PUSH; - if (checkButton.getSelection()) style |= SWT.CHECK; - if (radioButton.getSelection()) style |= SWT.RADIO; - if (toggleButton.getSelection()) style |= SWT.TOGGLE; - if (flatButton.getSelection()) style |= SWT.FLAT; - if (borderButton.getSelection()) style |= SWT.BORDER; - if (leftButton.getSelection()) style |= SWT.LEFT; - if (rightButton.getSelection()) style |= SWT.RIGHT; - if (arrowButton.getSelection()) { - style |= SWT.ARROW; - if (upButton.getSelection()) style |= SWT.UP; - if (downButton.getSelection()) style |= SWT.DOWN; - } else { - if (centerButton.getSelection()) style |= SWT.CENTER; - } - - /* Create the example widgets */ - button1 = new Button(textButtonGroup, style); - button1.setText(ControlExample.getResourceString("One")); - button2 = new Button(textButtonGroup, style); - button2.setText(ControlExample.getResourceString("Two")); - button3 = new Button(textButtonGroup, style); - button3.setText(ControlExample.getResourceString("Three")); - button4 = new Button(imageButtonGroup, style); - button4.setImage(instance.images[ControlExample.ciClosedFolder]); - button5 = new Button(imageButtonGroup, style); - button5.setImage(instance.images[ControlExample.ciOpenFolder]); - button6 = new Button(imageButtonGroup, style); - button6.setImage(instance.images[ControlExample.ciTarget]); - } - - /** - * Creates the "Style" group. - */ - void createStyleGroup() { - super.createStyleGroup (); - - /* Create the extra widgets */ - pushButton = new Button (styleGroup, SWT.RADIO); - pushButton.setText("SWT.PUSH"); - checkButton = new Button (styleGroup, SWT.RADIO); - checkButton.setText ("SWT.CHECK"); - radioButton = new Button (styleGroup, SWT.RADIO); - radioButton.setText ("SWT.RADIO"); - toggleButton = new Button (styleGroup, SWT.RADIO); - toggleButton.setText ("SWT.TOGGLE"); - arrowButton = new Button (styleGroup, SWT.RADIO); - arrowButton.setText ("SWT.ARROW"); - flatButton = new Button (styleGroup, SWT.CHECK); - flatButton.setText ("SWT.FLAT"); - borderButton = new Button (styleGroup, SWT.CHECK); - borderButton.setText ("SWT.BORDER"); - } - - /** - * Gets the "Example" widget children. - */ - Control [] getExampleWidgets () { - return new Control [] {button1, button2, button3, button4, button5, button6}; - } - - /** - * Gets the text for the tab folder item. - */ - String getTabText () { - return "Button"; - } - - /** - * Sets the alignment of the "Example" widgets. - */ - void setExampleWidgetAlignment () { - int alignment = 0; - if (leftButton.getSelection ()) alignment = SWT.LEFT; - if (centerButton.getSelection ()) alignment = SWT.CENTER; - if (rightButton.getSelection ()) alignment = SWT.RIGHT; - if (upButton.getSelection ()) alignment = SWT.UP; - if (downButton.getSelection ()) alignment = SWT.DOWN; - button1.setAlignment (alignment); - button2.setAlignment (alignment); - button3.setAlignment (alignment); - button4.setAlignment (alignment); - button5.setAlignment (alignment); - button6.setAlignment (alignment); - } - - /** - * Sets the state of the "Example" widgets. - */ - void setExampleWidgetState () { - super.setExampleWidgetState (); - if (arrowButton.getSelection ()) { - upButton.setEnabled (true); - centerButton.setEnabled (false); - downButton.setEnabled (true); - } else { - upButton.setEnabled (false); - centerButton.setEnabled (true); - downButton.setEnabled (false); - } - upButton.setSelection ((button1.getStyle () & SWT.UP) != 0); - downButton.setSelection ((button1.getStyle () & SWT.DOWN) != 0); - pushButton.setSelection ((button1.getStyle () & SWT.PUSH) != 0); - checkButton.setSelection ((button1.getStyle () & SWT.CHECK) != 0); - radioButton.setSelection ((button1.getStyle () & SWT.RADIO) != 0); - toggleButton.setSelection ((button1.getStyle () & SWT.TOGGLE) != 0); - arrowButton.setSelection ((button1.getStyle () & SWT.ARROW) != 0); - flatButton.setSelection ((button1.getStyle () & SWT.FLAT) != 0); - borderButton.setSelection ((button1.getStyle () & SWT.BORDER) != 0); - } -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CComboTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CComboTab.java deleted file mode 100644 index ab35141bec..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CComboTab.java +++ /dev/null @@ -1,115 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.examples.controlexample; - - -import org.eclipse.swt.*; -import org.eclipse.swt.widgets.*; -import org.eclipse.swt.custom.*; -import org.eclipse.swt.layout.*; - -class CComboTab extends Tab { - - /* Example widgets and groups that contain them */ - CCombo combo1; - Group comboGroup; - - /* Style widgets added to the "Style" group */ - Button flatButton, readOnlyButton; - - static String [] ListData = {ControlExample.getResourceString("ListData0_0"), - ControlExample.getResourceString("ListData0_1"), - ControlExample.getResourceString("ListData0_2"), - ControlExample.getResourceString("ListData0_3"), - ControlExample.getResourceString("ListData0_4"), - ControlExample.getResourceString("ListData0_5"), - ControlExample.getResourceString("ListData0_6"), - ControlExample.getResourceString("ListData0_7"), - ControlExample.getResourceString("ListData0_8")}; - - /** - * Creates the Tab within a given instance of ControlExample. - */ - CComboTab(ControlExample instance) { - super(instance); - } - - /** - * Creates the "Example" group. - */ - void createExampleGroup () { - super.createExampleGroup (); - - /* Create a group for the combo box */ - comboGroup = new Group (exampleGroup, SWT.NONE); - comboGroup.setLayout (new GridLayout ()); - comboGroup.setLayoutData (new GridData (GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - comboGroup.setText (ControlExample.getResourceString("Custom_Combo")); - } - - /** - * Creates the "Example" widgets. - */ - void createExampleWidgets () { - - /* Compute the widget style */ - int style = getDefaultStyle(); - if (flatButton.getSelection ()) style |= SWT.FLAT; - if (readOnlyButton.getSelection ()) style |= SWT.READ_ONLY; - if (borderButton.getSelection ()) style |= SWT.BORDER; - - /* Create the example widgets */ - combo1 = new CCombo (comboGroup, style); - combo1.setItems (ListData); - if (ListData.length >= 3) { - combo1.setText(ListData [2]); - } - } - - /** - * Creates the "Style" group. - */ - void createStyleGroup () { - super.createStyleGroup (); - - /* Create the extra widgets */ - readOnlyButton = new Button (styleGroup, SWT.CHECK); - readOnlyButton.setText ("SWT.READ_ONLY"); - borderButton = new Button (styleGroup, SWT.CHECK); - borderButton.setText ("SWT.BORDER"); - flatButton = new Button (styleGroup, SWT.CHECK); - flatButton.setText ("SWT.FLAT"); - } - - /** - * Gets the "Example" widget children. - */ - Control [] getExampleWidgets () { - return new Control [] {combo1}; - } - - /** - * Gets the text for the tab folder item. - */ - String getTabText () { - return "CCombo"; - } - - /** - * Sets the state of the "Example" widgets. - */ - void setExampleWidgetState () { - super.setExampleWidgetState (); - flatButton.setSelection ((combo1.getStyle () & SWT.FLAT) != 0); - readOnlyButton.setSelection ((combo1.getStyle () & SWT.READ_ONLY) != 0); - borderButton.setSelection ((combo1.getStyle () & SWT.BORDER) != 0); - } -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CLabelTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CLabelTab.java deleted file mode 100644 index 745b4b92b4..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CLabelTab.java +++ /dev/null @@ -1,138 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.examples.controlexample; - - -import org.eclipse.swt.*; -import org.eclipse.swt.custom.*; -import org.eclipse.swt.events.*; -import org.eclipse.swt.layout.*; -import org.eclipse.swt.widgets.*; - -class CLabelTab extends AlignableTab { - /* Example widgets and groups that contain them */ - CLabel label1, label2, label3; - Group textLabelGroup; - - /* Style widgets added to the "Style" group */ - Button shadowInButton, shadowOutButton, shadowNoneButton; - - /** - * Creates the Tab within a given instance of ControlExample. - */ - CLabelTab(ControlExample instance) { - super(instance); - } - - /** - * Creates the "Example" group. - */ - void createExampleGroup () { - super.createExampleGroup (); - - /* Create a group for the text labels */ - textLabelGroup = new Group(exampleGroup, SWT.NONE); - GridLayout gridLayout = new GridLayout (); - textLabelGroup.setLayout (gridLayout); - gridLayout.numColumns = 3; - textLabelGroup.setLayoutData (new GridData (GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - textLabelGroup.setText (ControlExample.getResourceString("Custom_Labels")); - } - - /** - * Creates the "Example" widgets. - */ - void createExampleWidgets () { - - /* Compute the widget style */ - int style = getDefaultStyle(); - if (shadowInButton.getSelection ()) style |= SWT.SHADOW_IN; - if (shadowNoneButton.getSelection ()) style |= SWT.SHADOW_NONE; - if (shadowOutButton.getSelection ()) style |= SWT.SHADOW_OUT; - - /* Create the example widgets */ - label1 = new CLabel (textLabelGroup, style); - label1.setText(ControlExample.getResourceString("One")); - label1.setImage (instance.images[ControlExample.ciClosedFolder]); - label2 = new CLabel (textLabelGroup, style); - label2.setImage (instance.images[ControlExample.ciTarget]); - label3 = new CLabel (textLabelGroup, style); - label3.setText(ControlExample.getResourceString("Three")); - } - - /** - * Creates the "Style" group. - */ - void createStyleGroup() { - super.createStyleGroup (); - - /* Create the extra widgets */ - shadowNoneButton = new Button (styleGroup, SWT.RADIO); - shadowNoneButton.setText ("SWT.SHADOW_NONE"); - shadowInButton = new Button (styleGroup, SWT.RADIO); - shadowInButton.setText ("SWT.SHADOW_IN"); - shadowOutButton = new Button (styleGroup, SWT.RADIO); - shadowOutButton.setText ("SWT.SHADOW_OUT"); - - /* Add the listeners */ - SelectionListener selectionListener = new SelectionAdapter () { - public void widgetSelected(SelectionEvent event) { - if ((event.widget.getStyle() & SWT.RADIO) != 0) { - if (!((Button) event.widget).getSelection ()) return; - } - recreateExampleWidgets (); - }; - }; - shadowInButton.addSelectionListener (selectionListener); - shadowOutButton.addSelectionListener (selectionListener); - shadowNoneButton.addSelectionListener (selectionListener); - } - - /** - * Gets the "Example" widget children. - */ - Control [] getExampleWidgets () { - return new Control [] {label1, label2, label3}; - } - - /** - * Gets the text for the tab folder item. - */ - String getTabText () { - return "CLabel"; - } - - /** - * Sets the alignment of the "Example" widgets. - */ - void setExampleWidgetAlignment () { - int alignment = 0; - if (leftButton.getSelection ()) alignment = SWT.LEFT; - if (centerButton.getSelection ()) alignment = SWT.CENTER; - if (rightButton.getSelection ()) alignment = SWT.RIGHT; - label1.setAlignment (alignment); - label2.setAlignment (alignment); - label3.setAlignment (alignment); - } - - /** - * Sets the state of the "Example" widgets. - */ - void setExampleWidgetState () { - super.setExampleWidgetState (); - leftButton.setSelection ((label1.getStyle () & SWT.LEFT) != 0); - centerButton.setSelection ((label1.getStyle () & SWT.CENTER) != 0); - rightButton.setSelection ((label1.getStyle () & SWT.RIGHT) != 0); - shadowInButton.setSelection ((label1.getStyle () & SWT.SHADOW_IN) != 0); - shadowOutButton.setSelection ((label1.getStyle () & SWT.SHADOW_OUT) != 0); - shadowNoneButton.setSelection ((label1.getStyle () & (SWT.SHADOW_IN | SWT.SHADOW_OUT)) == 0); - } -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CTabFolderTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CTabFolderTab.java deleted file mode 100644 index 7bdeed1709..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CTabFolderTab.java +++ /dev/null @@ -1,165 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.examples.controlexample; - - -import org.eclipse.swt.*; -import org.eclipse.swt.custom.*; -import org.eclipse.swt.events.*; -import org.eclipse.swt.layout.*; -import org.eclipse.swt.widgets.*; - -class CTabFolderTab extends Tab { - int lastSelectedTab = 0; - - /* Example widgets and groups that contain them */ - CTabFolder tabFolder1; - Group tabFolderGroup; - - /* Style widgets added to the "Style" group */ - Button topButton, bottomButton, flatButton; - - static String [] CTabItems1 = {ControlExample.getResourceString("CTabItem1_0"), - ControlExample.getResourceString("CTabItem1_1"), - ControlExample.getResourceString("CTabItem1_2")}; - - /** - * Creates the Tab within a given instance of ControlExample. - */ - CTabFolderTab(ControlExample instance) { - super(instance); - } - - /** - * Creates the "Example" group. - */ - void createExampleGroup () { - super.createExampleGroup (); - - /* Create a group for the CTabFolder */ - tabFolderGroup = new Group (exampleGroup, SWT.NONE); - tabFolderGroup.setLayout (new GridLayout ()); - tabFolderGroup.setLayoutData (new GridData (GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - tabFolderGroup.setText ("CTabFolder"); - } - - /** - * Creates the "Example" widgets. - */ - void createExampleWidgets () { - - /* Compute the widget style */ - int style = getDefaultStyle(); - if (topButton.getSelection ()) style |= SWT.TOP; - if (bottomButton.getSelection ()) style |= SWT.BOTTOM; - if (borderButton.getSelection ()) style |= SWT.BORDER; - if (flatButton.getSelection ()) style |= SWT.FLAT; - - /* Create the example widgets */ - tabFolder1 = new CTabFolder (tabFolderGroup, style); - for (int i = 0; i < CTabItems1.length; i++) { - CTabItem item = new CTabItem(tabFolder1, SWT.NONE); - item.setText(CTabItems1[i]); - Label label = new Label(tabFolder1, SWT.NONE); - label.setText(ControlExample.getResourceString("CTabItem_content") + ": " + i); - item.setControl(label); - } - tabFolder1.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event event) { - lastSelectedTab = tabFolder1.getSelectionIndex(); - } - }); - tabFolder1.setSelection(lastSelectedTab); - } - - /** - * Creates the "Style" group. - */ - void createStyleGroup() { - super.createStyleGroup (); - - /* Create the extra widgets */ - topButton = new Button (styleGroup, SWT.RADIO); - topButton.setText ("SWT.TOP"); - topButton.setSelection(true); - bottomButton = new Button (styleGroup, SWT.RADIO); - bottomButton.setText ("SWT.BOTTOM"); - borderButton = new Button (styleGroup, SWT.CHECK); - borderButton.setText ("SWT.BORDER"); - flatButton = new Button (styleGroup, SWT.CHECK); - flatButton.setText ("SWT.FLAT"); - flatButton.setEnabled(false); - - /* Add the listeners */ - SelectionListener selectionListener = new SelectionAdapter () { - public void widgetSelected(SelectionEvent event) { - if ((event.widget.getStyle() & SWT.RADIO) != 0) { - if (!((Button) event.widget).getSelection ()) return; - } - recreateExampleWidgets (); - }; - }; - topButton.addSelectionListener (selectionListener); - bottomButton.addSelectionListener (selectionListener); - borderButton.addSelectionListener (selectionListener); - flatButton.addSelectionListener (selectionListener); - borderButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - flatButton.setEnabled(borderButton.getSelection()); - } - }); - } - - /** - * Gets the list of custom event names. - * - * @return an array containing custom event names - */ - String [] getCustomEventNames () { - return new String [] {"CTabFolderEvent"}; - } - - /** - * Gets the "Example" widget children's items, if any. - * - * @return an array containing the example widget children's items - */ - Item [] getExampleWidgetItems () { - return tabFolder1.getItems(); - } - - /** - * Gets the "Example" widget children. - */ - Control [] getExampleWidgets () { - return new Control [] {tabFolder1}; - } - - /** - * Gets the text for the tab folder item. - */ - String getTabText () { - return "CTabFolder"; - } - - /** - * Hooks the custom listener specified by eventName. - */ - void hookCustomListener (final String eventName) { - if (eventName == "CTabFolderEvent") { - tabFolder1.addCTabFolderListener (new CTabFolderAdapter () { - public void itemClosed (CTabFolderEvent event) { - log (eventName, event); - } - }); - } - } -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CanvasTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CanvasTab.java deleted file mode 100644 index afd79d0597..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CanvasTab.java +++ /dev/null @@ -1,306 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.examples.controlexample; - - -import org.eclipse.swt.*; -import org.eclipse.swt.graphics.*; -import org.eclipse.swt.widgets.*; -import org.eclipse.swt.events.*; -import org.eclipse.swt.layout.*; - -class CanvasTab extends Tab { - static int colors [] = { - SWT.COLOR_RED, - SWT.COLOR_GREEN, - SWT.COLOR_BLUE, - SWT.COLOR_MAGENTA, - SWT.COLOR_YELLOW, - SWT.COLOR_CYAN, - SWT.COLOR_DARK_RED, - SWT.COLOR_DARK_GREEN, - SWT.COLOR_DARK_BLUE, - SWT.COLOR_DARK_MAGENTA, - SWT.COLOR_DARK_YELLOW, - SWT.COLOR_DARK_CYAN - }; - - /* Example widgets and groups that contain them */ - Canvas canvas; - Group canvasGroup; - - /* Style widgets added to the "Style" group */ - Button horizontalButton, verticalButton, noBackgroundButton, noFocusButton, noMergePaintsButton, noRedrawResizeButton; - - /* Other widgets added to the "Other" group */ - Button caretButton, fillDamageButton; - - int paintCount; - int cx, cy; - int maxX, maxY; - - /** - * Creates the Tab within a given instance of ControlExample. - */ - CanvasTab(ControlExample instance) { - super(instance); - } - - /** - * Creates a bitmap image. - */ - Image createBitmapImage (Display display, String name) { - ImageData source = new ImageData(ControlExample.class.getResourceAsStream(name + ".bmp")); - ImageData mask = new ImageData(ControlExample.class.getResourceAsStream(name + "_mask.bmp")); - return new Image (display, source, mask); - } - - /** - * Creates the "Other" group. - */ - void createOtherGroup () { - super.createOtherGroup (); - - /* Create display controls specific to this example */ - caretButton = new Button (otherGroup, SWT.CHECK); - caretButton.setText (ControlExample.getResourceString("Caret")); - fillDamageButton = new Button (otherGroup, SWT.CHECK); - fillDamageButton.setText (ControlExample.getResourceString("FillDamage")); - - /* Add the listeners */ - caretButton.addSelectionListener (new SelectionAdapter () { - public void widgetSelected (SelectionEvent event) { - setCaret (); - } - }); - } - - /** - * Creates the "Example" group. - */ - void createExampleGroup () { - super.createExampleGroup (); - - /* Create a group for the canvas widget */ - canvasGroup = new Group (exampleGroup, SWT.NONE); - canvasGroup.setLayout (new GridLayout ()); - canvasGroup.setLayoutData (new GridData (GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - canvasGroup.setText ("Canvas"); - } - - /** - * Creates the "Example" widgets. - */ - void createExampleWidgets () { - - /* Compute the widget style */ - int style = getDefaultStyle(); - if (horizontalButton.getSelection ()) style |= SWT.H_SCROLL; - if (verticalButton.getSelection ()) style |= SWT.V_SCROLL; - if (borderButton.getSelection ()) style |= SWT.BORDER; - if (noBackgroundButton.getSelection ()) style |= SWT.NO_BACKGROUND; - if (noFocusButton.getSelection ()) style |= SWT.NO_FOCUS; - if (noMergePaintsButton.getSelection ()) style |= SWT.NO_MERGE_PAINTS; - if (noRedrawResizeButton.getSelection ()) style |= SWT.NO_REDRAW_RESIZE; - - /* Create the example widgets */ - paintCount = 0; cx = 0; cy = 0; - canvas = new Canvas (canvasGroup, style); - canvas.addPaintListener(new PaintListener () { - public void paintControl(PaintEvent e) { - paintCount++; - GC gc = e.gc; - if (fillDamageButton.getSelection ()) { - Color color = e.display.getSystemColor (colors [paintCount % colors.length]); - gc.setBackground(color); - gc.fillRectangle(e.x, e.y, e.width, e.height); - } - Point size = canvas.getSize (); - gc.drawArc(cx + 1, cy + 1, size.x - 2, size.y - 2, 0, 360); - String counter = new Integer(paintCount).toString(); - Point extent = gc.stringExtent(counter); - gc.drawString(counter, cx + (size.x - extent.x) / 2, cy + (size.y - extent.y) / 2); - } - }); - canvas.addControlListener(new ControlAdapter() { - public void controlResized(ControlEvent event) { - Point size = canvas.getSize (); - maxX = size.x * 3 / 2; maxY = size.y * 3 / 2; - resizeScrollBars (); - } - }); - ScrollBar bar = canvas.getHorizontalBar(); - if (bar != null) { - bar.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent event) { - scrollHorizontal ((ScrollBar)event.widget); - } - }); - } - bar = canvas.getVerticalBar(); - if (bar != null) { - bar.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent event) { - scrollVertical ((ScrollBar)event.widget); - } - }); - } - resizeScrollBars (); - } - - /** - * Creates the "Style" group. - */ - void createStyleGroup() { - super.createStyleGroup(); - - /* Create the extra widgets */ - horizontalButton = new Button (styleGroup, SWT.CHECK); - horizontalButton.setText ("SWT.H_SCROLL"); - horizontalButton.setSelection(true); - verticalButton = new Button (styleGroup, SWT.CHECK); - verticalButton.setText ("SWT.V_SCROLL"); - verticalButton.setSelection(true); - borderButton = new Button (styleGroup, SWT.CHECK); - borderButton.setText ("SWT.BORDER"); - noBackgroundButton = new Button (styleGroup, SWT.CHECK); - noBackgroundButton.setText ("SWT.NO_BACKGROUND"); - noFocusButton = new Button (styleGroup, SWT.CHECK); - noFocusButton.setText ("SWT.NO_FOCUS"); - noMergePaintsButton = new Button (styleGroup, SWT.CHECK); - noMergePaintsButton.setText ("SWT.NO_MERGE_PAINTS"); - noRedrawResizeButton = new Button (styleGroup, SWT.CHECK); - noRedrawResizeButton.setText ("SWT.NO_REDRAW_RESIZE"); - } - - /** - * Creates the tab folder page. - * - * @param tabFolder org.eclipse.swt.widgets.TabFolder - * @return the new page for the tab folder - */ - Composite createTabFolderPage (TabFolder tabFolder) { - super.createTabFolderPage (tabFolder); - - /* - * Add a resize listener to the tabFolderPage so that - * if the user types into the example widget to change - * its preferred size, and then resizes the shell, we - * recalculate the preferred size correctly. - */ - tabFolderPage.addControlListener(new ControlAdapter() { - public void controlResized(ControlEvent e) { - setExampleWidgetSize (); - } - }); - - return tabFolderPage; - } - - /** - * Gets the "Example" widget children. - */ - Control [] getExampleWidgets () { - return new Control [] {canvas}; - } - - /** - * Gets the text for the tab folder item. - */ - String getTabText () { - return "Canvas"; - } - - /** - * Resizes the maximum and thumb of both scrollbars. - */ - void resizeScrollBars () { - Rectangle clientArea = canvas.getClientArea(); - ScrollBar bar = canvas.getHorizontalBar(); - if (bar != null) { - bar.setMaximum(maxX); - bar.setThumb(clientArea.width); - bar.setPageIncrement(clientArea.width); - } - bar = canvas.getVerticalBar(); - if (bar != null) { - bar.setMaximum(maxY); - bar.setThumb(clientArea.height); - bar.setPageIncrement(clientArea.height); - } - } - - /** - * Scrolls the canvas horizontally. - * - * @param scrollBar - */ - void scrollHorizontal (ScrollBar scrollBar) { - Rectangle bounds = canvas.getClientArea(); - int x = -scrollBar.getSelection(); - if (x + maxX < bounds.width) { - x = bounds.width - maxX; - } - canvas.scroll(x, cy, cx, cy, maxX, maxY, false); - cx = x; - } - - /** - * Scrolls the canvas vertically. - * - * @param scrollBar - */ - void scrollVertical (ScrollBar scrollBar) { - Rectangle bounds = canvas.getClientArea(); - int y = -scrollBar.getSelection(); - if (y + maxY < bounds.height) { - y = bounds.height - maxY; - } - canvas.scroll(cx, y, cx, cy, maxX, maxY, false); - cy = y; - } - - /** - * Sets or clears the caret in the "Example" widget. - */ - void setCaret () { - Caret oldCaret = canvas.getCaret (); - if (caretButton.getSelection ()) { - Caret newCaret = new Caret(canvas, SWT.NONE); - Font font = canvas.getFont(); - newCaret.setFont(font); - GC gc = new GC(canvas); - gc.setFont(font); - newCaret.setBounds(1, 1, 1, gc.getFontMetrics().getHeight()); - gc.dispose(); - canvas.setCaret (newCaret); - canvas.setFocus(); - } else { - canvas.setCaret (null); - } - if (oldCaret != null) oldCaret.dispose (); - } - - /** - * Sets the state of the "Example" widgets. - */ - void setExampleWidgetState () { - super.setExampleWidgetState (); - horizontalButton.setSelection ((canvas.getStyle () & SWT.H_SCROLL) != 0); - verticalButton.setSelection ((canvas.getStyle () & SWT.V_SCROLL) != 0); - borderButton.setSelection ((canvas.getStyle () & SWT.BORDER) != 0); - noBackgroundButton.setSelection ((canvas.getStyle () & SWT.NO_BACKGROUND) != 0); - noFocusButton.setSelection ((canvas.getStyle () & SWT.NO_FOCUS) != 0); - noMergePaintsButton.setSelection ((canvas.getStyle () & SWT.NO_MERGE_PAINTS) != 0); - noRedrawResizeButton.setSelection ((canvas.getStyle () & SWT.NO_REDRAW_RESIZE) != 0); - setCaret (); - } -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ComboTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ComboTab.java deleted file mode 100755 index 0cff972d60..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ComboTab.java +++ /dev/null @@ -1,140 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.examples.controlexample; - - -import org.eclipse.swt.*; -import org.eclipse.swt.widgets.*; -import org.eclipse.swt.events.*; -import org.eclipse.swt.layout.*; - -class ComboTab extends Tab { - - /* Example widgets and groups that contain them */ - Combo combo1; - Group comboGroup; - - /* Style widgets added to the "Style" group */ - Button dropDownButton, readOnlyButton, simpleButton; - - static String [] ListData = {ControlExample.getResourceString("ListData0_0"), - ControlExample.getResourceString("ListData0_1"), - ControlExample.getResourceString("ListData0_2"), - ControlExample.getResourceString("ListData0_3"), - ControlExample.getResourceString("ListData0_4"), - ControlExample.getResourceString("ListData0_5"), - ControlExample.getResourceString("ListData0_6"), - ControlExample.getResourceString("ListData0_7"), - ControlExample.getResourceString("ListData0_8")}; - - /** - * Creates the Tab within a given instance of ControlExample. - */ - ComboTab(ControlExample instance) { - super(instance); - } - - /** - * Creates the "Example" group. - */ - void createExampleGroup () { - super.createExampleGroup (); - - /* Create a group for the combo box */ - comboGroup = new Group (exampleGroup, SWT.NONE); - comboGroup.setLayout (new GridLayout ()); - comboGroup.setLayoutData (new GridData (GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - comboGroup.setText ("Combo"); - } - - /** - * Creates the "Example" widgets. - */ - void createExampleWidgets () { - - /* Compute the widget style */ - int style = getDefaultStyle(); - if (dropDownButton.getSelection ()) style |= SWT.DROP_DOWN; - if (readOnlyButton.getSelection ()) style |= SWT.READ_ONLY; - if (simpleButton.getSelection ()) style |= SWT.SIMPLE; - - /* Create the example widgets */ - combo1 = new Combo (comboGroup, style); - combo1.setItems (ListData); - if (ListData.length >= 3) { - combo1.setText(ListData [2]); - } - } - - /** - * Creates the tab folder page. - * - * @param tabFolder org.eclipse.swt.widgets.TabFolder - * @return the new page for the tab folder - */ - Composite createTabFolderPage (TabFolder tabFolder) { - super.createTabFolderPage (tabFolder); - - /* - * Add a resize listener to the tabFolderPage so that - * if the user types into the example widget to change - * its preferred size, and then resizes the shell, we - * recalculate the preferred size correctly. - */ - tabFolderPage.addControlListener(new ControlAdapter() { - public void controlResized(ControlEvent e) { - setExampleWidgetSize (); - } - }); - - return tabFolderPage; - } - - /** - * Creates the "Style" group. - */ - void createStyleGroup () { - super.createStyleGroup (); - - /* Create the extra widgets */ - dropDownButton = new Button (styleGroup, SWT.RADIO); - dropDownButton.setText ("SWT.DROP_DOWN"); - simpleButton = new Button (styleGroup, SWT.RADIO); - simpleButton.setText("SWT.SIMPLE"); - readOnlyButton = new Button (styleGroup, SWT.CHECK); - readOnlyButton.setText ("SWT.READ_ONLY"); - } - - /** - * Gets the "Example" widget children. - */ - Control [] getExampleWidgets () { - return new Control [] {combo1}; - } - - /** - * Gets the text for the tab folder item. - */ - String getTabText () { - return "Combo"; - } - - /** - * Sets the state of the "Example" widgets. - */ - void setExampleWidgetState () { - super.setExampleWidgetState (); - dropDownButton.setSelection ((combo1.getStyle () & SWT.DROP_DOWN) != 0); - simpleButton.setSelection ((combo1.getStyle () & SWT.SIMPLE) != 0); - readOnlyButton.setSelection ((combo1.getStyle () & SWT.READ_ONLY) != 0); - readOnlyButton.setEnabled(!simpleButton.getSelection()); - } -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java deleted file mode 100755 index 3201eac2f2..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java +++ /dev/null @@ -1,205 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.examples.controlexample; - - -import org.eclipse.swt.*; -import org.eclipse.swt.graphics.*; -import org.eclipse.swt.layout.*; -import org.eclipse.swt.widgets.*; - -import java.text.*; -import java.util.*; - -public class ControlExample { - private static ResourceBundle resourceBundle = - ResourceBundle.getBundle("examples_control"); - private ShellTab shellTab; - private TabFolder tabFolder; - Image images[]; - - static final int ciClosedFolder = 0, ciOpenFolder = 1, ciTarget = 2; - static final String[] imageLocations = { - "closedFolder.gif", - "openFolder.gif", - "target.gif" }; - - /** - * Creates an instance of a ControlExample embedded inside - * the supplied parent Composite. - * - * @param parent the container of the example - */ - public ControlExample(Composite parent) { - initResources(); - tabFolder = new TabFolder (parent, SWT.NONE); - Tab [] tabs = createTabs(); - for (int i=0; i bounds.width) size.x = bounds.width * 9 / 10; - if (size.y > bounds.height) size.y = bounds.height * 9 / 10; - shell.setSize (size); - } -} - diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CoolBarTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CoolBarTab.java deleted file mode 100644 index 7a9180a19d..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CoolBarTab.java +++ /dev/null @@ -1,439 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.examples.controlexample; - - -import org.eclipse.swt.*; -import org.eclipse.swt.graphics.*; -import org.eclipse.swt.widgets.*; -import org.eclipse.swt.layout.*; -import org.eclipse.swt.events.*; - -class CoolBarTab extends Tab { - Button dropDownButton, lockedButton; - - /* Example widgets and group that contains them */ - CoolBar coolBar; - CoolItem pushItem, dropDownItem, radioItem, checkItem; - Group coolBarGroup; - - Point[] sizes; - int[] wrapIndices; - int[] order; - - /** - * Creates the Tab within a given instance of ControlExample. - */ - CoolBarTab(ControlExample instance) { - super(instance); - } - - /** - * Creates the "Other" group. - */ - void createOtherGroup () { - super.createOtherGroup (); - - /* Create display controls specific to this example */ - lockedButton = new Button (otherGroup, SWT.CHECK); - lockedButton.setText (ControlExample.getResourceString("Locked")); - - /* Add the listeners */ - lockedButton.addSelectionListener (new SelectionAdapter () { - public void widgetSelected (SelectionEvent event) { - setWidgetLocked (); - } - }); - } - - /** - * Creates the "Example" group. - */ - void createExampleGroup () { - super.createExampleGroup (); - coolBarGroup = new Group (exampleGroup, SWT.NONE); - coolBarGroup.setLayout (new GridLayout ()); - coolBarGroup.setLayoutData (new GridData (GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - coolBarGroup.setText ("CoolBar"); - } - - /** - * Creates the "Example" widgets. - */ - void createExampleWidgets () { - int style = getDefaultStyle(), itemStyle = 0; - - /* Compute the widget style */ - int toolBarStyle = SWT.FLAT; - if (borderButton.getSelection()) style |= SWT.BORDER; - if (dropDownButton.getSelection()) itemStyle |= SWT.DROP_DOWN; - - /* - * Create the example widgets. - */ - coolBar = new CoolBar (coolBarGroup, style); - - /* create the push button toolbar */ - ToolBar toolBar = new ToolBar (coolBar, toolBarStyle); - ToolItem item = new ToolItem (toolBar, SWT.PUSH); - item.setImage (instance.images[ControlExample.ciClosedFolder]); - item.setToolTipText ("SWT.PUSH"); - item = new ToolItem (toolBar, SWT.PUSH); - item.setImage (instance.images[ControlExample.ciOpenFolder]); - item.setToolTipText ("SWT.PUSH"); - item = new ToolItem (toolBar, SWT.PUSH); - item.setImage (instance.images[ControlExample.ciTarget]); - item.setToolTipText ("SWT.PUSH"); - item = new ToolItem (toolBar, SWT.SEPARATOR); - item = new ToolItem (toolBar, SWT.PUSH); - item.setImage (instance.images[ControlExample.ciClosedFolder]); - item.setToolTipText ("SWT.PUSH"); - item = new ToolItem (toolBar, SWT.PUSH); - item.setImage (instance.images[ControlExample.ciOpenFolder]); - item.setToolTipText ("SWT.PUSH"); - pushItem = new CoolItem (coolBar, itemStyle); - pushItem.setControl (toolBar); - Point pushSize = toolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT); - pushSize = pushItem.computeSize(pushSize.x, pushSize.y); - pushItem.setSize(pushSize); - pushItem.setMinimumSize(item.getWidth(), pushSize.y); - pushItem.addSelectionListener (new CoolItemSelectionListener()); - - /* create the dropdown toolbar */ - toolBar = new ToolBar (coolBar, toolBarStyle); - item = new ToolItem (toolBar, SWT.DROP_DOWN); - item.setImage (instance.images[ControlExample.ciOpenFolder]); - item.setToolTipText ("SWT.DROP_DOWN"); - item.addSelectionListener (new DropDownSelectionListener()); - item = new ToolItem (toolBar, SWT.DROP_DOWN); - item.setImage (instance.images[ControlExample.ciClosedFolder]); - item.setToolTipText ("SWT.DROP_DOWN"); - item.addSelectionListener (new DropDownSelectionListener()); - dropDownItem = new CoolItem (coolBar, itemStyle); - dropDownItem.setControl (toolBar); - Point dropSize = toolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT); - dropSize = dropDownItem.computeSize(dropSize.x, dropSize.y); - dropDownItem.setSize(dropSize); - dropDownItem.setMinimumSize(item.getWidth(), dropSize.y); - dropDownItem.addSelectionListener (new CoolItemSelectionListener()); - - /* create the radio button toolbar */ - toolBar = new ToolBar (coolBar, toolBarStyle); - item = new ToolItem (toolBar, SWT.RADIO); - item.setImage (instance.images[ControlExample.ciClosedFolder]); - item.setToolTipText ("SWT.RADIO"); - item = new ToolItem (toolBar, SWT.RADIO); - item.setImage (instance.images[ControlExample.ciClosedFolder]); - item.setToolTipText ("SWT.RADIO"); - item = new ToolItem (toolBar, SWT.RADIO); - item.setImage (instance.images[ControlExample.ciClosedFolder]); - item.setToolTipText ("SWT.RADIO"); - radioItem = new CoolItem (coolBar, itemStyle); - radioItem.setControl (toolBar); - Point radioSize = toolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT); - radioSize = radioItem.computeSize(radioSize.x, radioSize.y); - radioItem.setSize(radioSize); - radioItem.setMinimumSize(item.getWidth(), radioSize.y); - radioItem.addSelectionListener (new CoolItemSelectionListener()); - - /* create the check button toolbar */ - toolBar = new ToolBar (coolBar, toolBarStyle); - item = new ToolItem (toolBar, SWT.CHECK); - item.setImage (instance.images[ControlExample.ciClosedFolder]); - item.setToolTipText ("SWT.CHECK"); - item = new ToolItem (toolBar, SWT.CHECK); - item.setImage (instance.images[ControlExample.ciTarget]); - item.setToolTipText ("SWT.CHECK"); - item = new ToolItem (toolBar, SWT.CHECK); - item.setImage (instance.images[ControlExample.ciOpenFolder]); - item.setToolTipText ("SWT.CHECK"); - item = new ToolItem (toolBar, SWT.CHECK); - item.setImage (instance.images[ControlExample.ciTarget]); - item.setToolTipText ("SWT.CHECK"); - checkItem = new CoolItem (coolBar, itemStyle); - checkItem.setControl (toolBar); - Point checkSize = toolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT); - checkSize = checkItem.computeSize(checkSize.x, checkSize.y); - checkItem.setSize(checkSize); - checkItem.setMinimumSize(item.getWidth(), checkSize.y); - checkItem.addSelectionListener (new CoolItemSelectionListener()); - - /* if we have saved state, restore it */ - if (order != null) { - coolBar.setItemLayout(order, wrapIndices, sizes); - /* - * special case: because setItemLayout will restore the items - * to the sizes the user left them at, the preferred size may not - * be the same as the actual size. Thus we must explicitly set - * the preferred sizes. - */ - pushItem.setPreferredSize(pushSize); - dropDownItem.setPreferredSize(dropSize); - radioItem.setPreferredSize(radioSize); - checkItem.setPreferredSize(checkSize); - } - else { - coolBar.setWrapIndices(new int[] {1, 3}); - } - - /* add a listener to resize the group box to match the coolbar */ - coolBar.addListener(SWT.Resize, new Listener() { - public void handleEvent(Event event) { - exampleGroup.layout(); - } - }); - } - - /** - * Creates the "Style" group. - */ - void createStyleGroup() { - super.createStyleGroup(); - - /* Create the extra widget */ - borderButton = new Button (styleGroup, SWT.CHECK); - borderButton.setText ("SWT.BORDER"); - Group itemGroup = new Group(styleGroup, SWT.NONE); - itemGroup.setLayout (new GridLayout ()); - itemGroup.setLayoutData (new GridData (GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - itemGroup.setText(ControlExample.getResourceString("Item_Styles")); - dropDownButton = new Button (itemGroup, SWT.CHECK); - dropDownButton.setText ("SWT.DROP_DOWN"); - dropDownButton.addSelectionListener (new SelectionAdapter () { - public void widgetSelected (SelectionEvent event) { - recreateExampleWidgets (); - } - }); - } - - /** - * Disposes the "Example" widgets. - */ - void disposeExampleWidgets () { - /* store the state of the toolbar if applicable */ - if (coolBar != null) { - sizes = coolBar.getItemSizes(); - wrapIndices = coolBar.getWrapIndices(); - order = coolBar.getItemOrder(); - } - super.disposeExampleWidgets(); - } - - /** - * Gets the "Example" widget children's items, if any. - * - * @return an array containing the example widget children's items - */ - Item [] getExampleWidgetItems () { - return coolBar.getItems(); - } - - /** - * Gets the "Example" widget children. - */ - Control [] getExampleWidgets () { - return new Control [] {coolBar}; - } - - /** - * Gets the text for the tab folder item. - */ - String getTabText () { - return "CoolBar"; - } - - /** - * Sets the state of the "Example" widgets. - */ - void setExampleWidgetState () { - super.setExampleWidgetState (); - borderButton.setSelection ((coolBar.getStyle () & SWT.BORDER) != 0); - dropDownButton.setSelection ((coolBar.getItem(0).getStyle () & SWT.DROP_DOWN) != 0); - setWidgetLocked (); - } - - /** - * Sets the header visible state of the "Example" widgets. - */ - void setWidgetLocked () { - coolBar.setLocked (lockedButton.getSelection ()); - } - - /** - * Listens to widgetSelected() events on SWT.DROP_DOWN type ToolItems - * and opens/closes a menu when appropriate. - */ - class DropDownSelectionListener extends SelectionAdapter { - private Menu menu = null; - private boolean visible = false; - - public void widgetSelected(SelectionEvent event) { - // Create the menu if it has not already been created - if (menu == null) { - // Lazy create the menu. - Shell shell = tabFolderPage.getShell(); - menu = new Menu(shell); - for (int i = 0; i < 9; ++i) { - final String text = ControlExample.getResourceString("DropDownData_" + i); - if (text.length() != 0) { - MenuItem menuItem = new MenuItem(menu, SWT.NONE); - menuItem.setText(text); - /* - * Add a menu selection listener so that the menu is hidden - * when the user selects an item from the drop down menu. - */ - menuItem.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - setMenuVisible(false); - } - }); - } else { - new MenuItem(menu, SWT.SEPARATOR); - } - } - } - - /** - * A selection event will be fired when a drop down tool - * item is selected in the main area and in the drop - * down arrow. Examine the event detail to determine - * where the widget was selected. - */ - if (event.detail == SWT.ARROW) { - /* - * The drop down arrow was selected. - */ - if (visible) { - // Hide the menu to give the Arrow the appearance of being a toggle button. - setMenuVisible(false); - } else { - // Position the menu below and vertically aligned with the the drop down tool button. - final ToolItem toolItem = (ToolItem) event.widget; - final ToolBar toolBar = toolItem.getParent(); - - Rectangle toolItemBounds = toolItem.getBounds(); - Point point = toolBar.toDisplay(new Point(toolItemBounds.x, toolItemBounds.y)); - menu.setLocation(point.x, point.y + toolItemBounds.height); - setMenuVisible(true); - } - } else { - /* - * Main area of drop down tool item selected. - * An application would invoke the code to perform the action for the tool item. - */ - } - } - private void setMenuVisible(boolean visible) { - menu.setVisible(visible); - this.visible = visible; - } - } - - /** - * Listens to widgetSelected() events on SWT.DROP_DOWN type CoolItems - * and opens/closes a menu when appropriate. - */ - class CoolItemSelectionListener extends SelectionAdapter { - private Menu menu = null; - - public void widgetSelected(SelectionEvent event) { - /** - * A selection event will be fired when the cool item - * is selected by its gripper or if the drop down arrow - * (or 'chevron') is selected. Examine the event detail - * to determine where the widget was selected. - */ - if (event.detail == SWT.ARROW) { - /* If the popup menu is already up (i.e. user pressed arrow twice), - * then dispose it. - */ - if (menu != null) { - menu.dispose(); - menu = null; - return; - } - - /* Get the cool item and convert its bounds to display coordinates. */ - CoolItem coolItem = (CoolItem) event.widget; - Rectangle itemBounds = coolItem.getBounds (); - Point pt = coolBar.toDisplay(new Point (itemBounds.x, itemBounds.y)); - itemBounds.x = pt.x; - itemBounds.y = pt.y; - - /* Get the toolbar from the cool item. */ - ToolBar toolBar = (ToolBar) coolItem.getControl (); - ToolItem[] tools = toolBar.getItems (); - int toolCount = tools.length; - - /* Convert the bounds of each tool item to display coordinates, - * and determine which ones are past the bounds of the cool item. - */ - int i = 0; - while (i < toolCount) { - Rectangle toolBounds = tools[i].getBounds (); - pt = toolBar.toDisplay(new Point(toolBounds.x, toolBounds.y)); - toolBounds.x = pt.x; - toolBounds.y = pt.y; - Rectangle intersection = itemBounds.intersection (toolBounds); - if (!intersection.equals (toolBounds)) break; - i++; - } - - /* Create a pop-up menu with items for each of the hidden buttons. */ - menu = new Menu (coolBar); - for (int j = i; j < toolCount; j++) { - ToolItem tool = tools[j]; - Image image = tool.getImage(); - if (image == null) { - new MenuItem (menu, SWT.SEPARATOR); - } else { - if ((tool.getStyle() & SWT.DROP_DOWN) != 0) { - MenuItem menuItem = new MenuItem (menu, SWT.CASCADE); - menuItem.setImage(image); - Menu m = new Menu(menu); - menuItem.setMenu(m); - for (int k = 0; k < 9; ++k) { - String text = ControlExample.getResourceString("DropDownData_" + k); - if (text.length() != 0) { - MenuItem mi = new MenuItem(m, SWT.NONE); - mi.setText(text); - /* Application code to perform the action for the submenu item would go here. */ - } else { - new MenuItem(m, SWT.SEPARATOR); - } - } - } else { - MenuItem menuItem = new MenuItem (menu, SWT.NONE); - menuItem.setImage(image); - } - /* Application code to perform the action for the menu item would go here. */ - - } - } - - /* Display the pop-up menu at the lower left corner of the arrow button. - * Dispose the menu when the user is done with it. - */ - pt = coolBar.toDisplay(new Point(event.x, event.y)); - menu.setLocation (pt.x, pt.y); - menu.setVisible (true); - Display display = coolBar.getDisplay (); - while (menu != null && menu.isVisible ()) { - if (!display.readAndDispatch ()) display.sleep (); - } - if (menu != null) { - menu.dispose (); - menu = null; - } - } - } - } -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CustomControlExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CustomControlExample.java deleted file mode 100644 index ecb047eb97..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CustomControlExample.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.examples.controlexample; - -import org.eclipse.swt.layout.*; -import org.eclipse.swt.widgets.*; - - -public class CustomControlExample extends ControlExample { - - /** - * Creates an instance of a CustomControlExample embedded - * inside the supplied parent Composite. - * - * @param parent the container of the example - */ - public CustomControlExample(Composite parent) { - super (parent); - } - - /** - * Answers the set of example Tabs - */ - Tab[] createTabs() { - return new Tab [] { - new CComboTab (this), - new CLabelTab (this), - new CTabFolderTab (this), - new SashFormTab (this), - new StyledTextTab (this), - new TableTreeTab (this), - }; - } - - /** - * Invokes as a standalone program. - */ - public static void main(String[] args) { - Display display = new Display(); - Shell shell = new Shell(display); - shell.setLayout(new FillLayout()); - CustomControlExample instance = new CustomControlExample(shell); - shell.setText(getResourceString("custom.window.title")); - setShellSize(display, shell); - shell.open(); - while (! shell.isDisposed()) { - if (! display.readAndDispatch()) display.sleep(); - } - instance.dispose(); - } -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/DialogTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/DialogTab.java deleted file mode 100755 index d0f4ea962f..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/DialogTab.java +++ /dev/null @@ -1,469 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.examples.controlexample; - - -import org.eclipse.swt.*; -import org.eclipse.swt.graphics.*; -import org.eclipse.swt.widgets.*; -import org.eclipse.swt.layout.*; -import org.eclipse.swt.printing.*; -import org.eclipse.swt.events.*; - -class DialogTab extends Tab { - /* Example widgets and groups that contain them */ - Group dialogStyleGroup, resultGroup; - Text textWidget; - - /* Style widgets added to the "Style" group */ - Combo dialogCombo; - Button okButton, cancelButton; - Button yesButton, noButton; - Button retryButton; - Button abortButton, ignoreButton; - Button iconErrorButton, iconInformationButton, iconQuestionButton; - Button iconWarningButton, iconWorkingButton; - Button modelessButton, primaryModalButton, applicationModalButton, systemModalButton; - Button saveButton, openButton; - - static String [] FilterExtensions = {"*.txt", "*.bat", "*.doc"}; - static String [] FilterNames = {ControlExample.getResourceString("FilterName_0"), - ControlExample.getResourceString("FilterName_1"), - ControlExample.getResourceString("FilterName_2")}; - - /** - * Creates the Tab within a given instance of ControlExample. - */ - DialogTab(ControlExample instance) { - super(instance); - } - - /** - * Handle a button style selection event. - * - * @param event the selection event - */ - void buttonStyleSelected(SelectionEvent event) { - /* - * Only certain combinations of button styles are - * supported for various dialogs. Make sure the - * control widget reflects only valid combinations. - */ - okButton.setEnabled ( - !(yesButton.getSelection () || noButton.getSelection () || - retryButton.getSelection () || abortButton.getSelection () || - ignoreButton.getSelection ())); - cancelButton.setEnabled ( - !(abortButton.getSelection () || ignoreButton.getSelection () || - (yesButton.getSelection () != noButton.getSelection ()))); - yesButton.setEnabled ( - !(okButton.getSelection () || retryButton.getSelection () || - abortButton.getSelection () || ignoreButton.getSelection () || - (cancelButton.getSelection () && !yesButton.getSelection () && !noButton.getSelection ()))); - noButton.setEnabled ( - !(okButton.getSelection () || retryButton.getSelection () || - abortButton.getSelection () || ignoreButton.getSelection () || - (cancelButton.getSelection () && !yesButton.getSelection () && !noButton.getSelection ()))); - retryButton.setEnabled ( - !(okButton.getSelection() || yesButton.getSelection() || noButton.getSelection ())); - abortButton.setEnabled ( - !(okButton.getSelection () || cancelButton.getSelection () || - yesButton.getSelection () || noButton.getSelection ())); - ignoreButton.setEnabled ( - !(okButton.getSelection () || cancelButton.getSelection () | - yesButton.getSelection () || noButton.getSelection ())); - } - - /** - * Handle the create button selection event. - * - * @param event org.eclipse.swt.events.SelectionEvent - */ - void createButtonSelected(SelectionEvent event) { - - /* Compute the appropriate dialog style */ - int style = getDefaultStyle(); - if (okButton.getEnabled () && okButton.getSelection ()) style |= SWT.OK; - if (cancelButton.getEnabled () && cancelButton.getSelection ()) style |= SWT.CANCEL; - if (yesButton.getEnabled () && yesButton.getSelection ()) style |= SWT.YES; - if (noButton.getEnabled () && noButton.getSelection ()) style |= SWT.NO; - if (retryButton.getEnabled () && retryButton.getSelection ()) style |= SWT.RETRY; - if (abortButton.getEnabled () && abortButton.getSelection ()) style |= SWT.ABORT; - if (ignoreButton.getEnabled () && ignoreButton.getSelection ()) style |= SWT.IGNORE; - if (iconErrorButton.getEnabled () && iconErrorButton.getSelection ()) style |= SWT.ICON_ERROR; - if (iconInformationButton.getEnabled () && iconInformationButton.getSelection ()) style |= SWT.ICON_INFORMATION; - if (iconQuestionButton.getEnabled () && iconQuestionButton.getSelection ()) style |= SWT.ICON_QUESTION; - if (iconWarningButton.getEnabled () && iconWarningButton.getSelection ()) style |= SWT.ICON_WARNING; - if (iconWorkingButton.getEnabled () && iconWorkingButton.getSelection ()) style |= SWT.ICON_WORKING; - if (primaryModalButton.getEnabled () && primaryModalButton.getSelection ()) style |= SWT.PRIMARY_MODAL; - if (applicationModalButton.getEnabled () && applicationModalButton.getSelection ()) style |= SWT.APPLICATION_MODAL; - if (systemModalButton.getEnabled () && systemModalButton.getSelection ()) style |= SWT.SYSTEM_MODAL; - if (saveButton.getEnabled () && saveButton.getSelection ()) style |= SWT.SAVE; - if (openButton.getEnabled () && openButton.getSelection ()) style |= SWT.OPEN; - - /* Open the appropriate dialog type */ - String name = dialogCombo.getText (); - Shell shell = tabFolderPage.getShell (); - - if (name.equals (ControlExample.getResourceString("ColorDialog"))) { - ColorDialog dialog = new ColorDialog (shell ,style); - dialog.setRGB (new RGB (100, 100, 100)); - dialog.setText (ControlExample.getResourceString("Title")); - RGB result = dialog.open (); - textWidget.append (ControlExample.getResourceString("ColorDialog") + Text.DELIMITER); - textWidget.append (ControlExample.getResourceString("Result", new String [] {"" + result}) + Text.DELIMITER + Text.DELIMITER); - return; - } - - if (name.equals (ControlExample.getResourceString("DirectoryDialog"))) { - DirectoryDialog dialog = new DirectoryDialog (shell, style); - dialog.setMessage (ControlExample.getResourceString("Example_string")); - dialog.setText (ControlExample.getResourceString("Title")); - String result = dialog.open (); - textWidget.append (ControlExample.getResourceString("DirectoryDialog") + Text.DELIMITER); - textWidget.append (ControlExample.getResourceString("Result", new String [] {"" + result}) + Text.DELIMITER + Text.DELIMITER); - return; - } - - if (name.equals (ControlExample.getResourceString("FileDialog"))) { - FileDialog dialog = new FileDialog (shell, style); - dialog.setFileName (ControlExample.getResourceString("readme_txt")); - dialog.setFilterNames (FilterNames); - dialog.setFilterExtensions (FilterExtensions); - dialog.setText (ControlExample.getResourceString("Title")); - String result = dialog.open(); - textWidget.append (ControlExample.getResourceString("FileDialog") + Text.DELIMITER); - textWidget.append (ControlExample.getResourceString("Result", new String [] {"" + result}) + Text.DELIMITER + Text.DELIMITER); - return; - } - - if (name.equals (ControlExample.getResourceString("FontDialog"))) { - FontDialog dialog = new FontDialog (shell, style); - dialog.setText (ControlExample.getResourceString("Title")); - FontData result = dialog.open (); - textWidget.append (ControlExample.getResourceString("FontDialog") + Text.DELIMITER); - textWidget.append (ControlExample.getResourceString("Result", new String [] {"" + result}) + Text.DELIMITER + Text.DELIMITER); - return; - } - - if (name.equals (ControlExample.getResourceString("PrintDialog"))) { - PrintDialog dialog = new PrintDialog (shell, style); - dialog.setText(ControlExample.getResourceString("Title")); - PrinterData result = dialog.open (); - textWidget.append (ControlExample.getResourceString("PrintDialog") + Text.DELIMITER); - textWidget.append (ControlExample.getResourceString("Result", new String [] {"" + result}) + Text.DELIMITER + Text.DELIMITER); - return; - } - - if (name.equals(ControlExample.getResourceString("MessageBox"))) { - MessageBox dialog = new MessageBox (shell, style); - dialog.setMessage (ControlExample.getResourceString("Example_string")); - dialog.setText (ControlExample.getResourceString("Title")); - int result = dialog.open (); - textWidget.append (ControlExample.getResourceString("MessageBox") + Text.DELIMITER); - /* - * The resulting integer depends on the original - * dialog style. Decode the result and display it. - */ - switch (result) { - case SWT.OK: - textWidget.append (ControlExample.getResourceString("Result", new String [] {"SWT.OK"})); - break; - case SWT.YES: - textWidget.append (ControlExample.getResourceString("Result", new String [] {"SWT.YES"})); - break; - case SWT.NO: - textWidget.append (ControlExample.getResourceString("Result", new String [] {"SWT.NO"})); - break; - case SWT.CANCEL: - textWidget.append (ControlExample.getResourceString("Result", new String [] {"SWT.CANCEL"})); - break; - case SWT.ABORT: - textWidget.append (ControlExample.getResourceString("Result", new String [] {"SWT.ABORT"})); - break; - case SWT.RETRY: - textWidget.append (ControlExample.getResourceString("Result", new String [] {"SWT.RETRY"})); - break; - case SWT.IGNORE: - textWidget.append (ControlExample.getResourceString("Result", new String [] {"SWT.IGNORE"})); - break; - default: - textWidget.append(ControlExample.getResourceString("Result", new String [] {"" + result})); - break; - } - textWidget.append (Text.DELIMITER + Text.DELIMITER); - } - } - - /** - * Creates the "Control" group. - */ - void createControlGroup () { - /* - * Create the "Control" group. This is the group on the - * right half of each example tab. It consists of the - * style group, the display group and the size group. - */ - controlGroup = new Group (tabFolderPage, SWT.NONE); - GridLayout gridLayout= new GridLayout (); - controlGroup.setLayout(gridLayout); - gridLayout.numColumns = 2; - gridLayout.makeColumnsEqualWidth = true; - controlGroup.setLayoutData (new GridData (GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - controlGroup.setText (ControlExample.getResourceString("Parameters")); - - /* - * Create a group to hold the dialog style combo box and - * create dialog button. - */ - dialogStyleGroup = new Group (controlGroup, SWT.NONE); - dialogStyleGroup.setLayout (new GridLayout ()); - GridData gridData = new GridData (GridData.HORIZONTAL_ALIGN_CENTER); - gridData.horizontalSpan = 2; - dialogStyleGroup.setLayoutData (gridData); - dialogStyleGroup.setText (ControlExample.getResourceString("Dialog_Type")); - } - - /** - * Creates the "Control" widget children. - */ - void createControlWidgets () { - - /* Create the combo */ - String [] strings = { - ControlExample.getResourceString("ColorDialog"), - ControlExample.getResourceString("DirectoryDialog"), - ControlExample.getResourceString("FileDialog"), - ControlExample.getResourceString("FontDialog"), - ControlExample.getResourceString("PrintDialog"), - ControlExample.getResourceString("MessageBox"), - }; - dialogCombo = new Combo (dialogStyleGroup, SWT.READ_ONLY); - dialogCombo.setItems (strings); - dialogCombo.setText (strings [0]); - - /* Create the create dialog button */ - Button createButton = new Button(dialogStyleGroup, SWT.NONE); - createButton.setText (ControlExample.getResourceString("Create_Dialog")); - createButton.setLayoutData (new GridData(GridData.HORIZONTAL_ALIGN_CENTER)); - - /* Create a group for the various dialog button style controls */ - Group buttonStyleGroup = new Group (controlGroup, SWT.NONE); - buttonStyleGroup.setLayout (new GridLayout ()); - buttonStyleGroup.setLayoutData (new GridData (GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - buttonStyleGroup.setText (ControlExample.getResourceString("Button_Styles")); - - /* Create the button style buttons */ - okButton = new Button (buttonStyleGroup, SWT.CHECK); - okButton.setText ("SWT.OK"); - cancelButton = new Button (buttonStyleGroup, SWT.CHECK); - cancelButton.setText ("SWT.CANCEL"); - yesButton = new Button (buttonStyleGroup, SWT.CHECK); - yesButton.setText ("SWT.YES"); - noButton = new Button (buttonStyleGroup, SWT.CHECK); - noButton.setText ("SWT.NO"); - retryButton = new Button (buttonStyleGroup, SWT.CHECK); - retryButton.setText ("SWT.RETRY"); - abortButton = new Button (buttonStyleGroup, SWT.CHECK); - abortButton.setText ("SWT.ABORT"); - ignoreButton = new Button (buttonStyleGroup, SWT.CHECK); - ignoreButton.setText ("SWT.IGNORE"); - - /* Create a group for the icon style controls */ - Group iconStyleGroup = new Group (controlGroup, SWT.NONE); - iconStyleGroup.setLayout (new GridLayout ()); - iconStyleGroup.setLayoutData (new GridData (GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - iconStyleGroup.setText (ControlExample.getResourceString("Icon_Styles")); - - /* Create the icon style buttons */ - iconErrorButton = new Button (iconStyleGroup, SWT.RADIO); - iconErrorButton.setText ("SWT.ICON_ERROR"); - iconInformationButton = new Button (iconStyleGroup, SWT.RADIO); - iconInformationButton.setText ("SWT.ICON_INFORMATION"); - iconQuestionButton = new Button (iconStyleGroup, SWT.RADIO); - iconQuestionButton.setText ("SWT.ICON_QUESTION"); - iconWarningButton = new Button (iconStyleGroup, SWT.RADIO); - iconWarningButton.setText ("SWT.ICON_WARNING"); - iconWorkingButton = new Button (iconStyleGroup, SWT.RADIO); - iconWorkingButton.setText ("SWT.ICON_WORKING"); - - /* Create a group for the modal style controls */ - Group modalStyleGroup = new Group (controlGroup, SWT.NONE); - modalStyleGroup.setLayout (new GridLayout ()); - modalStyleGroup.setLayoutData (new GridData (GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - modalStyleGroup.setText (ControlExample.getResourceString("Modal_Styles")); - - /* Create the modal style buttons */ - modelessButton = new Button (modalStyleGroup, SWT.RADIO); - modelessButton.setText ("SWT.MODELESS"); - primaryModalButton = new Button (modalStyleGroup, SWT.RADIO); - primaryModalButton.setText ("SWT.PRIMARY_MODAL"); - applicationModalButton = new Button (modalStyleGroup, SWT.RADIO); - applicationModalButton.setText ("SWT.APPLICATION_MODAL"); - systemModalButton = new Button (modalStyleGroup, SWT.RADIO); - systemModalButton.setText ("SWT.SYSTEM_MODAL"); - - /* Create a group for the file dialog style controls */ - Group fileDialogStyleGroup = new Group (controlGroup, SWT.NONE); - fileDialogStyleGroup.setLayout (new GridLayout ()); - fileDialogStyleGroup.setLayoutData (new GridData (GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - fileDialogStyleGroup.setText (ControlExample.getResourceString("File_Dialog_Styles")); - - /* Create the file dialog style buttons */ - saveButton = new Button (fileDialogStyleGroup, SWT.RADIO); - saveButton.setText ("SWT.SAVE"); - openButton = new Button(fileDialogStyleGroup, SWT.RADIO); - openButton.setText("SWT.OPEN"); - - /* Create the orientation group */ - if (RTL_SUPPORT_ENABLE) { - createOrientationGroup(); - } - - /* Add the listeners */ - dialogCombo.addSelectionListener (new SelectionAdapter () { - public void widgetSelected (SelectionEvent event) { - dialogSelected (event); - }; - }); - createButton.addSelectionListener (new SelectionAdapter () { - public void widgetSelected (SelectionEvent event) { - createButtonSelected (event); - }; - }); - SelectionListener buttonStyleListener = new SelectionAdapter () { - public void widgetSelected (SelectionEvent event) { - buttonStyleSelected (event); - }; - }; - okButton.addSelectionListener (buttonStyleListener); - cancelButton.addSelectionListener (buttonStyleListener); - yesButton.addSelectionListener (buttonStyleListener); - noButton.addSelectionListener (buttonStyleListener); - retryButton.addSelectionListener (buttonStyleListener); - abortButton.addSelectionListener (buttonStyleListener); - ignoreButton.addSelectionListener (buttonStyleListener); - - /* Set default values for style buttons */ - okButton.setEnabled (false); - cancelButton.setEnabled (false); - yesButton.setEnabled (false); - noButton.setEnabled (false); - retryButton.setEnabled (false); - abortButton.setEnabled (false); - ignoreButton.setEnabled (false); - iconErrorButton.setEnabled (false); - iconInformationButton.setEnabled (false); - iconQuestionButton.setEnabled (false); - iconWarningButton.setEnabled (false); - iconWorkingButton.setEnabled (false); - saveButton.setEnabled (false); - openButton.setEnabled (false); - openButton.setSelection (true); - iconInformationButton.setSelection (true); - modelessButton.setSelection (true); - } - - /** - * Creates the "Example" group. - */ - void createExampleGroup () { - super.createExampleGroup (); - - /* - * Create a group for the text widget to display - * the results returned by the example dialogs. - */ - resultGroup = new Group (exampleGroup, SWT.NONE); - resultGroup.setLayout (new GridLayout ()); - resultGroup.setLayoutData (new GridData (GridData.FILL_BOTH)); - resultGroup.setText (ControlExample.getResourceString("Dialog_Result")); - } - - /** - * Creates the "Example" widgets. - */ - void createExampleWidgets () { - /* - * Create a multi lined, scrolled text widget for output. - */ - textWidget = new Text(resultGroup, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); - GridData gridData = new GridData (GridData.FILL_BOTH); - textWidget.setLayoutData (gridData); - } - - /** - * The platform dialogs do not have SWT listeners. - */ - void createListenersGroup () { - } - - /** - * Handle a dialog type combo selection event. - * - * @param event the selection event - */ - void dialogSelected (SelectionEvent event) { - - /* Enable/Disable the buttons */ - String name = dialogCombo.getText (); - boolean isMessageBox = name.equals (ControlExample.getResourceString("MessageBox")); - boolean isFileDialog = name.equals (ControlExample.getResourceString("FileDialog")); - okButton.setEnabled (isMessageBox); - cancelButton.setEnabled (isMessageBox); - yesButton.setEnabled (isMessageBox); - noButton.setEnabled (isMessageBox); - retryButton.setEnabled (isMessageBox); - abortButton.setEnabled (isMessageBox); - ignoreButton.setEnabled (isMessageBox); - iconErrorButton.setEnabled (isMessageBox); - iconInformationButton.setEnabled (isMessageBox); - iconQuestionButton.setEnabled (isMessageBox); - iconWarningButton.setEnabled (isMessageBox); - iconWorkingButton.setEnabled (isMessageBox); - saveButton.setEnabled (isFileDialog); - openButton.setEnabled (isFileDialog); - - /* Unselect the buttons */ - if (!isMessageBox) { - okButton.setSelection (false); - cancelButton.setSelection (false); - yesButton.setSelection (false); - noButton.setSelection (false); - retryButton.setSelection (false); - abortButton.setSelection (false); - ignoreButton.setSelection (false); - } - } - - /** - * Gets the "Example" widget children. - */ - Control [] getExampleWidgets () { - return new Control [0]; - } - - /** - * Gets the text for the tab folder item. - */ - String getTabText () { - return "Dialog"; - } - - /** - * Recreates the "Example" widgets. - */ - void recreateExampleWidgets () { - if (textWidget == null) { - super.recreateExampleWidgets (); - } - } -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/GroupTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/GroupTab.java deleted file mode 100644 index 7d1b496528..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/GroupTab.java +++ /dev/null @@ -1,159 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.examples.controlexample; - - -import org.eclipse.swt.*; -import org.eclipse.swt.events.*; -import org.eclipse.swt.layout.*; -import org.eclipse.swt.widgets.*; - -class GroupTab extends Tab { - Button titleButton; - - /* Example widgets and groups that contain them */ - Group group1; - Group groupGroup; - - /* Style widgets added to the "Style" group */ - Button shadowEtchedInButton, shadowEtchedOutButton, shadowInButton, shadowOutButton, shadowNoneButton; - - /** - * Creates the Tab within a given instance of ControlExample. - */ - GroupTab(ControlExample instance) { - super(instance); - } - - /** - * Creates the "Other" group. - */ - void createOtherGroup () { - super.createOtherGroup (); - - /* Create display controls specific to this example */ - titleButton = new Button (otherGroup, SWT.CHECK); - titleButton.setText (ControlExample.getResourceString("Title_Text")); - - /* Add the listeners */ - titleButton.addSelectionListener (new SelectionAdapter () { - public void widgetSelected (SelectionEvent event) { - setTitleText (); - } - }); - } - - /** - * Creates the "Example" group. - */ - void createExampleGroup () { - super.createExampleGroup (); - - /* Create a group for the Group */ - groupGroup = new Group (exampleGroup, SWT.NONE); - groupGroup.setLayout (new GridLayout ()); - groupGroup.setLayoutData (new GridData (GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - groupGroup.setText ("Group"); - } - - /** - * Creates the "Example" widgets. - */ - void createExampleWidgets () { - - /* Compute the widget style */ - int style = getDefaultStyle(); - if (shadowEtchedInButton.getSelection ()) style |= SWT.SHADOW_ETCHED_IN; - if (shadowEtchedOutButton.getSelection ()) style |= SWT.SHADOW_ETCHED_OUT; - if (shadowInButton.getSelection ()) style |= SWT.SHADOW_IN; - if (shadowOutButton.getSelection ()) style |= SWT.SHADOW_OUT; - if (shadowNoneButton.getSelection ()) style |= SWT.SHADOW_NONE; - if (borderButton.getSelection ()) style |= SWT.BORDER; - - /* Create the example widgets */ - group1 = new Group (groupGroup, style); - } - - /** - * Creates the "Style" group. - */ - void createStyleGroup() { - super.createStyleGroup (); - - /* Create the extra widgets */ - shadowEtchedInButton = new Button (styleGroup, SWT.RADIO); - shadowEtchedInButton.setText ("SWT.SHADOW_ETCHED_IN"); - shadowEtchedInButton.setSelection(true); - shadowEtchedOutButton = new Button (styleGroup, SWT.RADIO); - shadowEtchedOutButton.setText ("SWT.SHADOW_ETCHED_OUT"); - shadowInButton = new Button (styleGroup, SWT.RADIO); - shadowInButton.setText ("SWT.SHADOW_IN"); - shadowOutButton = new Button (styleGroup, SWT.RADIO); - shadowOutButton.setText ("SWT.SHADOW_OUT"); - shadowNoneButton = new Button (styleGroup, SWT.RADIO); - shadowNoneButton.setText ("SWT.SHADOW_NONE"); - borderButton = new Button (styleGroup, SWT.CHECK); - borderButton.setText ("SWT.BORDER"); - - /* Add the listeners */ - SelectionListener selectionListener = new SelectionAdapter () { - public void widgetSelected(SelectionEvent event) { - if (!((Button) event.widget).getSelection ()) return; - recreateExampleWidgets (); - }; - }; - shadowEtchedInButton.addSelectionListener (selectionListener); - shadowEtchedOutButton.addSelectionListener (selectionListener); - shadowInButton.addSelectionListener (selectionListener); - shadowOutButton.addSelectionListener (selectionListener); - shadowNoneButton.addSelectionListener (selectionListener); - } - - /** - * Gets the "Example" widget children. - */ - Control [] getExampleWidgets () { - return new Control [] {group1}; - } - - /** - * Gets the text for the tab folder item. - */ - String getTabText () { - return "Group"; - } - - /** - * Sets the title text of the "Example" widgets. - */ - void setTitleText () { - if (titleButton.getSelection ()) { - group1.setText (ControlExample.getResourceString("Title_Text")); - } else { - group1.setText (""); - } - setExampleWidgetSize (); - } - - /** - * Sets the state of the "Example" widgets. - */ - void setExampleWidgetState () { - super.setExampleWidgetState (); - shadowEtchedInButton.setSelection ((group1.getStyle () & SWT.SHADOW_ETCHED_IN) != 0); - shadowEtchedOutButton.setSelection ((group1.getStyle () & SWT.SHADOW_ETCHED_OUT) != 0); - shadowInButton.setSelection ((group1.getStyle () & SWT.SHADOW_IN) != 0); - shadowOutButton.setSelection ((group1.getStyle () & SWT.SHADOW_OUT) != 0); - shadowNoneButton.setSelection ((group1.getStyle () & SWT.SHADOW_NONE) != 0); - borderButton.setSelection ((group1.getStyle () & SWT.BORDER) != 0); - setTitleText (); - } -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/LabelTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/LabelTab.java deleted file mode 100755 index 4d843446a6..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/LabelTab.java +++ /dev/null @@ -1,190 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.examples.controlexample; - - -import org.eclipse.swt.*; -import org.eclipse.swt.widgets.*; -import org.eclipse.swt.layout.*; -import org.eclipse.swt.events.*; - -class LabelTab extends AlignableTab { - /* Example widgets and groups that contain them */ - Label label1, label2, label3, label4, label5, label6; - Group textLabelGroup, imageLabelGroup; - - /* Style widgets added to the "Style" group */ - Button wrapButton, separatorButton, horizontalButton, verticalButton, shadowInButton, shadowOutButton, shadowNoneButton; - - /** - * Creates the Tab within a given instance of ControlExample. - */ - LabelTab(ControlExample instance) { - super(instance); - } - - /** - * Creates the "Example" group. - */ - void createExampleGroup () { - super.createExampleGroup (); - - /* Create a group for the text labels */ - textLabelGroup = new Group(exampleGroup, SWT.NONE); - GridLayout gridLayout = new GridLayout (); - textLabelGroup.setLayout (gridLayout); - gridLayout.numColumns = 3; - textLabelGroup.setLayoutData (new GridData (GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - textLabelGroup.setText (ControlExample.getResourceString("Text_Labels")); - - /* Create a group for the image labels */ - imageLabelGroup = new Group (exampleGroup, SWT.SHADOW_NONE); - gridLayout = new GridLayout (); - imageLabelGroup.setLayout (gridLayout); - gridLayout.numColumns = 3; - imageLabelGroup.setLayoutData (new GridData (GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - imageLabelGroup.setText (ControlExample.getResourceString("Image_Labels")); - } - - /** - * Creates the "Example" widgets. - */ - void createExampleWidgets () { - - /* Compute the widget style */ - int style = getDefaultStyle(); - if (wrapButton.getSelection ()) style |= SWT.WRAP; - if (separatorButton.getSelection ()) style |= SWT.SEPARATOR; - if (horizontalButton.getSelection ()) style |= SWT.HORIZONTAL; - if (verticalButton.getSelection ()) style |= SWT.VERTICAL; - if (shadowInButton.getSelection ()) style |= SWT.SHADOW_IN; - if (shadowOutButton.getSelection ()) style |= SWT.SHADOW_OUT; - if (shadowNoneButton.getSelection ()) style |= SWT.SHADOW_NONE; - if (borderButton.getSelection ()) style |= SWT.BORDER; - if (leftButton.getSelection ()) style |= SWT.LEFT; - if (centerButton.getSelection ()) style |= SWT.CENTER; - if (rightButton.getSelection ()) style |= SWT.RIGHT; - - /* Create the example widgets */ - label1 = new Label (textLabelGroup, style); - label1.setText(ControlExample.getResourceString("One")); - label2 = new Label (textLabelGroup, style); - label2.setText(ControlExample.getResourceString("Two")); - label3 = new Label (textLabelGroup, style); - if (wrapButton.getSelection ()) { - label3.setText (ControlExample.getResourceString("Wrap_Text")); - } else { - label3.setText (ControlExample.getResourceString("Three")); - } - label4 = new Label (imageLabelGroup, style); - label4.setImage (instance.images[ControlExample.ciClosedFolder]); - label5 = new Label (imageLabelGroup, style); - label5.setImage (instance.images[ControlExample.ciOpenFolder]); - label6 = new Label(imageLabelGroup, style); - label6.setImage (instance.images[ControlExample.ciTarget]); - } - - /** - * Creates the "Style" group. - */ - void createStyleGroup() { - super.createStyleGroup (); - - /* Create the extra widgets */ - wrapButton = new Button (styleGroup, SWT.CHECK); - wrapButton.setText ("SWT.WRAP"); - separatorButton = new Button (styleGroup, SWT.CHECK); - separatorButton.setText ("SWT.SEPARATOR"); - horizontalButton = new Button (styleGroup, SWT.RADIO); - horizontalButton.setText ("SWT.HORIZONTAL"); - verticalButton = new Button (styleGroup, SWT.RADIO); - verticalButton.setText ("SWT.VERTICAL"); - Group styleSubGroup = new Group (styleGroup, SWT.NONE); - styleSubGroup.setLayout (new GridLayout ()); - shadowInButton = new Button (styleSubGroup, SWT.RADIO); - shadowInButton.setText ("SWT.SHADOW_IN"); - shadowOutButton = new Button (styleSubGroup, SWT.RADIO); - shadowOutButton.setText ("SWT.SHADOW_OUT"); - shadowNoneButton = new Button (styleSubGroup, SWT.RADIO); - shadowNoneButton.setText ("SWT.SHADOW_NONE"); - borderButton = new Button(styleGroup, SWT.CHECK); - borderButton.setText("SWT.BORDER"); - - /* Add the listeners */ - SelectionListener selectionListener = new SelectionAdapter () { - public void widgetSelected(SelectionEvent event) { - if ((event.widget.getStyle() & SWT.RADIO) != 0) { - if (!((Button) event.widget).getSelection ()) return; - } - recreateExampleWidgets (); - }; - }; - shadowInButton.addSelectionListener (selectionListener); - shadowOutButton.addSelectionListener (selectionListener); - shadowNoneButton.addSelectionListener (selectionListener); - } - - /** - * Gets the "Example" widget children. - */ - Control [] getExampleWidgets () { - return new Control [] {label1, label2, label3, label4, label5, label6}; - } - - /** - * Gets the text for the tab folder item. - */ - String getTabText () { - return "Label"; - } - - /** - * Sets the alignment of the "Example" widgets. - */ - void setExampleWidgetAlignment () { - int alignment = 0; - if (leftButton.getSelection ()) alignment = SWT.LEFT; - if (centerButton.getSelection ()) alignment = SWT.CENTER; - if (rightButton.getSelection ()) alignment = SWT.RIGHT; - label1.setAlignment (alignment); - label2.setAlignment (alignment); - label3.setAlignment (alignment); - label4.setAlignment (alignment); - label5.setAlignment (alignment); - label6.setAlignment (alignment); - } - - /** - * Sets the state of the "Example" widgets. - */ - void setExampleWidgetState () { - super.setExampleWidgetState (); - boolean isSeparator = (label1.getStyle () & SWT.SEPARATOR) != 0; - wrapButton.setSelection (!isSeparator && (label1.getStyle () & SWT.WRAP) != 0); - leftButton.setSelection (!isSeparator && (label1.getStyle () & SWT.LEFT) != 0); - centerButton.setSelection (!isSeparator && (label1.getStyle () & SWT.CENTER) != 0); - rightButton.setSelection (!isSeparator && (label1.getStyle () & SWT.RIGHT) != 0); - shadowInButton.setSelection (isSeparator && (label1.getStyle () & SWT.SHADOW_IN) != 0); - shadowOutButton.setSelection (isSeparator && (label1.getStyle () & SWT.SHADOW_OUT) != 0); - shadowNoneButton.setSelection (isSeparator && (label1.getStyle () & SWT.SHADOW_NONE) != 0); - horizontalButton.setSelection (isSeparator && (label1.getStyle () & SWT.HORIZONTAL) != 0); - verticalButton.setSelection (isSeparator && (label1.getStyle () & SWT.VERTICAL) != 0); - wrapButton.setEnabled (!isSeparator); - leftButton.setEnabled (!isSeparator); - centerButton.setEnabled (!isSeparator); - rightButton.setEnabled (!isSeparator); - shadowInButton.setEnabled (isSeparator); - shadowOutButton.setEnabled (isSeparator); - shadowNoneButton.setEnabled (isSeparator); - horizontalButton.setEnabled (isSeparator); - verticalButton.setEnabled (isSeparator); - } -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ListTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ListTab.java deleted file mode 100755 index 57af4681c8..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ListTab.java +++ /dev/null @@ -1,85 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.examples.controlexample; - - -import org.eclipse.swt.*; -import org.eclipse.swt.widgets.*; -import org.eclipse.swt.layout.*; - -class ListTab extends ScrollableTab { - - /* Example widgets and groups that contain them */ - List list1; - Group listGroup; - - static String [] ListData1 = {ControlExample.getResourceString("ListData1_0"), - ControlExample.getResourceString("ListData1_1"), - ControlExample.getResourceString("ListData1_2"), - ControlExample.getResourceString("ListData1_3"), - ControlExample.getResourceString("ListData1_4"), - ControlExample.getResourceString("ListData1_5"), - ControlExample.getResourceString("ListData1_6"), - ControlExample.getResourceString("ListData1_7"), - ControlExample.getResourceString("ListData1_8")}; - - /** - * Creates the Tab within a given instance of ControlExample. - */ - ListTab(ControlExample instance) { - super(instance); - } - - /** - * Creates the "Example" group. - */ - void createExampleGroup () { - super.createExampleGroup (); - - /* Create a group for the list */ - listGroup = new Group (exampleGroup, SWT.NONE); - listGroup.setLayout (new GridLayout ()); - listGroup.setLayoutData (new GridData (GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - listGroup.setText ("List"); - } - - /** - * Creates the "Example" widgets. - */ - void createExampleWidgets () { - - /* Compute the widget style */ - int style = getDefaultStyle(); - if (singleButton.getSelection ()) style |= SWT.SINGLE; - if (multiButton.getSelection ()) style |= SWT.MULTI; - if (horizontalButton.getSelection ()) style |= SWT.H_SCROLL; - if (verticalButton.getSelection ()) style |= SWT.V_SCROLL; - if (borderButton.getSelection ()) style |= SWT.BORDER; - - /* Create the example widgets */ - list1 = new List (listGroup, style); - list1.setItems (ListData1); - } - - /** - * Gets the "Example" widget children. - */ - Control [] getExampleWidgets () { - return new Control [] {list1}; - } - - /** - * Gets the text for the tab folder item. - */ - String getTabText () { - return "List"; - } -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ProgressBarTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ProgressBarTab.java deleted file mode 100755 index 8e03f970e0..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ProgressBarTab.java +++ /dev/null @@ -1,145 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.examples.controlexample; - - -import org.eclipse.swt.*; -import org.eclipse.swt.widgets.*; -import org.eclipse.swt.layout.*; - -class ProgressBarTab extends RangeTab { - /* Example widgets and groups that contain them */ - ProgressBar progressBar1; - Group progressBarGroup; - - /* Style widgets added to the "Style" group */ - Button smoothButton; - Button indeterminateButton; - - /** - * Creates the Tab within a given instance of ControlExample. - */ - ProgressBarTab(ControlExample instance) { - super(instance); - } - - /** - * Creates the "Example" group. - */ - void createExampleGroup() { - super.createExampleGroup (); - - /* Create a group for the progress bar */ - progressBarGroup = new Group (exampleGroup, SWT.NONE); - progressBarGroup.setLayout (new GridLayout ()); - progressBarGroup.setLayoutData (new GridData (GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - progressBarGroup.setText ("ProgressBar"); - } - - /** - * Creates the "Example" widgets. - */ - void createExampleWidgets () { - - /* Compute the widget style */ - int style = getDefaultStyle(); - if (horizontalButton.getSelection ()) style |= SWT.HORIZONTAL; - if (verticalButton.getSelection ()) style |= SWT.VERTICAL; - if (smoothButton.getSelection ()) style |= SWT.SMOOTH; - if (borderButton.getSelection ()) style |= SWT.BORDER; - if (indeterminateButton.getSelection ()) style |= SWT.INDETERMINATE; - - /* Create the example widgets */ - progressBar1 = new ProgressBar (progressBarGroup, style); - progressBar1.setMaximum (100); - progressBar1.setSelection (50); - } - - /** - * Creates the "Style" group. - */ - void createStyleGroup () { - super.createStyleGroup (); - - /* Create the extra widgets */ - smoothButton = new Button (styleGroup, SWT.CHECK); - smoothButton.setText ("SWT.SMOOTH"); - indeterminateButton = new Button (styleGroup, SWT.CHECK); - indeterminateButton.setText ("SWT.INDETERMINATE"); - } - - /** - * Gets the "Example" widget children. - */ - Control [] getExampleWidgets () { - return new Control [] {progressBar1}; - } - - /** - * Gets the text for the tab folder item. - */ - String getTabText () { - return "ProgressBar"; - } - - /** - * Sets the state of the "Example" widgets. - */ - void setExampleWidgetState () { - super.setExampleWidgetState (); - if (indeterminateButton.getSelection ()) { - selectionScale.setEnabled (false); - minimumScale.setEnabled (false); - maximumScale.setEnabled (false); - } else { - selectionScale.setEnabled (true); - minimumScale.setEnabled (true); - maximumScale.setEnabled (true); - } - maximumScale.setMaximum (progressBar1.getMaximum ()); - smoothButton.setSelection ((progressBar1.getStyle () & SWT.SMOOTH) != 0); - indeterminateButton.setSelection ((progressBar1.getStyle () & SWT.INDETERMINATE) != 0); - } - - /** - * Sets the maximum of the "Example" widgets. - */ - void setWidgetMaximum () { - progressBar1.setMaximum (maximumScale.getSelection ()); - updateScales (); - } - - /** - * Sets the minimim of the "Example" widgets. - */ - void setWidgetMinimum () { - progressBar1.setMinimum (minimumScale.getSelection ()); - updateScales (); - } - - /** - * Sets the selection of the "Example" widgets. - */ - void setWidgetSelection () { - progressBar1.setSelection (selectionScale.getSelection ()); - updateScales (); - } - - /** - * Update the scale widgets to reflect the actual value set - * on the "Example" widget. - */ - void updateScales () { - minimumScale.setSelection (progressBar1.getMinimum ()); - selectionScale.setSelection (progressBar1.getSelection ()); - maximumScale.setSelection (progressBar1.getMaximum ()); - } -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/RangeTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/RangeTab.java deleted file mode 100755 index 5662814d11..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/RangeTab.java +++ /dev/null @@ -1,183 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.examples.controlexample; - - -import org.eclipse.swt.*; -import org.eclipse.swt.widgets.*; -import org.eclipse.swt.layout.*; -import org.eclipse.swt.events.*; - -abstract class RangeTab extends Tab { - /* Style widgets added to the "Style" group */ - Button horizontalButton, verticalButton; - - /* Scale widgets added to the "Control" group */ - Scale minimumScale, selectionScale, maximumScale; - - /** - * Creates the Tab within a given instance of ControlExample. - */ - RangeTab(ControlExample instance) { - super(instance); - } - - /** - * Creates the "Control" widget children. - */ - void createControlWidgets () { - /* Create controls specific to this example */ - createMinimumGroup (); - createMaximumGroup (); - createSelectionGroup (); - } - - /** - * Create a group of widgets to control the maximum - * attribute of the example widget. - */ - void createMaximumGroup() { - - /* Create the group */ - Group maximumGroup = new Group (controlGroup, SWT.NONE); - maximumGroup.setLayout (new GridLayout ()); - maximumGroup.setText (ControlExample.getResourceString("Maximum")); - maximumGroup.setLayoutData (new GridData (GridData.FILL_HORIZONTAL)); - - /* Create a scale widget */ - maximumScale = new Scale (maximumGroup, SWT.NONE); - maximumScale.setMaximum (100); - maximumScale.setSelection (100); - maximumScale.setPageIncrement (10); - maximumScale.setIncrement (5); - - GridData data = new GridData (GridData.FILL_HORIZONTAL); - data.widthHint = 100; - maximumScale.setLayoutData (data); - - /* Add the listeners */ - maximumScale.addSelectionListener(new SelectionAdapter () { - public void widgetSelected (SelectionEvent event) { - setWidgetMaximum (); - }; - }); - } - - /** - * Create a group of widgets to control the minimum - * attribute of the example widget. - */ - void createMinimumGroup() { - - /* Create the group */ - Group minimumGroup = new Group (controlGroup, SWT.NONE); - minimumGroup.setLayout (new GridLayout ()); - minimumGroup.setText (ControlExample.getResourceString("Minimum")); - minimumGroup.setLayoutData (new GridData (GridData.FILL_HORIZONTAL)); - - /* Create a scale widget */ - minimumScale = new Scale (minimumGroup, SWT.NONE); - minimumScale.setMaximum (100); - minimumScale.setPageIncrement (10); - minimumScale.setIncrement (5); - - GridData data = new GridData (GridData.FILL_HORIZONTAL); - data.widthHint = 100; - minimumScale.setLayoutData (data); - - /* Add the listeners */ - minimumScale.addSelectionListener (new SelectionAdapter () { - public void widgetSelected (SelectionEvent event) { - setWidgetMinimum (); - }; - }); - - } - - /** - * Create a group of widgets to control the selection - * attribute of the example widget. - */ - void createSelectionGroup() { - - /* Create the group */ - Group selectionGroup = new Group(controlGroup, SWT.NONE); - selectionGroup.setLayout(new GridLayout()); - GridData gridData = new GridData(GridData.FILL_HORIZONTAL); - selectionGroup.setLayoutData(gridData); - selectionGroup.setText(ControlExample.getResourceString("Selection")); - - /* Create a scale widget */ - selectionScale = new Scale (selectionGroup, SWT.NONE); - selectionScale.setMaximum (100); - selectionScale.setSelection (50); - selectionScale.setPageIncrement (10); - selectionScale.setIncrement (5); - - GridData data = new GridData (GridData.FILL_HORIZONTAL); - data.widthHint = 100; - selectionScale.setLayoutData (data); - - /* Add the listeners */ - selectionScale.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent event) { - setWidgetSelection (); - }; - }); - - } - - /** - * Creates the "Style" group. - */ - void createStyleGroup () { - super.createStyleGroup (); - - /* Create the extra widgets */ - horizontalButton = new Button (styleGroup, SWT.RADIO); - horizontalButton.setText ("SWT.HORIZONTAL"); - verticalButton = new Button (styleGroup, SWT.RADIO); - verticalButton.setText ("SWT.VERTICAL"); - borderButton = new Button (styleGroup, SWT.CHECK); - borderButton.setText ("SWT.BORDER"); - } - - /** - * Sets the state of the "Example" widgets. - */ - void setExampleWidgetState () { - super.setExampleWidgetState (); - setWidgetMinimum (); - setWidgetMaximum (); - setWidgetSelection (); - Control [] controls = getExampleWidgets (); - if (controls.length != 0){ - horizontalButton.setSelection ((controls [0].getStyle () & SWT.HORIZONTAL) != 0); - verticalButton.setSelection ((controls [0].getStyle () & SWT.VERTICAL) != 0); - borderButton.setSelection ((controls [0].getStyle () & SWT.BORDER) != 0); - } - } - - /** - * Sets the maximum of the "Example" widgets. - */ - abstract void setWidgetMaximum (); - - /** - * Sets the minimim of the "Example" widgets. - */ - abstract void setWidgetMinimum (); - - /** - * Sets the selection of the "Example" widgets. - */ - abstract void setWidgetSelection (); -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SashFormTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SashFormTab.java deleted file mode 100644 index f28c7d28cf..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SashFormTab.java +++ /dev/null @@ -1,100 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.examples.controlexample; - - -import org.eclipse.swt.*; -import org.eclipse.swt.custom.*; -import org.eclipse.swt.layout.*; -import org.eclipse.swt.widgets.*; - -class SashFormTab extends Tab { - /* Example widgets and groups that contain them */ - SashForm fullForm, topForm; - List list1, list2, list3; - Text text; - - static String [] ListData0 = {ControlExample.getResourceString("ListData0_0"), - ControlExample.getResourceString("ListData0_1"), - ControlExample.getResourceString("ListData0_2"), - ControlExample.getResourceString("ListData0_3"), - ControlExample.getResourceString("ListData0_4"), - ControlExample.getResourceString("ListData0_5"), - ControlExample.getResourceString("ListData0_6"), - ControlExample.getResourceString("ListData0_7"), - ControlExample.getResourceString("ListData0_8")}; - - static String [] ListData1 = {ControlExample.getResourceString("ListData1_0"), - ControlExample.getResourceString("ListData1_1"), - ControlExample.getResourceString("ListData1_2"), - ControlExample.getResourceString("ListData1_3"), - ControlExample.getResourceString("ListData1_4"), - ControlExample.getResourceString("ListData1_5"), - ControlExample.getResourceString("ListData1_6"), - ControlExample.getResourceString("ListData1_7"), - ControlExample.getResourceString("ListData1_8")}; - - /* Constants */ - static final int SASH_WIDTH = 3; - - /** - * Creates the Tab within a given instance of ControlExample. - */ - SashFormTab(ControlExample instance) { - super(instance); - } - - /** - * Creates the tab folder page. - */ - Composite createTabFolderPage (TabFolder tabFolder) { - tabFolderPage = new Composite(tabFolder, SWT.BORDER); - tabFolderPage.setLayout(new FillLayout()); - - fullForm = new SashForm (tabFolderPage, SWT.HORIZONTAL); - fullForm.setLayout(new FillLayout()); - topForm = new SashForm (fullForm, SWT.VERTICAL); - topForm.setLayout(new FillLayout()); - - list1 = new List (topForm, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER); - list1.setItems (ListData0); - list2 = new List (topForm, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER); - list2.setItems (ListData1); - text = new Text (fullForm, SWT.MULTI | SWT.BORDER); - text.setText (ControlExample.getResourceString("Multi_line")); - - fullForm.setWeights(new int[] {50, 50}); - topForm.setWeights(new int[] {50, 50}); - - return tabFolderPage; - } - - /** - * Gets the "Example" widget children. - */ - Control [] getExampleWidgets () { - return new Control [] {fullForm, topForm}; - } - - /** - * Gets the text for the tab folder item. - */ - String getTabText () { - return "SashForm"; - } - - /** - * Recreates the "Example" widgets. - */ - void recreateExampleWidgets () { - // this tab does not use this framework mechanism - } -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SashTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SashTab.java deleted file mode 100755 index 98bbc1fd22..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SashTab.java +++ /dev/null @@ -1,184 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.examples.controlexample; - - -import org.eclipse.swt.*; -import org.eclipse.swt.graphics.*; -import org.eclipse.swt.widgets.*; -import org.eclipse.swt.events.*; - -class SashTab extends Tab { - /* Example widgets and groups that contain them */ - Sash hSash, vSash; - List list1, list2, list3; - Text text; - - static String [] ListData0 = {ControlExample.getResourceString("ListData0_0"), - ControlExample.getResourceString("ListData0_1"), - ControlExample.getResourceString("ListData0_2"), - ControlExample.getResourceString("ListData0_3"), - ControlExample.getResourceString("ListData0_4"), - ControlExample.getResourceString("ListData0_5"), - ControlExample.getResourceString("ListData0_6"), - ControlExample.getResourceString("ListData0_7"), - ControlExample.getResourceString("ListData0_8")}; - - static String [] ListData1 = {ControlExample.getResourceString("ListData1_0"), - ControlExample.getResourceString("ListData1_1"), - ControlExample.getResourceString("ListData1_2"), - ControlExample.getResourceString("ListData1_3"), - ControlExample.getResourceString("ListData1_4"), - ControlExample.getResourceString("ListData1_5"), - ControlExample.getResourceString("ListData1_6"), - ControlExample.getResourceString("ListData1_7"), - ControlExample.getResourceString("ListData1_8")}; - - /* Constants */ - static final int SASH_WIDTH = 3; - - /** - * Creates the Tab within a given instance of ControlExample. - */ - SashTab(ControlExample instance) { - super(instance); - } - - /** - * Creates the tab folder page. - */ - Composite createTabFolderPage (TabFolder tabFolder) { - /* - * Create the page. This example does not use layouts. - */ - tabFolderPage = new Composite(tabFolder, SWT.BORDER); - - /* Create the list and text widgets */ - list1 = new List (tabFolderPage, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER); - list1.setItems (ListData0); - list2 = new List (tabFolderPage, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER); - list2.setItems (ListData1); - text = new Text (tabFolderPage, SWT.MULTI | SWT.BORDER); - text.setText (ControlExample.getResourceString("Multi_line")); - - /* Create the sashes */ - vSash = new Sash (tabFolderPage, SWT.VERTICAL); - hSash = new Sash (tabFolderPage, SWT.HORIZONTAL); - - /* Add the listeners */ - hSash.addSelectionListener (new SelectionAdapter () { - public void widgetSelected (SelectionEvent event) { - if (event.detail != SWT.DRAG) { - hSash.setBounds (event.x, event.y, event.width, event.height); - layout (); - } - } - }); - vSash.addSelectionListener (new SelectionAdapter () { - public void widgetSelected (SelectionEvent event) { - if (event.detail != SWT.DRAG) { - vSash.setBounds(event.x, event.y, event.width, event.height); - layout (); - } - } - }); - tabFolderPage.addControlListener (new ControlAdapter () { - public void controlResized (ControlEvent event) { - shellResized (); - } - }); - - /* - * Do not set the bounds of the lists, text and sashes here - * because this method is run before the widget is opened - * so we do not know how big the tabComposite is going to be. - * When the widget is opened a resize event will occur - * and the contained widgets can be sized accordingly. - */ - return tabFolderPage; - } - - /** - * Gets the "Example" widget children. - */ - Control [] getExampleWidgets () { - return new Control [] {hSash, vSash}; - } - - /** - * Gets the text for the tab folder item. - */ - String getTabText () { - return "Sash"; - } - - /** - * Layout the list and text widgets according to the new - * positions of the sashes..events.SelectionEvent - */ - void layout () { - - Rectangle tabCompositeBounds = tabFolderPage.getClientArea (); - Rectangle hSashBounds = hSash.getBounds (); - Rectangle vSashBounds = vSash.getBounds (); - - list1.setBounds (0, 0, vSashBounds.x, hSashBounds.y); - list2.setBounds (vSashBounds.x + vSashBounds.width, 0, tabCompositeBounds.width - (vSashBounds.x + vSashBounds.width), hSashBounds.y); - text.setBounds (0, hSashBounds.y + hSashBounds.height, tabCompositeBounds.width, tabCompositeBounds.height - (hSashBounds.y + hSashBounds.height)); - - /** - * If the horizontal sash has been moved then the vertical - * sash is either too long or too short and its size must - * be adjusted. - */ - vSashBounds.height = hSashBounds.y; - vSash.setBounds (vSashBounds); - } - - /** - * Recreates the "Example" widgets. - */ - void recreateExampleWidgets () { - // this tab does not use this framework mechanism - } - - /** - * Handle the shell resized event. - */ - void shellResized () { - - /* Get the client area for the shell */ - Rectangle tabFolderPageBounds = tabFolderPage.getClientArea (); - - /* - * Make list 1 half the width and half the height of the tab leaving room for the sash. - * Place list 1 in the top left quadrant of the tab. - */ - Rectangle list1Bounds = new Rectangle (0, 0, (tabFolderPageBounds.width - SASH_WIDTH) / 2, (tabFolderPageBounds.height - SASH_WIDTH) / 2); - list1.setBounds (list1Bounds); - - /* - * Make list 2 half the width and half the height of the tab leaving room for the sash. - * Place list 2 in the top right quadrant of the tab. - */ - list2.setBounds (list1Bounds.width + SASH_WIDTH, 0, tabFolderPageBounds.width - (list1Bounds.width + SASH_WIDTH), list1Bounds.height); - - /* - * Make the text area the full width and half the height of the tab leaving room for the sash. - * Place the text area in the bottom half of the tab. - */ - text.setBounds (0, list1Bounds.height + SASH_WIDTH, tabFolderPageBounds.width, tabFolderPageBounds.height - (list1Bounds.height + SASH_WIDTH)); - - /* Position the sashes */ - vSash.setBounds (list1Bounds.width, 0, SASH_WIDTH, list1Bounds.height); - hSash.setBounds (0, list1Bounds.height, tabFolderPageBounds.width, SASH_WIDTH); - } -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ScrollableTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ScrollableTab.java deleted file mode 100755 index dd0b4a24bd..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ScrollableTab.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.examples.controlexample; - - -import org.eclipse.swt.*; -import org.eclipse.swt.widgets.*; - -abstract class ScrollableTab extends Tab { - /* Style widgets added to the "Style" group */ - Button singleButton, multiButton, horizontalButton, verticalButton, borderButton; - - /** - * Creates the Tab within a given instance of ControlExample. - */ - ScrollableTab(ControlExample instance) { - super(instance); - } - - /** - * Creates the "Style" group. - */ - void createStyleGroup () { - super.createStyleGroup (); - - /* Create the extra widgets */ - singleButton = new Button (styleGroup, SWT.RADIO); - singleButton.setText ("SWT.SINGLE"); - multiButton = new Button (styleGroup, SWT.RADIO); - multiButton.setText ("SWT.MULTI"); - horizontalButton = new Button (styleGroup, SWT.CHECK); - horizontalButton.setText ("SWT.H_SCROLL"); - horizontalButton.setSelection(true); - verticalButton = new Button (styleGroup, SWT.CHECK); - verticalButton.setText ("SWT.V_SCROLL"); - verticalButton.setSelection(true); - borderButton = new Button (styleGroup, SWT.CHECK); - borderButton.setText ("SWT.BORDER"); - } - - /** - * Sets the state of the "Example" widgets. - */ - void setExampleWidgetState () { - super.setExampleWidgetState (); - Control [] controls = getExampleWidgets (); - if (controls.length != 0){ - singleButton.setSelection ((controls [0].getStyle () & SWT.SINGLE) != 0); - multiButton.setSelection ((controls [0].getStyle () & SWT.MULTI) != 0); - horizontalButton.setSelection ((controls [0].getStyle () & SWT.H_SCROLL) != 0); - verticalButton.setSelection ((controls [0].getStyle () & SWT.V_SCROLL) != 0); - borderButton.setSelection ((controls [0].getStyle () & SWT.BORDER) != 0); - } - } -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ShellTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ShellTab.java deleted file mode 100755 index d566d1f364..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ShellTab.java +++ /dev/null @@ -1,292 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.examples.controlexample; - - -import org.eclipse.swt.*; -import org.eclipse.swt.widgets.*; -import org.eclipse.swt.layout.*; -import org.eclipse.swt.events.*; - -class ShellTab extends Tab { - /* Style widgets added to the "Style" group */ - Button noParentButton, parentButton; - Button noTrimButton, closeButton, titleButton, minButton, maxButton, borderButton, resizeButton, onTopButton; - Button createButton, closeAllButton; - Button modelessButton, primaryModalButton, applicationModalButton, systemModalButton; - Group parentStyleGroup, modalStyleGroup; - - /* Variables used to track the open shells */ - int shellCount = 0; - Shell [] shells = new Shell [4]; - - /** - * Creates the Tab within a given instance of ControlExample. - */ - ShellTab(ControlExample instance) { - super(instance); - } - - /** - * Close all the example shells. - */ - void closeAllShells() { - for (int i = 0; i= shells.length) { - Shell [] newShells = new Shell [shells.length + 4]; - System.arraycopy (shells, 0, newShells, 0, shells.length); - shells = newShells; - } - - /* Compute the shell style */ - int style = SWT.NONE; - if (noTrimButton.getSelection()) style |= SWT.NO_TRIM; - if (closeButton.getSelection()) style |= SWT.CLOSE; - if (titleButton.getSelection()) style |= SWT.TITLE; - if (minButton.getSelection()) style |= SWT.MIN; - if (maxButton.getSelection()) style |= SWT.MAX; - if (borderButton.getSelection()) style |= SWT.BORDER; - if (resizeButton.getSelection()) style |= SWT.RESIZE; - if (onTopButton.getSelection()) style |= SWT.ON_TOP; - if (modelessButton.getSelection()) style |= SWT.MODELESS; - if (primaryModalButton.getSelection()) style |= SWT.PRIMARY_MODAL; - if (applicationModalButton.getSelection()) style |= SWT.APPLICATION_MODAL; - if (systemModalButton.getSelection()) style |= SWT.SYSTEM_MODAL; - - /* Create the shell with or without a parent */ - if (noParentButton.getSelection ()) { - shells [shellCount] = new Shell (style); - } else { - Shell shell = tabFolderPage.getShell (); - shells [shellCount] = new Shell (shell, style); - } - final Shell currentShell = shells [shellCount]; - Button button = new Button(currentShell, SWT.PUSH); - button.setBounds(20, 20, 120, 30); - Button closeButton = new Button(currentShell, SWT.PUSH); - closeButton.setBounds(160, 20, 120, 30); - closeButton.setText(ControlExample.getResourceString("Close")); - closeButton.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event event) { - currentShell.dispose(); - } - }); - - /* Set the size, title and open the shell */ - currentShell.setSize (300, 100); - currentShell.setText (ControlExample.getResourceString("Title") + shellCount); - hookListeners (currentShell); - currentShell.open (); - shellCount++; - } - - /** - * Creates the "Control" group. - */ - void createControlGroup () { - /* - * Create the "Control" group. This is the group on the - * left half of each example tab. It consists of the - * style group, the display group and the size group. - */ - controlGroup = new Group (tabFolderPage, SWT.NONE); - GridLayout gridLayout= new GridLayout (); - controlGroup.setLayout (gridLayout); - gridLayout.numColumns = 1; - gridLayout.makeColumnsEqualWidth = true; - controlGroup.setLayoutData (new GridData (GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - controlGroup.setText (ControlExample.getResourceString("Parameters")); - - /* Create individual groups inside the "Control" group */ - styleGroup = new Group (controlGroup, SWT.NONE); - gridLayout = new GridLayout (); - styleGroup.setLayout (gridLayout); - gridLayout.numColumns = 2; - gridLayout.makeColumnsEqualWidth = true; - styleGroup.setLayoutData (new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - styleGroup.setText (ControlExample.getResourceString("Styles")); - - /* Create a group for the parent style controls */ - parentStyleGroup = new Group (styleGroup, SWT.NONE); - parentStyleGroup.setLayout (new GridLayout ()); - GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - parentStyleGroup.setLayoutData (gridData); - parentStyleGroup.setText (ControlExample.getResourceString("Parent")); - } - - /** - * Creates the "Control" widget children. - */ - void createControlWidgets () { - - /* Create the parent style buttons */ - noParentButton = new Button (parentStyleGroup, SWT.RADIO); - noParentButton.setText (ControlExample.getResourceString("No_Parent")); - parentButton = new Button (parentStyleGroup, SWT.RADIO); - parentButton.setText (ControlExample.getResourceString("Parent")); - - /* Create a group for the decoration style controls */ - Group decorationStyleGroup = new Group(styleGroup, SWT.NONE); - decorationStyleGroup.setLayout (new GridLayout ()); - GridData gridData = new GridData (GridData.HORIZONTAL_ALIGN_FILL); - gridData.verticalSpan = 2; - decorationStyleGroup.setLayoutData (gridData); - decorationStyleGroup.setText (ControlExample.getResourceString("Decoration_Styles")); - - /* Create the decoration style buttons */ - noTrimButton = new Button (decorationStyleGroup, SWT.CHECK); - noTrimButton.setText ("SWT.NO_TRIM"); - closeButton = new Button (decorationStyleGroup, SWT.CHECK); - closeButton.setText ("SWT.CLOSE"); - titleButton = new Button (decorationStyleGroup, SWT.CHECK); - titleButton.setText ("SWT.TITLE"); - minButton = new Button (decorationStyleGroup, SWT.CHECK); - minButton.setText ("SWT.MIN"); - maxButton = new Button (decorationStyleGroup, SWT.CHECK); - maxButton.setText ("SWT.MAX"); - borderButton = new Button (decorationStyleGroup, SWT.CHECK); - borderButton.setText ("SWT.BORDER"); - resizeButton = new Button (decorationStyleGroup, SWT.CHECK); - resizeButton.setText ("SWT.RESIZE"); - onTopButton = new Button (decorationStyleGroup, SWT.CHECK); - onTopButton.setText ("SWT.ON_TOP"); - - /* Create a group for the modal style controls */ - modalStyleGroup = new Group (styleGroup, SWT.NONE); - modalStyleGroup.setLayout (new GridLayout ()); - modalStyleGroup.setText (ControlExample.getResourceString("Modal_Styles")); - gridData = new GridData (); - gridData.verticalAlignment = GridData.FILL; - modalStyleGroup.setLayoutData(gridData); - - /* Create the modal style buttons */ - modelessButton = new Button (modalStyleGroup, SWT.RADIO); - modelessButton.setText ("SWT.MODELESS"); - primaryModalButton = new Button (modalStyleGroup, SWT.RADIO); - primaryModalButton.setText ("SWT.PRIMARY_MODAL"); - applicationModalButton = new Button (modalStyleGroup, SWT.RADIO); - applicationModalButton.setText ("SWT.APPLICATION_MODAL"); - systemModalButton = new Button (modalStyleGroup, SWT.RADIO); - systemModalButton.setText ("SWT.SYSTEM_MODAL"); - - /* Create the "create" and "closeAll" buttons */ - createButton = new Button (styleGroup, SWT.NONE); - gridData = new GridData (GridData.HORIZONTAL_ALIGN_END); - createButton.setLayoutData (gridData); - createButton.setText (ControlExample.getResourceString("Create_Shell")); - closeAllButton = new Button (styleGroup, SWT.NONE); - gridData = new GridData (GridData.HORIZONTAL_ALIGN_BEGINNING); - closeAllButton.setText (ControlExample.getResourceString("Close_All_Shells")); - closeAllButton.setLayoutData (gridData); - - /* Add the listeners */ - createButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - createButtonSelected(e); - }; - }); - closeAllButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - closeAllShells (); - }; - }); - SelectionListener decorationButtonListener = new SelectionAdapter() { - public void widgetSelected(SelectionEvent event) { - decorationButtonSelected(event); - }; - }; - noTrimButton.addSelectionListener (decorationButtonListener); - closeButton.addSelectionListener (decorationButtonListener); - titleButton.addSelectionListener (decorationButtonListener); - minButton.addSelectionListener (decorationButtonListener); - maxButton.addSelectionListener (decorationButtonListener); - borderButton.addSelectionListener (decorationButtonListener); - resizeButton.addSelectionListener (decorationButtonListener); - applicationModalButton.addSelectionListener (decorationButtonListener); - systemModalButton.addSelectionListener (decorationButtonListener); - - /* Set the default state */ - noParentButton.setSelection (true); - modelessButton.setSelection (true); - } - - /** - * Handle a decoration button selection event. - * - * @param event org.eclipse.swt.events.SelectionEvent - */ - public void decorationButtonSelected(SelectionEvent event) { - - /* Make sure if the modal style is SWT.APPLICATION_MODAL or - * SWT.SYSTEM_MODAL the style SWT.CLOSE is also selected. - * This is to make sure the user can close the shell. - */ - Button widget = (Button) event.widget; - if (widget == applicationModalButton || widget == systemModalButton) { - if (widget.getSelection()) { - closeButton.setSelection (true); - noTrimButton.setSelection (false); - } - return; - } - if (widget == closeButton) { - if (applicationModalButton.getSelection() || systemModalButton.getSelection()) { - closeButton.setSelection (true); - } - } - /* - * Make sure if the No Trim button is selected then - * all other decoration buttons are deselected. - */ - if (widget.getSelection() && widget != noTrimButton) { - noTrimButton.setSelection (false); - return; - } - if (widget.getSelection() && widget == noTrimButton) { - if (applicationModalButton.getSelection() || systemModalButton.getSelection()) { - noTrimButton.setSelection (false); - return; - } - closeButton.setSelection (false); - titleButton.setSelection (false); - minButton.setSelection (false); - maxButton.setSelection (false); - borderButton.setSelection (false); - resizeButton.setSelection (false); - return; - } - } - - /** - * Gets the text for the tab folder item. - */ - String getTabText () { - return "Shell"; - } -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SliderTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SliderTab.java deleted file mode 100755 index 00be184c4d..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SliderTab.java +++ /dev/null @@ -1,253 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.examples.controlexample; - - -import org.eclipse.swt.*; -import org.eclipse.swt.widgets.*; -import org.eclipse.swt.layout.*; -import org.eclipse.swt.events.*; - -class SliderTab extends RangeTab { - /* Example widgets and groups that contain them */ - Scale scale1; - Slider slider1; - Group sliderGroup, scaleGroup; - - /* Scale widgets added to the "Control" group */ - Scale incrementScale, pageIncrementScale, thumbScale; - - /** - * Creates the Tab within a given instance of ControlExample. - */ - SliderTab(ControlExample instance) { - super(instance); - } - - /** - * Creates the "Control" widget children. - */ - void createControlWidgets () { - super.createControlWidgets (); - createThumbGroup (); - createIncrementGroup (); - createPageIncrementGroup (); - } - - /** - * Creates the "Example" group. - */ - void createExampleGroup () { - super.createExampleGroup (); - - /* Create a group for the slider */ - sliderGroup = new Group (exampleGroup, SWT.NONE); - sliderGroup.setLayout (new GridLayout ()); - sliderGroup.setLayoutData (new GridData (GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - sliderGroup.setText ("Slider"); - - /* Create a group for the scale */ - scaleGroup = new Group (exampleGroup, SWT.NONE); - scaleGroup.setLayout (new GridLayout ()); - scaleGroup.setLayoutData (new GridData (GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - scaleGroup.setText ("Scale"); - - } - - /** - * Creates the "Example" widgets. - */ - void createExampleWidgets () { - - /* Compute the widget style */ - int style = getDefaultStyle(); - if (horizontalButton.getSelection ()) style |= SWT.HORIZONTAL; - if (verticalButton.getSelection ()) style |= SWT.VERTICAL; - if (borderButton.getSelection ()) style |= SWT.BORDER; - - /* Create the example widgets */ - scale1 = new Scale (scaleGroup, style); - scale1.setMaximum (100); - scale1.setSelection (50); - scale1.setIncrement (5); - scale1.setPageIncrement (10); - slider1 = new Slider(sliderGroup, style); - slider1.setMaximum (100); - slider1.setSelection (50); - slider1.setIncrement(5); - slider1.setPageIncrement (10); - slider1.setThumb (10); - } - - /** - * Create a group of widgets to control the increment - * attribute of the example widget. - */ - void createIncrementGroup() { - - /* Create the group */ - Group incrementGroup = new Group (controlGroup, SWT.NONE); - incrementGroup.setLayout (new GridLayout ()); - incrementGroup.setText (ControlExample.getResourceString("Increment")); - incrementGroup.setLayoutData (new GridData (GridData.FILL_HORIZONTAL)); - - /* Create the scale widget */ - incrementScale = new Scale (incrementGroup, SWT.NONE); - incrementScale.setMaximum (100); - incrementScale.setSelection (5); - incrementScale.setPageIncrement (10); - incrementScale.setIncrement (5); - - GridData data = new GridData (GridData.FILL_HORIZONTAL); - data.widthHint = 100; - incrementScale.setLayoutData (data); - - /* Add the listeners */ - incrementScale.addSelectionListener (new SelectionAdapter () { - public void widgetSelected (SelectionEvent e) { - setWidgetIncrement (); - }; - }); - } - - /** - * Create a group of widgets to control the page increment - * attribute of the example widget. - */ - void createPageIncrementGroup() { - - /* Create the group */ - Group pageIncrementGroup = new Group (controlGroup, SWT.NONE); - pageIncrementGroup.setLayout (new GridLayout ()); - pageIncrementGroup.setText (ControlExample.getResourceString("Page_Increment")); - pageIncrementGroup.setLayoutData (new GridData (GridData.FILL_HORIZONTAL)); - - /* Create the scale widget */ - pageIncrementScale = new Scale (pageIncrementGroup, SWT.NONE); - pageIncrementScale.setMaximum (100); - pageIncrementScale.setSelection (10); - pageIncrementScale.setPageIncrement (10); - pageIncrementScale.setIncrement (5); - - GridData data = new GridData (GridData.FILL_HORIZONTAL); - data.widthHint = 100; - pageIncrementScale.setLayoutData (data); - - /* Add the listeners */ - pageIncrementScale.addSelectionListener (new SelectionAdapter () { - public void widgetSelected (SelectionEvent event) { - setWidgetPageIncrement (); - } - }); - } - - /** - * Create a group of widgets to control the thumb - * attribute of the example widget. - */ - void createThumbGroup() { - - /* Create the group */ - Group thumbGroup = new Group (controlGroup, SWT.NONE); - thumbGroup.setLayout (new GridLayout ()); - thumbGroup.setText (ControlExample.getResourceString("Thumb")); - thumbGroup.setLayoutData (new GridData (GridData.FILL_HORIZONTAL)); - - /* Create the scale widget */ - thumbScale = new Scale (thumbGroup, SWT.NONE); - thumbScale.setMaximum (100); - thumbScale.setSelection (10); - thumbScale.setPageIncrement (10); - thumbScale.setIncrement (5); - - GridData data = new GridData (GridData.FILL_HORIZONTAL); - data.widthHint = 100; - thumbScale.setLayoutData (data); - - /* Add the listeners */ - thumbScale.addSelectionListener (new SelectionAdapter () { - public void widgetSelected (SelectionEvent event) { - setWidgetThumb (); - }; - }); - } - - /** - * Gets the "Example" widget children. - */ - Control [] getExampleWidgets () { - return new Control [] {scale1, slider1}; - } - - /** - * Gets the text for the tab folder item. - */ - String getTabText () { - return "Slider/Scale"; - } - - /** - * Sets the state of the "Example" widgets. - */ - void setExampleWidgetState () { - super.setExampleWidgetState (); - setWidgetIncrement (); - setWidgetPageIncrement (); - setWidgetThumb (); - } - - /** - * Sets the increment of the "Example" widgets. - */ - void setWidgetIncrement () { - slider1.setIncrement (incrementScale.getSelection ()); - scale1.setIncrement (incrementScale.getSelection ()); - } - - /** - * Sets the minimim of the "Example" widgets. - */ - void setWidgetMaximum () { - slider1.setMaximum (maximumScale.getSelection ()); - scale1.setMaximum (maximumScale.getSelection ()); - } - - /** - * Sets the minimim of the "Example" widgets. - */ - void setWidgetMinimum () { - slider1.setMinimum (minimumScale.getSelection ()); - scale1.setMinimum (minimumScale.getSelection ()); - } - - /** - * Sets the page increment of the "Example" widgets. - */ - void setWidgetPageIncrement () { - slider1.setPageIncrement (pageIncrementScale.getSelection ()); - scale1.setPageIncrement (pageIncrementScale.getSelection ()); - } - - /** - * Sets the selection of the "Example" widgets. - */ - void setWidgetSelection () { - slider1.setSelection (selectionScale.getSelection ()); - scale1.setSelection (selectionScale.getSelection ()); - } - - /** - * Sets the thumb of the "Example" widgets. - */ - void setWidgetThumb () { - slider1.setThumb (thumbScale.getSelection ()); - } -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/StyledTextTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/StyledTextTab.java deleted file mode 100644 index 233c336d15..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/StyledTextTab.java +++ /dev/null @@ -1,244 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.examples.controlexample; - - -import org.eclipse.swt.*; -import org.eclipse.swt.graphics.*; -import org.eclipse.swt.widgets.*; -import org.eclipse.swt.layout.*; -import org.eclipse.swt.events.*; -import org.eclipse.swt.custom.*; - -class StyledTextTab extends ScrollableTab { - /* Example widgets and groups that contain them */ - StyledText styledText; - Group styledTextGroup, styledTextStyleGroup; - - /* Style widgets added to the "Style" group */ - Button wrapButton, readOnlyButton, fullSelectionButton; - - /* Buttons for adding StyleRanges to StyledText */ - Button boldButton, redButton, yellowButton; - Image boldImage, redImage, yellowImage; - - /** - * Creates the Tab within a given instance of ControlExample. - */ - StyledTextTab(ControlExample instance) { - super(instance); - } - - /** - * Creates a bitmap image. - */ - Image createBitmapImage (Display display, String name) { - ImageData source = new ImageData(ControlExample.class.getResourceAsStream(name + ".bmp")); - ImageData mask = new ImageData(ControlExample.class.getResourceAsStream(name + "_mask.bmp")); - return new Image (display, source, mask); - } - - /** - * Creates the "Control" widget children. - */ - void createControlWidgets () { - super.createControlWidgets (); - - /* Add a group for modifying the StyledText widget */ - createStyledTextStyleGroup (); - } - - /** - * Creates the "Example" group. - */ - void createExampleGroup () { - super.createExampleGroup (); - - /* Create a group for the styled text widget */ - styledTextGroup = new Group (exampleGroup, SWT.NONE); - styledTextGroup.setLayout (new GridLayout ()); - styledTextGroup.setLayoutData (new GridData (GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - styledTextGroup.setText ("StyledText"); - } - - /** - * Creates the "Example" widgets. - */ - void createExampleWidgets () { - - /* Compute the widget style */ - int style = getDefaultStyle(); - if (singleButton.getSelection ()) style |= SWT.SINGLE; - if (multiButton.getSelection ()) style |= SWT.MULTI; - if (horizontalButton.getSelection ()) style |= SWT.H_SCROLL; - if (verticalButton.getSelection ()) style |= SWT.V_SCROLL; - if (wrapButton.getSelection ()) style |= SWT.WRAP; - if (readOnlyButton.getSelection ()) style |= SWT.READ_ONLY; - if (borderButton.getSelection ()) style |= SWT.BORDER; - if (fullSelectionButton.getSelection ()) style |= SWT.FULL_SELECTION; - - /* Create the example widgets */ - styledText = new StyledText (styledTextGroup, style); - styledText.setText (ControlExample.getResourceString("Example_string")); - styledText.append ("\n"); - styledText.append (ControlExample.getResourceString("One_Two_Three")); - } - - /** - * Creates the "Style" group. - */ - void createStyleGroup() { - super.createStyleGroup(); - - /* Create the extra widgets */ - wrapButton = new Button (styleGroup, SWT.CHECK); - wrapButton.setText ("SWT.WRAP"); - readOnlyButton = new Button (styleGroup, SWT.CHECK); - readOnlyButton.setText ("SWT.READ_ONLY"); - fullSelectionButton = new Button (styleGroup, SWT.CHECK); - fullSelectionButton.setText ("SWT.FULL_SELECTION"); - } - - /** - * Creates the "StyledText Style" group. - */ - void createStyledTextStyleGroup () { - final Display display = controlGroup.getDisplay (); - styledTextStyleGroup = new Group (controlGroup, SWT.NONE); - styledTextStyleGroup.setText (ControlExample.getResourceString ("StyledText_Styles")); - styledTextStyleGroup.setLayout (new GridLayout(2, false)); - styledTextStyleGroup.setLayoutData (new GridData (GridData.HORIZONTAL_ALIGN_FILL)); - - /* Get images */ - boldImage = createBitmapImage (display, "bold"); - redImage = createBitmapImage (display, "red"); - yellowImage = createBitmapImage (display, "yellow"); - - /* Create controls to modify the StyledText */ - Label label = new Label (styledTextStyleGroup, SWT.NONE); - label.setText (ControlExample.getResourceString ("StyledText_Style_Instructions")); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 2; - label.setLayoutData(data); - new Label (styledTextStyleGroup, SWT.NONE).setText (ControlExample.getResourceString ("Bold")); - boldButton = new Button (styledTextStyleGroup, SWT.PUSH); - boldButton.setImage (boldImage); - boldButton.addSelectionListener(new SelectionAdapter () { - public void widgetSelected (SelectionEvent e) { - Point sel = styledText.getSelectionRange(); - if ((sel == null) || (sel.y == 0)) return; - StyleRange style; - for (int i = sel.x; iTab is the abstract superclass of every page - * in the example's tab folder. Each page in the tab folder - * describes a control. - * - * A Tab itself is not a control but instead provides a - * hierarchy with which to share code that is common to - * every page in the folder. - * - * A typical page in a Tab contains a two column composite. - * The left column contains the "Example" group. The right - * column contains "Control" group. The "Control" group - * contains controls that allow the user to interact with - * the example control. The "Control" group typically - * contains a "Style", "Other" and "Size" group. Subclasses - * can override these defaults to augment a group or stop - * a group from being created. - */ -abstract class Tab { - /* Common control buttons */ - Button borderButton, enabledButton, visibleButton; - Button preferredButton, tooSmallButton, smallButton, largeButton, fillButton; - - /* Common groups and composites */ - Composite tabFolderPage; - Group exampleGroup, controlGroup, listenersGroup, otherGroup, sizeGroup, styleGroup, colorGroup; - - /* Controlling instance */ - final ControlExample instance; - - /* Sizing constants for the "Size" group */ - static final int TOO_SMALL_SIZE = 10; - static final int SMALL_SIZE = 50; - static final int LARGE_SIZE = 100; - - /* Right-to-left support */ - static final boolean RTL_SUPPORT_ENABLE = false; - Group orientationGroup; - Button rtlButton, ltrButton, defaultOrietationButton; - - /* Controls and resources for the "Colors" group */ - Button foregroundButton, backgroundButton, fontButton; - Image foregroundImage, backgroundImage; - Color foregroundColor, backgroundColor; - Font font; - - /* Event logging variables and controls */ - Text eventConsole; - boolean logging = false; - boolean [] eventsFilter; - - static final String [] EVENT_NAMES = { - "KeyDown", "KeyUp", - "MouseDown", "MouseUp", "MouseMove", "MouseEnter", "MouseExit", "MouseDoubleClick", - "Paint", "Move", "Resize", "Dispose", - "Selection", "DefaultSelection", - "FocusIn", "FocusOut", - "Expand", "Collapse", - "Iconify", "Deiconify", "Close", - "Show", "Hide", - "Modify", "Verify", - "Activate", "Deactivate", - "Help", "DragDetect", "Arm", "Traverse", "MouseHover", - "HardKeyDown", "HardKeyUp", - "MenuDetect" - }; - - /** - * Creates the Tab within a given instance of ControlExample. - */ - Tab(ControlExample instance) { - this.instance = instance; - } - - /** - * Creates the "Control" group. The "Control" group - * is typically the right hand column in the tab. - */ - void createControlGroup () { - - /* - * Create the "Control" group. This is the group on the - * right half of each example tab. It consists of the - * "Style" group, the "Other" group and the "Size" group. - */ - controlGroup = new Group (tabFolderPage, SWT.NONE); - controlGroup.setLayout (new GridLayout (2, true)); - controlGroup.setLayoutData (new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - controlGroup.setText (ControlExample.getResourceString("Parameters")); - - /* Create individual groups inside the "Control" group */ - createStyleGroup (); - createOtherGroup (); - createSizeGroup (); - createColorGroup (); - if (RTL_SUPPORT_ENABLE) { - createOrientationGroup (); - } - - /* - * For each Button child in the style group, add a selection - * listener that will recreate the example controls. If the - * style group button is a RADIO button, ensure that the radio - * button is selected before recreating the example controls. - * When the user selects a RADIO button, the current RADIO - * button in the group is deselected and the new RADIO button - * is selected automatically. The listeners are notified for - * both these operations but typically only do work when a RADIO - * button is selected. - */ - SelectionListener selectionListener = new SelectionAdapter () { - public void widgetSelected (SelectionEvent event) { - if ((event.widget.getStyle () & SWT.RADIO) != 0) { - if (!((Button) event.widget).getSelection ()) return; - } - recreateExampleWidgets (); - }; - }; - Control [] children = styleGroup.getChildren (); - for (int i=0; i 0) oldColor = controls [0].getForeground (); - } - if (oldColor != null) foregroundDialog.setRGB(oldColor.getRGB()); // seed dialog with current color - RGB rgb = foregroundDialog.open(); - if (rgb == null) return; - oldColor = foregroundColor; // save old foreground color to dispose when done - foregroundColor = new Color (event.display, rgb); - setExampleWidgetForeground (); - if (oldColor != null) oldColor.dispose (); - } - }); - backgroundButton.setImage(backgroundImage); // sets the size of the button - backgroundButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent event) { - Color oldColor = backgroundColor; - if (oldColor == null) { - Control [] controls = getExampleWidgets (); - if (controls.length > 0) oldColor = controls [0].getBackground (); // seed dialog with current color - } - if (oldColor != null) backgroundDialog.setRGB(oldColor.getRGB()); - RGB rgb = backgroundDialog.open(); - if (rgb == null) return; - oldColor = backgroundColor; // save old background color to dispose when done - backgroundColor = new Color (event.display, rgb); - setExampleWidgetBackground (); - if (oldColor != null) oldColor.dispose (); - } - }); - fontButton.addSelectionListener(new SelectionAdapter () { - public void widgetSelected (SelectionEvent event) { - Font oldFont = font; - if (oldFont == null) { - Control [] controls = getExampleWidgets (); - if (controls.length > 0) oldFont = controls [0].getFont (); - } - if (oldFont != null) fontDialog.setFontList(oldFont.getFontData()); // seed dialog with current font - FontData fontData = fontDialog.open (); - if (fontData == null) return; - oldFont = font; // dispose old font when done - font = new Font (event.display, fontData); - setExampleWidgetFont (); - setExampleWidgetSize (); - if (oldFont != null) oldFont.dispose (); - } - }); - defaultsButton.addSelectionListener(new SelectionAdapter () { - public void widgetSelected (SelectionEvent e) { - resetColorsAndFonts (); - } - }); - shell.addDisposeListener(new DisposeListener() { - public void widgetDisposed(DisposeEvent event) { - if (foregroundImage != null) foregroundImage.dispose(); - if (backgroundImage != null) backgroundImage.dispose(); - if (foregroundColor != null) foregroundColor.dispose(); - if (backgroundColor != null) backgroundColor.dispose(); - if (font != null) font.dispose(); - foregroundColor = null; - backgroundColor = null; - font = null; - } - }); - } - - /** - * Creates the "Other" group. This is typically - * a child of the "Control" group. - */ - void createOtherGroup () { - /* Create the group */ - otherGroup = new Group (controlGroup, SWT.NONE); - otherGroup.setLayout (new GridLayout ()); - otherGroup.setLayoutData (new GridData (GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - otherGroup.setText (ControlExample.getResourceString("Other")); - - /* Create the controls */ - enabledButton = new Button(otherGroup, SWT.CHECK); - enabledButton.setText(ControlExample.getResourceString("Enabled")); - visibleButton = new Button(otherGroup, SWT.CHECK); - visibleButton.setText(ControlExample.getResourceString("Visible")); - - /* Add the listeners */ - enabledButton.addSelectionListener (new SelectionAdapter () { - public void widgetSelected (SelectionEvent event) { - setExampleWidgetEnabled (); - } - }); - visibleButton.addSelectionListener (new SelectionAdapter () { - public void widgetSelected (SelectionEvent event) { - setExampleWidgetVisibility (); - } - }); - - /* Set the default state */ - enabledButton.setSelection(true); - visibleButton.setSelection(true); - } - - /** - * Create the event console popup menu. - */ - void createEventConsolePopup () { - Menu popup = new Menu (eventConsole.getShell (), SWT.POP_UP); - eventConsole.setMenu (popup); - - MenuItem cut = new MenuItem (popup, SWT.PUSH); - cut.setText (ControlExample.getResourceString("MenuItem_Cut")); - cut.addListener (SWT.Selection, new Listener () { - public void handleEvent (Event event) { - eventConsole.cut (); - } - }); - MenuItem copy = new MenuItem (popup, SWT.PUSH); - copy.setText (ControlExample.getResourceString("MenuItem_Copy")); - copy.addListener (SWT.Selection, new Listener () { - public void handleEvent (Event event) { - eventConsole.copy (); - } - }); - MenuItem paste = new MenuItem (popup, SWT.PUSH); - paste.setText (ControlExample.getResourceString("MenuItem_Paste")); - paste.addListener (SWT.Selection, new Listener () { - public void handleEvent (Event event) { - eventConsole.paste (); - } - }); - new MenuItem (popup, SWT.SEPARATOR); - MenuItem selectAll = new MenuItem (popup, SWT.PUSH); - selectAll.setText(ControlExample.getResourceString("MenuItem_SelectAll")); - selectAll.addListener (SWT.Selection, new Listener () { - public void handleEvent (Event event) { - eventConsole.selectAll (); - } - }); - } - - /** - * Creates the "Example" group. The "Example" group - * is typically the left hand column in the tab. - */ - void createExampleGroup () { - exampleGroup = new Group (tabFolderPage, SWT.NONE); - GridLayout gridLayout = new GridLayout (); - exampleGroup.setLayout (gridLayout); - exampleGroup.setLayoutData (new GridData (GridData.FILL_BOTH)); - } - - /** - * Creates the "Example" widget children of the "Example" group. - * Subclasses override this method to create the particular - * example control. - */ - void createExampleWidgets () { - /* Do nothing */ - } - - /** - * Creates and opens the "Listener selection" dialog. - */ - void createListenerSelectionDialog () { - final Shell dialog = new Shell (tabFolderPage.getShell (), SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL); - dialog.setText (ControlExample.getResourceString ("Select_Listeners")); - dialog.setLayout (new GridLayout (2, false)); - final Table table = new Table (dialog, SWT.BORDER | SWT.V_SCROLL | SWT.CHECK); - GridData data = new GridData(GridData.FILL_BOTH); - data.verticalSpan = 2; - table.setLayoutData(data); - for (int i = 0; i < EVENT_NAMES.length; i++) { - TableItem item = new TableItem (table, SWT.NONE); - item.setText (EVENT_NAMES[i]); - item.setChecked (eventsFilter[i]); - } - final String [] customNames = getCustomEventNames (); - for (int i = 0; i < customNames.length; i++) { - TableItem item = new TableItem (table, SWT.NONE); - item.setText (customNames[i]); - item.setChecked (eventsFilter[EVENT_NAMES.length + i]); - } - Button selectAll = new Button (dialog, SWT.PUSH); - selectAll.setText(ControlExample.getResourceString ("Select_All")); - selectAll.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); - selectAll.addSelectionListener (new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - TableItem [] items = table.getItems(); - for (int i = 0; i < EVENT_NAMES.length; i++) { - items[i].setChecked(true); - } - for (int i = 0; i < customNames.length; i++) { - items[EVENT_NAMES.length + i].setChecked(true); - } - } - }); - Button deselectAll = new Button (dialog, SWT.PUSH); - deselectAll.setText(ControlExample.getResourceString ("Deselect_All")); - deselectAll.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING)); - deselectAll.addSelectionListener (new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - TableItem [] items = table.getItems(); - for (int i = 0; i < EVENT_NAMES.length; i++) { - items[i].setChecked(false); - } - for (int i = 0; i < customNames.length; i++) { - items[EVENT_NAMES.length + i].setChecked(false); - } - } - }); - Label filler = new Label(dialog, SWT.NONE); - Button ok = new Button (dialog, SWT.PUSH); - ok.setText(ControlExample.getResourceString ("OK")); - dialog.setDefaultButton(ok); - ok.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); - ok.addSelectionListener (new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - TableItem [] items = table.getItems(); - for (int i = 0; i < EVENT_NAMES.length; i++) { - eventsFilter[i] = items[i].getChecked(); - } - for (int i = 0; i < customNames.length; i++) { - eventsFilter[EVENT_NAMES.length + i] = items[EVENT_NAMES.length + i].getChecked(); - } - dialog.dispose(); - } - }); - dialog.pack (); - dialog.open (); - while (! dialog.isDisposed()) { - if (! dialog.getDisplay().readAndDispatch()) dialog.getDisplay().sleep(); - } - } - - /** - * Creates the "Listeners" group. The "Listeners" group - * goes below the "Example" and "Control" groups. - */ - void createListenersGroup () { - listenersGroup = new Group (tabFolderPage, SWT.NONE); - listenersGroup.setLayout (new GridLayout (3, false)); - GridData gridData = new GridData (GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL); - gridData.horizontalSpan = 2; - listenersGroup.setLayoutData (gridData); - listenersGroup.setText (ControlExample.getResourceString ("Listeners")); - - /* - * Create the button to access the 'Listeners' dialog. - */ - Button listenersButton = new Button (listenersGroup, SWT.PUSH); - listenersButton.setText (ControlExample.getResourceString ("Select_Listeners")); - listenersButton.addSelectionListener (new SelectionAdapter() { - public void widgetSelected (SelectionEvent e) { - createListenerSelectionDialog (); - recreateExampleWidgets (); - } - }); - - /* - * Create the checkbox to add/remove listeners to/from the example widgets. - */ - final Button listenCheckbox = new Button (listenersGroup, SWT.CHECK); - listenCheckbox.setText (ControlExample.getResourceString ("Listen")); - listenCheckbox.addSelectionListener (new SelectionAdapter () { - public void widgetSelected(SelectionEvent e) { - logging = listenCheckbox.getSelection (); - recreateExampleWidgets (); - } - }); - - /* - * Create the button to clear the text. - */ - Button clearButton = new Button (listenersGroup, SWT.PUSH); - clearButton.setText (ControlExample.getResourceString ("Clear")); - clearButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); - clearButton.addSelectionListener (new SelectionAdapter() { - public void widgetSelected (SelectionEvent e) { - eventConsole.setText (""); - } - }); - - /* Initialize the eventsFilter to log all events. */ - int customEventCount = getCustomEventNames ().length; - eventsFilter = new boolean [EVENT_NAMES.length + customEventCount]; - for (int i = 0; i < EVENT_NAMES.length + customEventCount; i++) { - eventsFilter [i] = true; - } - - /* Create the event console Text. */ - eventConsole = new Text (listenersGroup, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL); - GridData data = new GridData (GridData.FILL_BOTH); - data.horizontalSpan = 3; - data.heightHint = 80; - eventConsole.setLayoutData (data); - createEventConsolePopup (); - eventConsole.addKeyListener (new KeyAdapter () { - public void keyPressed (KeyEvent e) { - if ((e.keyCode == 'A' || e.keyCode == 'a') && (e.stateMask & SWT.MOD1) != 0) { - eventConsole.selectAll (); - e.doit = false; - } - } - }); - } - - void createOrientationGroup () { - /* Create Orientation group*/ - orientationGroup = new Group (controlGroup, SWT.NONE); - orientationGroup.setLayout (new GridLayout()); - orientationGroup.setLayoutData (new GridData (GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - orientationGroup.setText (ControlExample.getResourceString("Orientation")); - defaultOrietationButton = new Button (orientationGroup, SWT.RADIO); - defaultOrietationButton.setText (ControlExample.getResourceString("Default")); - defaultOrietationButton.setSelection (true); - ltrButton = new Button (orientationGroup, SWT.RADIO); - ltrButton.setText ("SWT.LEFT_TO_RIGHT"); - rtlButton = new Button (orientationGroup, SWT.RADIO); - rtlButton.setText ("SWT.RIGHT_TO_LEFT"); - } - - /** - * Creates the "Size" group. The "Size" group contains - * controls that allow the user to change the size of - * the example widgets. - */ - void createSizeGroup () { - /* Create the group */ - sizeGroup = new Group (controlGroup, SWT.NONE); - sizeGroup.setLayout (new GridLayout()); - sizeGroup.setLayoutData (new GridData (GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - sizeGroup.setText (ControlExample.getResourceString("Size")); - - /* Create the controls */ - - /* - * The preferred size of a widget is the size returned - * by widget.computeSize (SWT.DEFAULT, SWT.DEFAULT). - * This size is defined on a widget by widget basis. - * Many widgets will attempt to display their contents. - */ - preferredButton = new Button (sizeGroup, SWT.RADIO); - preferredButton.setText (ControlExample.getResourceString("Preferred")); - tooSmallButton = new Button (sizeGroup, SWT.RADIO); - tooSmallButton.setText (TOO_SMALL_SIZE + " X " + TOO_SMALL_SIZE); - smallButton = new Button(sizeGroup, SWT.RADIO); - smallButton.setText (SMALL_SIZE + " X " + SMALL_SIZE); - largeButton = new Button (sizeGroup, SWT.RADIO); - largeButton.setText (LARGE_SIZE + " X " + LARGE_SIZE); - fillButton = new Button (sizeGroup, SWT.RADIO); - fillButton.setText (ControlExample.getResourceString("Fill")); - - /* Add the listeners */ - SelectionAdapter selectionListener = new SelectionAdapter () { - public void widgetSelected (SelectionEvent event) { - if (!((Button) event.widget).getSelection ()) return; - setExampleWidgetSize (); - }; - }; - preferredButton.addSelectionListener(selectionListener); - tooSmallButton.addSelectionListener(selectionListener); - smallButton.addSelectionListener(selectionListener); - largeButton.addSelectionListener(selectionListener); - fillButton.addSelectionListener(selectionListener); - - /* Set the default state */ - preferredButton.setSelection (true); - } - - /** - * Creates the "Style" group. The "Style" group contains - * controls that allow the user to change the style of - * the example widgets. Changing a widget "Style" causes - * the widget to be destroyed and recreated. - */ - void createStyleGroup () { - styleGroup = new Group (controlGroup, SWT.NONE); - styleGroup.setLayout (new GridLayout ()); - styleGroup.setLayoutData (new GridData (GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - styleGroup.setText (ControlExample.getResourceString("Styles")); - } - - /** - * Creates the tab folder page. - * - * @param tabFolder org.eclipse.swt.widgets.TabFolder - * @return the new page for the tab folder - */ - Composite createTabFolderPage (TabFolder tabFolder) { - /* - * Create a two column page. - */ - tabFolderPage = new Composite (tabFolder, SWT.NONE); - tabFolderPage.setLayout (new GridLayout (2, false)); - - /* Create the "Example" and "Control" groups. */ - createExampleGroup (); - createControlGroup (); - - /* Create the "Listeners" group under the "Control" group. */ - createListenersGroup (); - - /* Create and initialize the example and control widgets. */ - createExampleWidgets (); - hookExampleWidgetListeners (); - createControlWidgets (); - setExampleWidgetState (); - - return tabFolderPage; - } - - /** - * Disposes the "Example" widgets. - */ - void disposeExampleWidgets () { - Control [] controls = getExampleWidgets (); - for (int i=0; i