Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcvs2svn2001-09-21 14:16:25 -0400
committercvs2svn2001-09-21 14:16:25 -0400
commit89945a57f4c9187366a69ea109f677ee1d9337e6 (patch)
tree6b6730bbca2c562a5377cc554957c0c642133117
parent86d403ad2c15b328233f399ad0354bb94fc7dea2 (diff)
downloadeclipse.platform.swt-R2_0Unicode.tar.gz
eclipse.platform.swt-R2_0Unicode.tar.xz
eclipse.platform.swt-R2_0Unicode.zip
This commit was manufactured by cvs2svn to create branch 'R2_0Unicode'.R2_0Unicode
Sprout from master 2001-09-21 18:16:23 UTC Silenio Quarti <ssq> '*** empty log message ***' Delete: examples/org.eclipse.swt.examples.controls/.classpath examples/org.eclipse.swt.examples.controls/.cvsignore examples/org.eclipse.swt.examples.controls/.vcm_meta 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/icons/controls_example.gif examples/org.eclipse.swt.examples.controls/import.properties examples/org.eclipse.swt.examples.controls/org/eclipse/swt/examples/controls/ControlPlugin.java examples/org.eclipse.swt.examples.controls/org/eclipse/swt/examples/controls/ControlView.java examples/org.eclipse.swt.examples.controls/plugin.properties examples/org.eclipse.swt.examples.controls/plugin.xml 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.launcher/.classpath examples/org.eclipse.swt.examples.launcher/.cvsignore examples/org.eclipse.swt.examples.launcher/.vcm_meta 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/import.properties examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/ApplicationRunner.java examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/ImportProjectTask.java examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/ItemDescriptor.java examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/ItemTreeNode.java examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/LaunchDelegate.java examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/LauncherApplication.java examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/LauncherPlugin.java examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/LauncherView.java examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/ProgramLaunchDelegate.java examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/SplitLayout.java examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/ViewLaunchDelegate.java 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.xsd 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.ole.win32/.classpath examples/org.eclipse.swt.examples.ole.win32/.cvsignore examples/org.eclipse.swt.examples.ole.win32/.vcm_meta 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/import.properties examples/org.eclipse.swt.examples.ole.win32/org/eclipse/swt/examples/ole/win32/OleBrowserView.java examples/org.eclipse.swt.examples.ole.win32/org/eclipse/swt/examples/ole/win32/OlePlugin.java examples/org.eclipse.swt.examples.ole.win32/org/eclipse/swt/examples/ole/win32/OleWebBrowser.java 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/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/.vcm_meta 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/import.properties examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/AirbrushTool.java examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/BasicPaintSession.java examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/ContainerFigure.java examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/ContinuousPaintSession.java examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/DragPaintSession.java examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/EllipseFigure.java examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/EllipseTool.java examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/Figure.java examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/FigureDrawContext.java examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/LineFigure.java examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/LineTool.java examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PaintPlugin.java examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PaintSession.java examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PaintSurface.java examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PaintTool.java examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PaintView.java examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PencilTool.java examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PointFigure.java examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PolyLineTool.java examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/RectangleFigure.java examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/RectangleTool.java examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/RoundedRectangleFigure.java examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/RoundedRectangleTool.java examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/SegmentedPaintSession.java examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/SolidEllipseFigure.java examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/SolidPolygonFigure.java examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/SolidRectangleFigure.java examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/SolidRoundedRectangleFigure.java examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/TextFigure.java examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/TextTool.java examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/ToolSettings.java examples/org.eclipse.swt.examples.paint/plugin.properties examples/org.eclipse.swt.examples.paint/plugin.xml 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/.vcm_meta 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_control_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/examples_addressbook.properties examples/org.eclipse.swt.examples/examples_control.properties examples/org.eclipse.swt.examples/examples_fileviewer.properties examples/org.eclipse.swt.examples/examples_helloworld.properties examples/org.eclipse.swt.examples/examples_hoverhelp.properties examples/org.eclipse.swt.examples/examples_images.properties examples/org.eclipse.swt.examples/examples_javaviewer.properties examples/org.eclipse.swt.examples/examples_texteditor.properties examples/org.eclipse.swt.examples/import.properties examples/org.eclipse.swt.examples/org/eclipse/swt/examples/addressbook/AddressBook.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/addressbook/DataEntryDialog.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/addressbook/FindListener.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/addressbook/SearchDialog.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/AlignableTab.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/ButtonTab.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/ComboTab.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/ControlExample.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/DialogTab.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/LabelTab.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/ListTab.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/ProgressBarTab.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/RangeTab.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/SashTab.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/ScrollableTab.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/ShellTab.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/SliderTab.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/Tab.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/TableTab.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/TextTab.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/ToolBarTab.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/TreeTab.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/closedFolder.gif examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/openFolder.gif examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/target.gif examples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/FileViewer.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/IconCache.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/TreeDropFeedbackListener.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/cmd_Copy.gif examples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/cmd_Cut.gif examples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/cmd_Delete.gif examples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/cmd_Parent.gif examples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/cmd_Paste.gif examples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/cmd_Print.gif examples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/cmd_Refresh.gif examples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/cmd_Rename.gif examples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/cmd_Search.gif examples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/generic_example.gif examples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/icon_ClosedDrive.gif examples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/icon_ClosedFolder.gif examples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/icon_File.gif examples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/icon_OpenDrive.gif examples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/icon_OpenFolder.gif examples/org.eclipse.swt.examples/org/eclipse/swt/examples/helloworld/HelloWorld1.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/helloworld/HelloWorld2.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/helloworld/HelloWorld3.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/helloworld/HelloWorld4.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/helloworld/HelloWorld5.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/hoverhelp/HoverHelp.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/hoverhelp/information.gif examples/org.eclipse.swt.examples/org/eclipse/swt/examples/hoverhelp/warning.gif examples/org.eclipse.swt.examples/org/eclipse/swt/examples/imageanalyzer/ImageAnalyzer.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/javaviewer/JavaLineStyler.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/javaviewer/JavaViewer.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/texteditor/Images.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/texteditor/TextEditor.java examples/org.eclipse.swt.examples/org/eclipse/swt/examples/texteditor/blue.bmp examples/org.eclipse.swt.examples/org/eclipse/swt/examples/texteditor/blue_mask.bmp examples/org.eclipse.swt.examples/org/eclipse/swt/examples/texteditor/bold.bmp examples/org.eclipse.swt.examples/org/eclipse/swt/examples/texteditor/bold_mask.bmp examples/org.eclipse.swt.examples/org/eclipse/swt/examples/texteditor/erase.bmp examples/org.eclipse.swt.examples/org/eclipse/swt/examples/texteditor/erase_mask.bmp examples/org.eclipse.swt.examples/org/eclipse/swt/examples/texteditor/green.bmp examples/org.eclipse.swt.examples/org/eclipse/swt/examples/texteditor/green_mask.bmp examples/org.eclipse.swt.examples/org/eclipse/swt/examples/texteditor/red.bmp examples/org.eclipse.swt.examples/org/eclipse/swt/examples/texteditor/red_mask.bmp examples/org.eclipse.swt.examples/plugin.properties examples/org.eclipse.swt.examples/plugin.xml 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/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/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/DialogTab.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/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/Tab.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/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/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/target.gif 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/TreeDropFeedbackListener.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/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
-rwxr-xr-xexamples/org.eclipse.swt.examples.controls/.classpath12
-rwxr-xr-xexamples/org.eclipse.swt.examples.controls/.cvsignore1
-rwxr-xr-xexamples/org.eclipse.swt.examples.controls/.vcm_meta14
-rwxr-xr-xexamples/org.eclipse.swt.examples.controls/build.properties5
-rwxr-xr-xexamples/org.eclipse.swt.examples.controls/doc-html/hglegal.htm14
-rwxr-xr-xexamples/org.eclipse.swt.examples.controls/doc-html/ngibmcpy.gifbin814 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples.controls/doc-html/swt_controls_ex.html33
-rwxr-xr-xexamples/org.eclipse.swt.examples.controls/icons/controls_example.gifbin111 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples.controls/import.properties4
-rwxr-xr-xexamples/org.eclipse.swt.examples.controls/org/eclipse/swt/examples/controls/ControlPlugin.java28
-rwxr-xr-xexamples/org.eclipse.swt.examples.controls/org/eclipse/swt/examples/controls/ControlView.java49
-rwxr-xr-xexamples/org.eclipse.swt.examples.controls/plugin.properties15
-rwxr-xr-xexamples/org.eclipse.swt.examples.controls/plugin.xml55
-rwxr-xr-xexamples/org.eclipse.swt.examples.controls/src/org/eclipse/swt/examples/controls/ControlPlugin.java28
-rwxr-xr-xexamples/org.eclipse.swt.examples.controls/src/org/eclipse/swt/examples/controls/ControlView.java49
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/.classpath21
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/.cvsignore1
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/.vcm_meta13
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/build.properties7
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/doc-html/hglegal.htm14
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/doc-html/ngibmcpy.gifbin814 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/doc-html/swt_launcher_ex.html59
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/doc/org.eclipse.swt.examples.launcher.launchItems.html65
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/icons/closedFolder.gifbin160 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/icons/generic_example.gifbin158 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/icons/launcher_example.gifbin168 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/icons/openFolder.gifbin152 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/import.properties4
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/ApplicationRunner.java183
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/ImportProjectTask.java290
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/ItemDescriptor.java85
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/ItemTreeNode.java73
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/LaunchDelegate.java9
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/LauncherApplication.java81
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/LauncherPlugin.java413
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/LauncherView.java234
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/ProgramLaunchDelegate.java79
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/SplitLayout.java12
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/ViewLaunchDelegate.java23
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/plugin.properties96
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/plugin.xml77
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/schema/org.eclipse.swt.examples.launcher.launchItems.xsd217
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/ItemDescriptor.java85
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/ItemTreeNode.java73
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/LauncherPlugin.java413
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/LauncherView.java234
-rwxr-xr-xexamples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/SplitLayout.java12
-rwxr-xr-xexamples/org.eclipse.swt.examples.ole.win32/.classpath11
-rwxr-xr-xexamples/org.eclipse.swt.examples.ole.win32/.cvsignore1
-rwxr-xr-xexamples/org.eclipse.swt.examples.ole.win32/.vcm_meta13
-rwxr-xr-xexamples/org.eclipse.swt.examples.ole.win32/build.properties6
-rwxr-xr-xexamples/org.eclipse.swt.examples.ole.win32/doc-html/hglegal.htm14
-rwxr-xr-xexamples/org.eclipse.swt.examples.ole.win32/doc-html/ngibmcpy.gifbin814 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples.ole.win32/doc-html/swt_ole_ex.html40
-rwxr-xr-xexamples/org.eclipse.swt.examples.ole.win32/icons/backward_nav.gifbin881 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples.ole.win32/icons/forward_nav.gifbin883 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples.ole.win32/icons/home_nav.gifbin928 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples.ole.win32/icons/refresh_nav.gifbin160 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples.ole.win32/icons/search_nav.gifbin245 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples.ole.win32/icons/stop_nav.gifbin174 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples.ole.win32/icons/webbrowser_example.gifbin380 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples.ole.win32/import.properties4
-rwxr-xr-xexamples/org.eclipse.swt.examples.ole.win32/org/eclipse/swt/examples/ole/win32/OleBrowserView.java354
-rwxr-xr-xexamples/org.eclipse.swt.examples.ole.win32/org/eclipse/swt/examples/ole/win32/OlePlugin.java170
-rwxr-xr-xexamples/org.eclipse.swt.examples.ole.win32/org/eclipse/swt/examples/ole/win32/OleWebBrowser.java251
-rwxr-xr-xexamples/org.eclipse.swt.examples.ole.win32/plugin.properties52
-rwxr-xr-xexamples/org.eclipse.swt.examples.ole.win32/plugin.xml56
-rwxr-xr-xexamples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OleBrowserView.java354
-rwxr-xr-xexamples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OlePlugin.java170
-rwxr-xr-xexamples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OleWebBrowser.java251
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/.classpath11
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/.cvsignore1
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/.vcm_meta13
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/build.properties5
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/doc-html/hglegal.htm14
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/doc-html/ngibmcpy.gifbin814 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/doc-html/swt_paint_ex.html37
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/icons/fill_none.gifbin865 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/icons/fill_outline.gifbin872 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/icons/fill_solid.gifbin861 -> 0 bytes
-rw-r--r--examples/org.eclipse.swt.examples.paint/icons/linestyle_dash.gifbin880 -> 0 bytes
-rw-r--r--examples/org.eclipse.swt.examples.paint/icons/linestyle_dashdot.gifbin880 -> 0 bytes
-rw-r--r--examples/org.eclipse.swt.examples.paint/icons/linestyle_dot.gifbin879 -> 0 bytes
-rw-r--r--examples/org.eclipse.swt.examples.paint/icons/linestyle_solid.gifbin871 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/icons/options_font.gifbin868 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/icons/paint_example.gifbin932 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/icons/tool_airbrush.gifbin890 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/icons/tool_ellipse.gifbin872 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/icons/tool_line.gifbin860 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/icons/tool_pencil.gifbin874 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/icons/tool_polyline.gifbin879 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/icons/tool_rectangle.gifbin865 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/icons/tool_roundedrectangle.gifbin871 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/icons/tool_text.gifbin875 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/import.properties4
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/AirbrushTool.java72
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/BasicPaintSession.java10
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/ContainerFigure.java87
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/ContinuousPaintSession.java226
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/DragPaintSession.java129
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/EllipseFigure.java46
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/EllipseTool.java57
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/Figure.java32
-rw-r--r--examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/FigureDrawContext.java34
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/LineFigure.java46
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/LineTool.java52
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PaintPlugin.java78
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PaintSession.java52
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PaintSurface.java29
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PaintTool.java13
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PaintView.java494
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PencilTool.java52
-rw-r--r--examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PointFigure.java34
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PolyLineTool.java69
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/RectangleFigure.java45
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/RectangleTool.java65
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/RoundedRectangleFigure.java47
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/RoundedRectangleTool.java58
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/SegmentedPaintSession.java153
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/SolidEllipseFigure.java38
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/SolidPolygonFigure.java53
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/SolidRectangleFigure.java37
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/SolidRoundedRectangleFigure.java39
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/TextFigure.java43
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/TextTool.java122
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/ToolSettings.java27
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/plugin.properties123
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/plugin.xml56
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/AirbrushTool.java72
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/BasicPaintSession.java10
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/ContainerFigure.java87
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/ContinuousPaintSession.java226
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/DragPaintSession.java129
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/EllipseFigure.java46
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/EllipseTool.java57
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/Figure.java32
-rw-r--r--examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/FigureDrawContext.java34
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/LineFigure.java46
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/LineTool.java52
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintPlugin.java78
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintSession.java52
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintSurface.java29
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintTool.java13
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintView.java494
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PencilTool.java52
-rw-r--r--examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PointFigure.java34
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PolyLineTool.java69
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RectangleFigure.java45
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RectangleTool.java65
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RoundedRectangleFigure.java47
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RoundedRectangleTool.java58
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SegmentedPaintSession.java153
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidEllipseFigure.java38
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidPolygonFigure.java53
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidRectangleFigure.java37
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidRoundedRectangleFigure.java39
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/TextFigure.java43
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/TextTool.java122
-rwxr-xr-xexamples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/ToolSettings.java27
-rwxr-xr-xexamples/org.eclipse.swt.examples/.classpath7
-rwxr-xr-xexamples/org.eclipse.swt.examples/.cvsignore1
-rwxr-xr-xexamples/org.eclipse.swt.examples/.vcm_meta12
-rwxr-xr-xexamples/org.eclipse.swt.examples/build.properties5
-rwxr-xr-xexamples/org.eclipse.swt.examples/doc-html/hglegal.htm14
-rwxr-xr-xexamples/org.eclipse.swt.examples/doc-html/ngibmcpy.gifbin814 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/doc-html/swt_addressbook_ex.html33
-rwxr-xr-xexamples/org.eclipse.swt.examples/doc-html/swt_control_ex.html34
-rwxr-xr-xexamples/org.eclipse.swt.examples/doc-html/swt_fileviewer_ex.html31
-rwxr-xr-xexamples/org.eclipse.swt.examples/doc-html/swt_helloworld_ex.html52
-rwxr-xr-xexamples/org.eclipse.swt.examples/doc-html/swt_hoverhelp_ex.html38
-rwxr-xr-xexamples/org.eclipse.swt.examples/doc-html/swt_imageanalyzer_ex.html56
-rwxr-xr-xexamples/org.eclipse.swt.examples/doc-html/swt_javaviewer_ex.html31
-rwxr-xr-xexamples/org.eclipse.swt.examples/doc-html/swt_manual_setup.html98
-rwxr-xr-xexamples/org.eclipse.swt.examples/doc-html/swt_texteditor_ex.html31
-rwxr-xr-xexamples/org.eclipse.swt.examples/examples_addressbook.properties59
-rwxr-xr-xexamples/org.eclipse.swt.examples/examples_control.properties181
-rwxr-xr-xexamples/org.eclipse.swt.examples/examples_fileviewer.properties59
-rwxr-xr-xexamples/org.eclipse.swt.examples/examples_helloworld.properties1
-rwxr-xr-xexamples/org.eclipse.swt.examples/examples_hoverhelp.properties16
-rwxr-xr-xexamples/org.eclipse.swt.examples/examples_images.properties94
-rwxr-xr-xexamples/org.eclipse.swt.examples/examples_javaviewer.properties7
-rwxr-xr-xexamples/org.eclipse.swt.examples/examples_texteditor.properties6
-rwxr-xr-xexamples/org.eclipse.swt.examples/import.properties16
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/addressbook/AddressBook.java909
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/addressbook/DataEntryDialog.java157
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/addressbook/FindListener.java12
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/addressbook/SearchDialog.java197
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/AlignableTab.java83
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/ButtonTab.java188
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/ComboTab.java114
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/ControlExample.java176
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/DialogTab.java431
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/LabelTab.java165
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/ListTab.java81
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/ProgressBarTab.java114
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/RangeTab.java168
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/SashTab.java165
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/ScrollableTab.java57
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/ShellTab.java224
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/SliderTab.java233
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/Tab.java375
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/TableTab.java179
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/TextTab.java107
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/ToolBarTab.java246
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/TreeTab.java120
-rw-r--r--examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/closedFolder.gifbin906 -> 0 bytes
-rw-r--r--examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/openFolder.gifbin184 -> 0 bytes
-rw-r--r--examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/target.gifbin917 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/FileViewer.java1727
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/IconCache.java147
-rw-r--r--examples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/TreeDropFeedbackListener.java1
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/cmd_Copy.gifbin167 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/cmd_Cut.gifbin152 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/cmd_Delete.gifbin143 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/cmd_Parent.gifbin132 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/cmd_Paste.gifbin245 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/cmd_Print.gifbin227 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/cmd_Refresh.gifbin182 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/cmd_Rename.gifbin163 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/cmd_Search.gifbin153 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/generic_example.gifbin158 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/icon_ClosedDrive.gifbin217 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/icon_ClosedFolder.gifbin160 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/icon_File.gifbin152 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/icon_OpenDrive.gifbin231 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/fileviewer/icon_OpenFolder.gifbin152 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/helloworld/HelloWorld1.java26
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/helloworld/HelloWorld2.java33
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/helloworld/HelloWorld3.java40
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/helloworld/HelloWorld4.java35
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/helloworld/HelloWorld5.java43
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/hoverhelp/HoverHelp.java336
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/hoverhelp/information.gifbin92 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/hoverhelp/warning.gifbin152 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/imageanalyzer/ImageAnalyzer.java1856
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/javaviewer/JavaLineStyler.java367
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/javaviewer/JavaViewer.java180
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/texteditor/Images.java52
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/texteditor/TextEditor.java355
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/texteditor/blue.bmpbin334 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/texteditor/blue_mask.bmpbin134 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/texteditor/bold.bmpbin134 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/texteditor/bold_mask.bmpbin134 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/texteditor/erase.bmpbin334 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/texteditor/erase_mask.bmpbin134 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/texteditor/green.bmpbin334 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/texteditor/green_mask.bmpbin134 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/texteditor/red.bmpbin334 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/texteditor/red_mask.bmpbin134 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/plugin.properties101
-rwxr-xr-xexamples/org.eclipse.swt.examples/plugin.xml174
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/AddressBook.java909
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/DataEntryDialog.java157
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/FindListener.java12
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/SearchDialog.java197
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/AlignableTab.java83
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ButtonTab.java188
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ComboTab.java114
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java176
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/DialogTab.java431
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/LabelTab.java165
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ListTab.java81
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ProgressBarTab.java114
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/RangeTab.java168
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SashTab.java165
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ScrollableTab.java57
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ShellTab.java224
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SliderTab.java233
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/Tab.java375
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TableTab.java179
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TextTab.java107
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ToolBarTab.java246
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TreeTab.java120
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/closedFolder.gifbin906 -> 0 bytes
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/openFolder.gifbin184 -> 0 bytes
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/target.gifbin917 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/FileViewer.java1727
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/IconCache.java147
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/TreeDropFeedbackListener.java1
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Copy.gifbin167 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Cut.gifbin152 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Delete.gifbin143 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Parent.gifbin132 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Paste.gifbin245 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Print.gifbin227 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Refresh.gifbin182 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Rename.gifbin163 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Search.gifbin153 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/generic_example.gifbin158 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/icon_ClosedDrive.gifbin217 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/icon_ClosedFolder.gifbin160 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/icon_File.gifbin152 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/icon_OpenDrive.gifbin231 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/icon_OpenFolder.gifbin152 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld1.java26
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld2.java33
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld3.java40
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld4.java35
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld5.java43
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/hoverhelp/HoverHelp.java336
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/hoverhelp/information.gifbin92 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/hoverhelp/warning.gifbin152 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/imageanalyzer/ImageAnalyzer.java1856
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaLineStyler.java367
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaViewer.java180
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/Images.java52
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/TextEditor.java355
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/blue.bmpbin334 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/blue_mask.bmpbin134 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/bold.bmpbin134 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/bold_mask.bmpbin134 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/erase.bmpbin334 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/erase_mask.bmpbin134 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/green.bmpbin334 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/green_mask.bmpbin134 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/red.bmpbin334 -> 0 bytes
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/red_mask.bmpbin134 -> 0 bytes
317 files changed, 0 insertions, 30424 deletions
diff --git a/examples/org.eclipse.swt.examples.controls/.classpath b/examples/org.eclipse.swt.examples.controls/.classpath
deleted file mode 100755
index 469b912b2d..0000000000
--- a/examples/org.eclipse.swt.examples.controls/.classpath
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path=""/>
- <classpathentry kind="var" path="JRE_LIB"/>
- <classpathentry kind="var"
- path="ECLIPSE_HOME/plugins/org.eclipse.core.runtime/runtime.jar" sourcepath="ECLIPSE_HOME/plugins/org.eclipse.core.runtime/runtimesrc.zip"/>
- <classpathentry kind="var"
- path="ECLIPSE_HOME/plugins/org.eclipse.ui/workbench.jar" sourcepath="ECLIPSE_HOME/plugins/org.eclipse.ui/workbenchsrc.zip"/>
- <classpathentry kind="src" path="/org.eclipse.swt.examples"/>
- <classpathentry kind="src" path="/org.eclipse.swt"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/examples/org.eclipse.swt.examples.controls/.cvsignore b/examples/org.eclipse.swt.examples.controls/.cvsignore
deleted file mode 100755
index c5e82d7458..0000000000
--- a/examples/org.eclipse.swt.examples.controls/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin \ No newline at end of file
diff --git a/examples/org.eclipse.swt.examples.controls/.vcm_meta b/examples/org.eclipse.swt.examples.controls/.vcm_meta
deleted file mode 100755
index 9daf91e588..0000000000
--- a/examples/org.eclipse.swt.examples.controls/.vcm_meta
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project-description>
- <comment></comment>
- <nature id="org.eclipse.jdt.core.javanature"/>
- <nature id="org.eclipse.pde.PluginNature"/>
- <reference project-name="org.eclipse.swt"/>
- <reference project-name="org.eclipse.swt.examples"/>
- <builder name="org.eclipse.jdt.core.javabuilder">
- </builder>
- <builder name="org.eclipse.pde.ManifestBuilder">
- </builder>
- <builder name="org.eclipse.pde.SchemaBuilder">
- </builder>
-</project-description>
diff --git a/examples/org.eclipse.swt.examples.controls/build.properties b/examples/org.eclipse.swt.examples.controls/build.properties
deleted file mode 100755
index f52e957ed1..0000000000
--- a/examples/org.eclipse.swt.examples.controls/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-bin.includes = doc-html/,\
- icons/,\
- plugin.properties,\
- plugin.xml
-source.controls.jar = org/,import.properties
diff --git a/examples/org.eclipse.swt.examples.controls/doc-html/hglegal.htm b/examples/org.eclipse.swt.examples.controls/doc-html/hglegal.htm
deleted file mode 100755
index b071dbdf45..0000000000
--- a/examples/org.eclipse.swt.examples.controls/doc-html/hglegal.htm
+++ /dev/null
@@ -1,14 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="GENERATOR" content="Mozilla/4.73 [en] (Win98; U) [Netscape]">
- <title>Legal Notices</title>
-</head>
-<body>
-
-<h3>
-<a NAME="Notices"></a>Notices</h3>
-(c) Copyright IBM Corp. 2000, 2001. All Rights Reserved.
-</body>
-</html>
diff --git a/examples/org.eclipse.swt.examples.controls/doc-html/ngibmcpy.gif b/examples/org.eclipse.swt.examples.controls/doc-html/ngibmcpy.gif
deleted file mode 100755
index 360f8e9989..0000000000
--- a/examples/org.eclipse.swt.examples.controls/doc-html/ngibmcpy.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.controls/doc-html/swt_controls_ex.html b/examples/org.eclipse.swt.examples.controls/doc-html/swt_controls_ex.html
deleted file mode 100755
index 46c2349bf4..0000000000
--- a/examples/org.eclipse.swt.examples.controls/doc-html/swt_controls_ex.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>SWT - Controls Example</title>
-</head>
-<body>
-
-<h2>Example - SWT Controls</h2>
-
-<h3>Introduction</h3>
-<p>This example is a simple demonstration of common Standard Widget Toolkit
-(SWT) UI controls.&nbsp; It consists of a shell and tab folder where each
-tab in the folder allows the user to interact with a control.
-</p>
-
-<h3>Running the example</h3>
-<p>To run the Controls Example, pull down the Perspective menu, select the
-Show View menu item, then select Other from the submenu.&nbsp; A dialog
-will come up with a list of views.&nbsp; Expand SWT Examples and select
-the view named Controls.&nbsp; A view containing a number of tabbed pages
-will appear.
-</p>
-
-<h3>Details</h3>
-<p>Each page (tab) of the controls example allows the user to interact with
-a different SWT control.&nbsp; The name of the control being demonstrated
-on each page is on the tab.
-</p>
-
-<p><a href="hglegal.htm"><img SRC="ngibmcpy.gif" ALT="Copyright IBM Corporation 2000, 2001. All Rights Reserved." BORDER=0 height=12 width=195></a></p>
-</body>
-</html>
diff --git a/examples/org.eclipse.swt.examples.controls/icons/controls_example.gif b/examples/org.eclipse.swt.examples.controls/icons/controls_example.gif
deleted file mode 100755
index cbdee97066..0000000000
--- a/examples/org.eclipse.swt.examples.controls/icons/controls_example.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.controls/import.properties b/examples/org.eclipse.swt.examples.controls/import.properties
deleted file mode 100755
index 9185f56fc8..0000000000
--- a/examples/org.eclipse.swt.examples.controls/import.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-# 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 = <<ECLIPSE_PLUGINS>>
diff --git a/examples/org.eclipse.swt.examples.controls/org/eclipse/swt/examples/controls/ControlPlugin.java b/examples/org.eclipse.swt.examples.controls/org/eclipse/swt/examples/controls/ControlPlugin.java
deleted file mode 100755
index 31e4e58cc2..0000000000
--- a/examples/org.eclipse.swt.examples.controls/org/eclipse/swt/examples/controls/ControlPlugin.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.eclipse.swt.examples.controls;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.ui.plugin.*;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class ControlPlugin extends AbstractUIPlugin {
- /**
- * The constructor.
- */
- public ControlPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- }
-
- /**
- * Clean up
- */
- public void shutdown() throws CoreException {
- super.shutdown();
- }
-}
diff --git a/examples/org.eclipse.swt.examples.controls/org/eclipse/swt/examples/controls/ControlView.java b/examples/org.eclipse.swt.examples.controls/org/eclipse/swt/examples/controls/ControlView.java
deleted file mode 100755
index 390b9cdf17..0000000000
--- a/examples/org.eclipse.swt.examples.controls/org/eclipse/swt/examples/controls/ControlView.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package org.eclipse.swt.examples.controls;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.examples.controlexample.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.part.*;
-
-/**
- * <code>Controls</code> is a simple demonstration
- * of the controls defined by SWT. It consists of a workbench
- * view and tab folder where each tab in the folder allows the
- * user to interact with a control.
- *
- * @see ViewPart
- */
-public class ControlView extends ViewPart {
- ControlExample instance = null;
-
- /**
- * Create the example
- *
- * @see ViewPart#createPartControl
- */
- public void createPartControl(Composite frame) {
- instance = new ControlExample(frame);
- }
-
- /**
- * Called when we must grab focus.
- *
- * @see org.eclipse.ui.part.ViewPart#setFocus
- */
- public void setFocus() {
- instance.setFocus();
- }
-
- /**
- * Called when the View is to be disposed
- */
- public void dispose() {
- instance.dispose();
- instance = null;
- super.dispose();
- }
-}
diff --git a/examples/org.eclipse.swt.examples.controls/plugin.properties b/examples/org.eclipse.swt.examples.controls/plugin.properties
deleted file mode 100755
index f0ce9c75e6..0000000000
--- a/examples/org.eclipse.swt.examples.controls/plugin.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-plugin.SWTControlsExample.name = SWT Controls Example Plugin
-category.SWTExamples.name = SWT Examples
-view.ControlsExample.name = SWT Controls
-
-launchcategory.SWTViewExamples.name = Workbench Views
-launchcategory.SWTViewExamples.description = \
- A collection of Standard Widget Toolkit examples that run as Views inside the Workbench. \
- These examples will create a new View in the current Perspective.
-
-launchitem.ControlsExample.name = Controls
-launchitem.ControlsExample.description = \
- This example is a simple demonstration of common Standard Widget Toolkit (SWT) UI controls.\n\n\
- The example consists of a shell and tab folder where each tab in the folder allows the user to interact with a control. \
- Each page (tab) of the controls example allows the user to interact with a different SWT control. \
- The name of the control being demonstrated on each page is on the tab.
diff --git a/examples/org.eclipse.swt.examples.controls/plugin.xml b/examples/org.eclipse.swt.examples.controls/plugin.xml
deleted file mode 100755
index 251d2e7552..0000000000
--- a/examples/org.eclipse.swt.examples.controls/plugin.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- File written by PDE 1.0 -->
-<plugin
- id="org.eclipse.swt.examples.controls"
- name="%plugin.SWTControlsExample.name"
- version="2.0"
- provider-name="Object Technology International, Inc."
- class="org.eclipse.swt.examples.controls.ControlPlugin">
-<!-- Required plugins -->
-<requires>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.swt"/>
- <import plugin="org.eclipse.swt.examples"/>
-</requires>
-
-<!-- Runtime -->
-<runtime>
- <library name="controls.jar"/>
-</runtime>
-
-<!-- Extensions -->
-<!-- Extension points -->
-<extension
- point="org.eclipse.ui.views">
- <view
- name="%view.ControlsExample.name"
- icon="icons/controls_example.gif"
- category="org.eclipse.swt.examples.category"
- class="org.eclipse.swt.examples.controls.ControlView"
- id="org.eclipse.swt.examples.controls.view">
- </view>
-</extension>
-<extension
- point="org.eclipse.swt.examples.launcher.launchItems">
- <category
- name="%launchcategory.SWTViewExamples.name"
- description="%launchcategory.SWTViewExamples.description"
- id="org.eclipse.swt.examples.launchViewCategory">
- </category>
- <item
- name="%launchitem.ControlsExample.name"
- icon="icons/controls_example.gif"
- description="%launchitem.ControlsExample.description"
- category="org.eclipse.swt.examples.launchViewCategory"
- id="org.eclipse.swt.examples.controls.viewlauncher">
- <view
- viewId="org.eclipse.swt.examples.controls.view">
- </view>
- <source
- zip="controlssrc.zip">
- </source>
- </item>
-</extension>
-</plugin>
diff --git a/examples/org.eclipse.swt.examples.controls/src/org/eclipse/swt/examples/controls/ControlPlugin.java b/examples/org.eclipse.swt.examples.controls/src/org/eclipse/swt/examples/controls/ControlPlugin.java
deleted file mode 100755
index 31e4e58cc2..0000000000
--- a/examples/org.eclipse.swt.examples.controls/src/org/eclipse/swt/examples/controls/ControlPlugin.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.eclipse.swt.examples.controls;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.ui.plugin.*;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class ControlPlugin extends AbstractUIPlugin {
- /**
- * The constructor.
- */
- public ControlPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- }
-
- /**
- * Clean up
- */
- public void shutdown() throws CoreException {
- super.shutdown();
- }
-}
diff --git a/examples/org.eclipse.swt.examples.controls/src/org/eclipse/swt/examples/controls/ControlView.java b/examples/org.eclipse.swt.examples.controls/src/org/eclipse/swt/examples/controls/ControlView.java
deleted file mode 100755
index 390b9cdf17..0000000000
--- a/examples/org.eclipse.swt.examples.controls/src/org/eclipse/swt/examples/controls/ControlView.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package org.eclipse.swt.examples.controls;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.examples.controlexample.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.part.*;
-
-/**
- * <code>Controls</code> is a simple demonstration
- * of the controls defined by SWT. It consists of a workbench
- * view and tab folder where each tab in the folder allows the
- * user to interact with a control.
- *
- * @see ViewPart
- */
-public class ControlView extends ViewPart {
- ControlExample instance = null;
-
- /**
- * Create the example
- *
- * @see ViewPart#createPartControl
- */
- public void createPartControl(Composite frame) {
- instance = new ControlExample(frame);
- }
-
- /**
- * Called when we must grab focus.
- *
- * @see org.eclipse.ui.part.ViewPart#setFocus
- */
- public void setFocus() {
- instance.setFocus();
- }
-
- /**
- * Called when the View is to be disposed
- */
- public void dispose() {
- instance.dispose();
- instance = null;
- super.dispose();
- }
-}
diff --git a/examples/org.eclipse.swt.examples.launcher/.classpath b/examples/org.eclipse.swt.examples.launcher/.classpath
deleted file mode 100755
index 9f7c9bf0a2..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/.classpath
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path=""/>
- <classpathentry kind="var" path="JRE_LIB"/>
- <classpathentry kind="var"
- path="ECLIPSE_HOME/plugins/org.eclipse.core.runtime/runtime.jar" sourcepath="ECLIPSE_HOME/plugins/org.eclipse.core.runtime/runtimesrc.zip"/>
- <classpathentry kind="var"
- path="ECLIPSE_HOME/plugins/org.eclipse.core.resources/resources.jar" sourcepath="ECLIPSE_HOME/plugins/org.eclipse.core.resources/resourcessrc.zip"/>
- <classpathentry kind="var"
- path="ECLIPSE_HOME/plugins/org.eclipse.ui/workbench.jar" sourcepath="ECLIPSE_HOME/plugins/org.eclipse.ui/workbenchsrc.zip"/>
- <classpathentry kind="var"
- path="ECLIPSE_HOME/plugins/org.eclipse.core.boot/boot.jar" sourcepath="ECLIPSE_HOME/plugins/org.eclipse.core.boot/bootsrc.zip"/>
- <classpathentry kind="var"
- path="ECLIPSE_HOME/plugins/org.eclipse.jdt.core/jdtcore.jar" sourcepath="ECLIPSE_HOME/plugins/org.eclipse.jdt.core/jdtcoresrc.zip"/>
- <classpathentry kind="var"
- path="ECLIPSE_HOME/plugins/org.eclipse.jdt.launching/launching.jar" sourcepath="ECLIPSE_HOME/plugins/org.eclipse.jdt.launching/launchingsrc.zip"/>
- <classpathentry kind="var"
- path="ECLIPSE_HOME/plugins/org.eclipse.debug.core/dtcore.jar" sourcepath="ECLIPSE_HOME/plugins/org.eclipse.debug.core/dtcoresrc.zip"/>
- <classpathentry kind="src" path="/org.eclipse.swt"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/examples/org.eclipse.swt.examples.launcher/.cvsignore b/examples/org.eclipse.swt.examples.launcher/.cvsignore
deleted file mode 100755
index c5e82d7458..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin \ No newline at end of file
diff --git a/examples/org.eclipse.swt.examples.launcher/.vcm_meta b/examples/org.eclipse.swt.examples.launcher/.vcm_meta
deleted file mode 100755
index d64b057431..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/.vcm_meta
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project-description>
- <comment></comment>
- <nature id="org.eclipse.jdt.core.javanature"/>
- <nature id="org.eclipse.pde.PluginNature"/>
- <reference project-name="org.eclipse.swt"/>
- <builder name="org.eclipse.jdt.core.javabuilder">
- </builder>
- <builder name="org.eclipse.pde.ManifestBuilder">
- </builder>
- <builder name="org.eclipse.pde.SchemaBuilder">
- </builder>
-</project-description>
diff --git a/examples/org.eclipse.swt.examples.launcher/build.properties b/examples/org.eclipse.swt.examples.launcher/build.properties
deleted file mode 100755
index e0ae9787c1..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-source.launcher.jar = org/,import.properties
-bin.includes = doc/,\
- doc-html/,\
- icons/,\
- schema/,\
- plugin.properties,\
- plugin.xml \ No newline at end of file
diff --git a/examples/org.eclipse.swt.examples.launcher/doc-html/hglegal.htm b/examples/org.eclipse.swt.examples.launcher/doc-html/hglegal.htm
deleted file mode 100755
index b071dbdf45..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/doc-html/hglegal.htm
+++ /dev/null
@@ -1,14 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="GENERATOR" content="Mozilla/4.73 [en] (Win98; U) [Netscape]">
- <title>Legal Notices</title>
-</head>
-<body>
-
-<h3>
-<a NAME="Notices"></a>Notices</h3>
-(c) Copyright IBM Corp. 2000, 2001. All Rights Reserved.
-</body>
-</html>
diff --git a/examples/org.eclipse.swt.examples.launcher/doc-html/ngibmcpy.gif b/examples/org.eclipse.swt.examples.launcher/doc-html/ngibmcpy.gif
deleted file mode 100755
index 360f8e9989..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/doc-html/ngibmcpy.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.launcher/doc-html/swt_launcher_ex.html b/examples/org.eclipse.swt.examples.launcher/doc-html/swt_launcher_ex.html
deleted file mode 100755
index 1b4b0e981f..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/doc-html/swt_launcher_ex.html
+++ /dev/null
@@ -1,59 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>SWT - Example Launcher</title>
-</head>
-<body>
-
-<h2>Example Launcher</h2>
-
-<h3>Introduction</h3>
-<p>The Example Launcher is a tool for enumerating, running and browsing a variety of examples.
-While these operations may be performed manually (with some difficulty), the Example Launcher
-offers a convenient interface.&nbsp; For information on how to manipulate particular examples
-manually, please consult their related documentation.
-</p>
-
-<h3>Running the Example Launcher</h3>
-<p>To run the Example Launcher, pull down the Perspective menu, select the
-Show View menu item, then select Other from the submenu.&nbsp; A dialog
-will come up with a list of views.&nbsp; Expand SWT Examples and select
-the view named SWT Example Launcher.&nbsp; A view containing a list of examples to
-choose will appear.
-</p>
-
-<h3>About the examples</h3>
-<p>The Example Launcher can launch two different types of examples: Workbench Views,
-and Standalone applications.&nbsp; Examples will generally be organized into categories to
-distinguish the one from the other.
-</p>
-<p>Workbench Views are GUI panels that sit inside a given perspective. When the Launcher
-starts a program that is written to interact with the Workbench as a view, it is opened and
-embedded into the currently active perspective.
-</p>
-<p>Standalone applications are programs that run independently of the current
-Eclipse Platform environment.&nbsp; First, a new Java VM and Eclipse Platform runtime
-is started, then the application's main() method is invoked.&nbsp; For this reason,
-these applications may take some time to load.
-</p>
-
-<h3>Details</h3>
-<p>The example launcher view contains a tree list, a text area, and 2 buttons.
-The tree list contains a list of all the SWT examples you can choose
-to run.&nbsp; When an example is selected from the tree, the text area
-shows a short description of each example.&nbsp; The selected example can
-be executed by clicking on the Run button, which can be found just below
-the tree list.&nbsp; For some of the examples, you can also import the example
-source code into a project in the Workspace.&nbsp; A project, with a name specified
-by the user, is created and all the java classes required to run that example
-will be added to that newly created project.
-</p><p>
-Depending on the example and on the configuration of your system, it may be
-necessary to alter Project build paths or to define classpath variables to compile
-or run examples that have been imported to the Workspace.
-</p>
-
-<p><a href="hglegal.htm"><img SRC="ngibmcpy.gif" ALT="Copyright IBM Corporation 2000, 2001. All Rights Reserved." BORDER=0 height=12 width=195></a></p>
-</body>
-</html>
diff --git a/examples/org.eclipse.swt.examples.launcher/doc/org.eclipse.swt.examples.launcher.launchItems.html b/examples/org.eclipse.swt.examples.launcher/doc/org.eclipse.swt.examples.launcher.launchItems.html
deleted file mode 100755
index 3ce1c33fd5..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/doc/org.eclipse.swt.examples.launcher.launchItems.html
+++ /dev/null
@@ -1,65 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<HEAD>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-</HEAD>
-<HTML>
-<BODY>
-<H1><CENTER>Launch Items</CENTER></H1>
-<H2>Identifier</H2>
-org.eclipse.swt.examples.launcher.launchItems<H2>Description</H2>
-This extension point is used to add 'standalone program' and 'Workbench view'
- launch items to the Launcher, optionally grouping them into
- categories so as to form a multi-tiered hierarchy.
- Standalone programs are executed in new run-time environments.
- Workbench views are created within the active Workbench Perspective.<H2>Markup</H2>
-<p><samp>&nbsp;&nbsp; &lt;!ELEMENT extension (EMPTY)&gt;</samp>
-<br><samp>&nbsp;&nbsp; &lt;!ATTLIST extension</samp>
-<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;point&nbsp;CDATA #REQUIRED</samp>
-<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;id&nbsp;&nbsp;&nbsp;&nbsp;CDATA #IMPLIED</samp>
-<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name&nbsp;&nbsp;CDATA #IMPLIED</samp>
-<br><samp>&nbsp;&nbsp; &gt;</samp>
-<ul>
-<li><b>point</b> - </li><li><b>id</b> - </li><li><b>name</b> - </li></ul>
-<p><samp>&nbsp;&nbsp; &lt;!ELEMENT program (EMPTY)&gt;</samp>
-<br><samp>&nbsp;&nbsp; &lt;!ATTLIST program</samp>
-<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mainClass&nbsp;CDATA #REQUIRED</samp>
-<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pluginId&nbsp;&nbsp;CDATA #REQUIRED</samp>
-<br><samp>&nbsp;&nbsp; &gt;</samp>
-<ul>
-<li><b>mainClass</b> - The fully-qualified name of the class whose main() method is to be launched.</li><li><b>pluginId</b> - The unique id of the Eclipse Platform plugin containing the program.</li></ul>
-<p><samp>&nbsp;&nbsp; &lt;!ELEMENT view (EMPTY)&gt;</samp>
-<br><samp>&nbsp;&nbsp; &lt;!ATTLIST view</samp>
-<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;viewId&nbsp;CDATA #REQUIRED</samp>
-<br><samp>&nbsp;&nbsp; &gt;</samp>
-<ul>
-<li><b>viewId</b> - The unique id of the Workbench View to be activated when the item is launched.</li></ul>
-<p><samp>&nbsp;&nbsp; &lt;!ELEMENT category (EMPTY)&gt;</samp>
-<br><samp>&nbsp;&nbsp; &lt;!ATTLIST category</samp>
-<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</samp>
-<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</samp>
-<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;category&nbsp;CDATA #IMPLIED</samp>
-<br><samp>&nbsp;&nbsp; &gt;</samp>
-<ul>
-<li><b>name</b> - The localized name of this category.</li><li><b>id</b> - The unique id of this category. Categories with duplicate id's will be discarded.</li><li><b>category</b> - The unique id of the parent category.</li></ul>
-<p><samp>&nbsp;&nbsp; &lt;!ELEMENT item (EMPTY)&gt;</samp>
-<br><samp>&nbsp;&nbsp; &lt;!ATTLIST item</samp>
-<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</samp>
-<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</samp>
-<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;category&nbsp;&nbsp;&nbsp;&nbsp;CDATA #IMPLIED</samp>
-<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;icon&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #IMPLIED</samp>
-<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;enabled&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(true | false) "false""true"</samp>
-<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;description&nbsp;CDATA #IMPLIED</samp>
-<br><samp>&nbsp;&nbsp; &gt;</samp>
-<ul>
-<li><b>name</b> - The localized name of this launch item.</li><li><b>id</b> - The unique id of this launch item. Launch items with duplicate id's will be discarded.</li><li><b>category</b> - The unique id of the category this launch item belongs to.</li><li><b>icon</b> - The declaring plugin relative path of an icon to display with this launch item in the Launcher.</li><li><b>enabled</b> - Set to "false" to disable this launch item, or to "true" to enable it (default).</li><li><b>description</b> - The localized plain-text description of this launch item.</li></ul>
-<p><samp>&nbsp;&nbsp; &lt;!ELEMENT source (EMPTY)&gt;</samp>
-<br><samp>&nbsp;&nbsp; &lt;!ATTLIST source</samp>
-<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;zip&nbsp;CDATA #IMPLIED</samp>
-<br><samp>&nbsp;&nbsp; &gt;</samp>
-<ul>
-<li><b>zip</b> - The declaring plugin relative path of a ZIP file containing source code associated with a launch item.</li></ul>
-<H2>Example</H2>
-<H2>API Information</H2>
-<H2>Supplied Implementation</H2>
-</BODY>
-</HTML>
diff --git a/examples/org.eclipse.swt.examples.launcher/icons/closedFolder.gif b/examples/org.eclipse.swt.examples.launcher/icons/closedFolder.gif
deleted file mode 100755
index beb6ed134c..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/icons/closedFolder.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.launcher/icons/generic_example.gif b/examples/org.eclipse.swt.examples.launcher/icons/generic_example.gif
deleted file mode 100755
index f9fb6b0cab..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/icons/generic_example.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.launcher/icons/launcher_example.gif b/examples/org.eclipse.swt.examples.launcher/icons/launcher_example.gif
deleted file mode 100755
index 3ab4d32c05..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/icons/launcher_example.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.launcher/icons/openFolder.gif b/examples/org.eclipse.swt.examples.launcher/icons/openFolder.gif
deleted file mode 100755
index a9c777343c..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/icons/openFolder.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.launcher/import.properties b/examples/org.eclipse.swt.examples.launcher/import.properties
deleted file mode 100755
index 9185f56fc8..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/import.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-# 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 = <<ECLIPSE_PLUGINS>>
diff --git a/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/ApplicationRunner.java b/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/ApplicationRunner.java
deleted file mode 100755
index 4e9c314b1d..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/ApplicationRunner.java
+++ /dev/null
@@ -1,183 +0,0 @@
-package org.eclipse.swt.examples.launcher; /* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved */ import java.io.*; import java.net.*; import java.util.*; import org.eclipse.core.boot.*; import org.eclipse.core.runtime.*; import org.eclipse.debug.core.*; import org.eclipse.debug.core.model.*; import org.eclipse.jdt.launching.*; /** * ApplicationRunner provides an interface to run registered Eclipse Platform applications * standalone in their own VM. */
-public class ApplicationRunner {
- protected String appName;
- protected String[] appArgs;
- protected String appStatePath = null;
- protected URL[] appPluginsPath = null;
-
- /**
- * Constructs an ApplicationRunner
- *
- * @param applicationName the id of a registered <code>org.eclipse.core.runtime.applications</code>
- * extension point
- * @param args the arguments to pass to the application, or null if none
- */
- public ApplicationRunner(String applicationName, String[] args) {
- this.appName = applicationName;
- this.appArgs = args;
- }
-
- /**
- * Specify the location of the plugins directory used to launch the application and to locate
- * plugins while the application is running.
- * <p>
- * The default is to let the Eclipse Platform search for the plugins directory in the manner
- * specified by <code>org.eclipse.core.boot.BootLoader</code> when no -plugins argument is
- * supplied to startup(). Generally, this means it will look in the current working directory
- * for either a directory of plugins, or a file telling it where to find these directories.
- * </p><p> * Each entry either points to a specific plugin manifest file (e.g. plugin.xml) or * to a directory containing whose subdirectories contain plugin manifest files. * </p> *
- * @param pluginPath an array of fully-qualified URLs to the plugins directories,
- * or null for the default
- * @see #getCurrentPluginsPath
- */
- public void setPluginsPath(URL[] pluginsPath) {
- this.appPluginsPath = pluginsPath;
- }
-
- /**
- * Specify the location of the applicate saved state directory used to store information
- * about the application's state while it is running.
- * <p>
- * The default is to let the Eclipse Platform search for the state directory in the manner
- * specified by <core>org.eclipse.core.boot.BootLoader</code> when no -platform argument is
- * supplied to startup(). Generally, this means it will create its state in the current
- * working directory.
- * </p>
- *
- * @param statePath the absolute filesystem path to the application state directory,
- * or null for the default
- * @see #getCurrentStatePath
- */
- public void setStatePath(String statePath) {
- this.appStatePath = statePath;
- }
-
- /**
- * Returns the plugins directory path in the current Eclipse Platform instance. * <p> * Each entry either points to a specific plugin manifest file (e.g. plugin.xml) or * to a directory containing whose subdirectories contain plugin manifest files. * </p>
- *
- * @return the current plugins directory absolute filesystem paths array
- */
- public static URL[] getCurrentPluginsPath() { Set /* of URL */ paths = new HashSet(); // get the platform's public plugin registry IPluginRegistry pluginRegistry = Platform.getPluginRegistry(); // retrieve plugin descriptors for all plugins // [array may contain multiple versions of a given plugin] IPluginDescriptor[] pluginDescriptors = pluginRegistry.getPluginDescriptors(); for (int i = 0; i < pluginDescriptors.length; ++i) { final IPluginDescriptor pd = pluginDescriptors[i]; try { // getInstallUrl() returns the path of the directory with the plugin manifest file(s) // for a specific plugin final URL installUrl = Platform.resolve(pd.getInstallURL()); // Add the parent directory of the plugin's install location to our Set String path = installUrl.toString(); path = path.substring(0, path.lastIndexOf('/')); // eliminate terminal '/' on directory path = path.substring(0, 1 + path.lastIndexOf('/')); // locate parent directory URL url = new URL(path); paths.add(url); } catch (IOException e) { // Ignore invalid paths } }
- return (URL[]) paths.toArray(new URL[paths.size()]);
- }
-
- /**
- * Returns the state directory path in the current Eclipse Platform instance.
- *
- * @return the current state directory absolute filesystem path
- */
- public static String getCurrentStatePath() {
- return Platform.getLocation().toFile().getAbsolutePath();
- }
-
- /**
- * Run the application asynchronously in its own VM and Eclipse Platform instance.
- *
- * @return a VMRunnerResult with status and control information about the launch, may be null
- */
- public VMRunnerResult run() {
- int numArgs = (appArgs != null) ? appArgs.length : 0;
- numArgs += 4;
- if (appPluginsPath != null && appPluginsPath.length != 0) numArgs += 2;
- if (appStatePath != null) numArgs += 2;
-
- String[] launcherArgs = new String[numArgs];
-
- int arg = 0;
- launcherArgs[arg++] = "-dev"; // tell Eclipse to look in bin subdirectories
- launcherArgs[arg++] = "bin"; // under plugins directories as part of the classpath
- launcherArgs[arg++] = "-application"; // tell Eclipse to launch our application
- launcherArgs[arg++] = appName;
-
- if (appStatePath != null) {
- launcherArgs[arg++] = "-platform"; // tell Eclipse where its saved state should be placed
- launcherArgs[arg++] = appStatePath;
- }
- if (appPluginsPath != null && appPluginsPath.length != 0) {
- // Plugin path information must be stored on disk in a Properties file for some reason...
- Properties properties = new Properties();
- for (int i = 0; i < appPluginsPath.length; ++i) {
- properties.setProperty("pluginPathEntry" + i, appPluginsPath[i].toString());
- }
-
- try {
- File pathFile = File.createTempFile("tempPluginPaths", ".ini");
- pathFile.deleteOnExit();
-
- OutputStream os = new FileOutputStream(pathFile);
- properties.store(os, "");
- os.close();
-
- launcherArgs[arg++] = "-plugins"; // tell Eclipse where its plugins are stored
- launcherArgs[arg++] = pathFile.getAbsoluteFile().toURL().toString();
- } catch (IOException e) {
- return null;
- }
- }
- if (appArgs != null) System.arraycopy(appArgs, 0, launcherArgs, arg, appArgs.length);
-
- return runJavaClass(getPlatformClass(), getPlatformClassPath(),
- new String[0], launcherArgs);
- }
-
- /**
- * Determines if a VMRunnerResult indicates success or failure.
- * <p>
- * A return value of <code>true</code> should be taken on advisory only. There is at present
- * no general way of determining if the operation was completed successfully.
- * </p>
- * @param result the VMRunnerResult to check, null is permissible and causes a return value of false
- * @return true if the VM started correctly (not a guarantee that the application will run!)
- */
- public static boolean isResultOk(VMRunnerResult result) {
- if (result == null) return false;
-
- IProcess[] processes = result.getProcesses();
- return (processes != null && processes.length > 0);
- }
-
- protected static VMRunnerResult runJavaClass(String className, String[] classPath,
- String[] vmArgs, String[] programArgs) {
- IVMRunner vmRunner = getJavaVMRunner();
- if (vmRunner == null) return null;
-
- VMRunnerConfiguration vmRunConfig = new VMRunnerConfiguration(className, classPath);
- vmRunConfig.setVMArguments(vmArgs);
- vmRunConfig.setProgramArguments(programArgs);
- return vmRunner.run(vmRunConfig);
- }
-
- protected static String getPlatformClass() {
- return "org.eclipse.core.launcher.UIMain";
- }
-
- protected static String getPlatformPath() {
- return urlToLocalFile(BootLoader.getInstallURL()).getAbsolutePath();
- }
-
- protected static String[] getPlatformClassPath() {
- final String platformPath = getPlatformPath();
- return new String[] {
- new File(platformPath, "startup.jar").getAbsolutePath(),
- new File(new File(platformPath, "bin"), "startup.jar").getAbsolutePath()
- };
- }
-
- protected static IVMRunner getJavaVMRunner() {
- // get the current install
- IVMInstall vmInstall = JavaRuntime.getDefaultVMInstall();
- if (vmInstall == null) {
- LauncherPlugin.logError(LauncherPlugin.getResourceString("run.error.CouldNotFindDefaultVM"), null);
- return null;
- }
-
- // get a runner
- IVMRunner vmRunner = vmInstall.getVMRunner(ILaunchManager.RUN_MODE);
- if (vmRunner == null) {
- LauncherPlugin.logError(LauncherPlugin.getResourceString("run.error.CouldNotFindVMRunner",
- new Object[] { vmInstall.getName() }), null);
- return null;
- }
- return vmRunner;
- } /** * Get a File representing a local path to the resources referenced by a URL. * Use this when you want to know the local path corresponding to aURL but do not * want to access it (yet). * <p> * Cannot resolve paths to non-local [not on filesystem] files or directories. * </p> * * @param url the URL to convert * @return a File representing the URL's location on the filesystem, or null if not accessible */ private static File urlToLocalFile(URL url) { try { url = Platform.resolve(url); } catch (IOException e) { } final String urlProtocol = url.getProtocol(); if (urlProtocol.equals("file")) { return new File(url.getFile()).getAbsoluteFile(); } return null; }
-}
diff --git a/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/ImportProjectTask.java b/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/ImportProjectTask.java
deleted file mode 100755
index b69d15b681..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/ImportProjectTask.java
+++ /dev/null
@@ -1,290 +0,0 @@
-package org.eclipse.swt.examples.launcher; /* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved */ import org.eclipse.core.boot.*; import org.eclipse.core.internal.events.*; import org.eclipse.core.resources.*; import org.eclipse.core.runtime.*; import org.eclipse.jdt.core.*; import org.eclipse.jdt.launching.*; import org.eclipse.jface.dialogs.*; import org.eclipse.swt.widgets.*; import org.eclipse.ui.dialogs.*; import org.eclipse.ui.internal.*; import org.eclipse.ui.wizards.datatransfer.*; import java.io.*; import java.lang.reflect.*; import java.net.*; import java.util.*; import java.util.zip.*;
-/** * ImportProjectTask maintains information about a project import session and provides * all necessary user interface support. */
-public class ImportProjectTask { // Support for externalized project properties information private static final String IMPORTPROJECT_PROPERTIES = "import.properties"; private static final String PROPERTYKEY_BUILDERS = "builders"; private static final String PROPERTYKEY_NATURES = "natures"; private static final String PROPERTYKEY_VARIABLES_PREFIX = "var."; private static final String PROPERTYKEY_ARGS_PREFIX = "args."; private static final String PROPERTYKEY_VMARGS_PREFIX = "vmargs."; // Property substitution keywords private static final String SUBST_KEYWORD_INTRO = "<<"; private static final String SUBST_KEYWORD_EXTRO = ">>"; private static final String SUBST_ECLIPSE_PLUGINS = "<<ECLIPSE_PLUGINS>>"; // path to the primary Eclipse plugins root directory private static final String SUBST_SWT_LIBRARY_PATH = "<<SWT_LIBRARY_PATH>>"; // path to the Eclipse libraries (java.library.path) // Default project properties private static final Properties defaultProjectProperties; static { defaultProjectProperties = new Properties(); defaultProjectProperties.setProperty(PROPERTYKEY_NATURES, "org.eclipse.jdt.core.javanature"); defaultProjectProperties.setProperty(PROPERTYKEY_BUILDERS, "org.eclipse.jdt.core.javabuilder"); defaultProjectProperties.setProperty(PROPERTYKEY_VARIABLES_PREFIX + "ECLIPSE_PLUGINS", SUBST_ECLIPSE_PLUGINS); } // Internal data
- private Shell parentShell;
- private String defaultProjectName;
- private URL sourceUrl;
-
- /**
- * Creates an ImportProjectTask specifying information about an import operation
- * to be performed.
- *
- * @param parentShell the Shell instance to use in dialogs.
- * @param defaultProjectName the default name of the project to import into
- * @param sourceUrl the URL of the ZIP/JAR file which we will import
- */
- public ImportProjectTask(Shell parentShell, String defaultProjectName, URL sourceUrl) {
- this.parentShell = parentShell;
- this.defaultProjectName = defaultProjectName;
- this.sourceUrl = sourceUrl;
- }
-
- /**
- * Disposes of operating system and platform resources associated with this instance.
- */
- public void dispose() {
- sourceUrl = null;
- }
-
- /**
- * Perform the import.
- *
- * @return true iff the import succeeded
- */
- public boolean execute() {
- String projectName = getNewProjectName(parentShell, defaultProjectName);
- if (projectName == null) return false;
- return doImportZip(projectName);
- }
-
- /**
- * Returns a project name into which to import a new item.
- *
- * @param defaultProjectName the default name to give the project
- * @return the name a new project, null if the user aborted
- */
- private String getNewProjectName(Shell parentShell, final String defaultProjectName) {
- InputDialog inputDialog = new InputDialog(parentShell,
- LauncherPlugin.getResourceString("dialog.ImportPathInput.title"),
- LauncherPlugin.getResourceString("dialog.ImportPathInput.message"),
- defaultProjectName,
- new IInputValidator() {
- public String isValid(String projectPath) {
- // verify that name is well-formed
- IWorkspace workspace = WorkbenchPlugin.getPluginWorkspace();
- projectPath = new Path(projectPath).makeAbsolute().toString();
- IStatus status = workspace.validatePath(projectPath,
- IResource.PROJECT | IResource.FOLDER);
- if (! status.isOK()) {
- return LauncherPlugin.getResourceString("dialog.InvalidTargetProjectPath.interactive");
- }
- // verify that project does not already exist
- IWorkspaceRoot workspaceRoot = workspace.getRoot();
- IProject project = workspaceRoot.getProject(projectPath);
- if (project.exists()) {
- return LauncherPlugin.getResourceString("dialog.ExistingProjectPath.interactive");
- }
- return null;
- }
- });
- inputDialog.setBlockOnOpen(true);
- inputDialog.open();
- String path = inputDialog.getValue();
- inputDialog.close();
-
- return (inputDialog.getReturnCode() == InputDialog.OK) ? path : null;
- }
-
- /**
- * Imports a new project from a Zip file.
- * Note that user feedback is provided when the result is false
- *
- * @param projectName the name to give the new project
- * @return true if the operation succeeds
- */
- private boolean doImportZip(String projectName) {
- final IPath projectPath = new Path(projectName).makeAbsolute();
-
- ZipFile zipFile = null;
- try {
- /* Open the Zip file and get a StructureProvider for it */ File file = urlToFile(sourceUrl); if (file == null) throw new Exception();
- zipFile = new ZipFile(file);
- ZipFileStructureProvider provider = new ZipFileStructureProvider(zipFile);
-
- return importExecute(projectPath, provider.getRoot(), provider);
- } catch (Exception e) {
- MessageDialog.openError(parentShell,
- LauncherPlugin.getResourceString("dialog.ImportProgramProblems.title"),
- LauncherPlugin.getResourceString("dialog.ErrorAccessingZipFile.message",
- new Object[] { sourceUrl.getFile(), e.getMessage() }));
- return false;
- } finally {
- try {
- if (zipFile != null) zipFile.close();
- } catch (IOException e) { }
- }
- }
-
- /**
- * Performs an import operation
- * Note that user feedback is provided when the result is false
- *
- * @param projectPath the absolute path of the project to create
- * @param source the source node for the import
- * @param provider the structure provider ImportOperation will use to retrieve file contents
- * @return true if the operation succeeds
- */
- private boolean importExecute(IPath projectPath, Object source, IImportStructureProvider provider) {
- /* Validate the target path */
- if (! importValidateProjectPath(projectPath)) return false;
-
- /* Locate the Project we will import into, or create it anew */
- final IWorkspace workspace = WorkbenchPlugin.getPluginWorkspace();
- final IWorkspaceRoot workspaceRoot = workspace.getRoot();
- final String projectName = projectPath.toString();
- final IProject project = workspaceRoot.getProject(projectName);
-
- /* Create a progress monitor for the import process */
- ProgressMonitorDialog progressDialog = new ProgressMonitorDialog(parentShell);
- progressDialog.setCancelable(true);
- progressDialog.open();
-
- /* Manipulate the ProjectDescription so that we can build the example */
- String exceptionMessage = null; Properties projectProperties = defaultProjectProperties;
- try {
- if (! project.exists()) {
- /* Create the project */
- exceptionMessage = "dialog.ErrorCreatingNewProject.message";
-
- IProjectDescription projectDesc = workspace.newProjectDescription(projectName);
- project.create(projectDesc, progressDialog.getProgressMonitor());
- }
- /* Open Project */
- project.open(progressDialog.getProgressMonitor());
- /* Import project properties from disk */ try { Object node = findStructuredChildElement(provider, source, IMPORTPROJECT_PROPERTIES); if (node != null) { InputStream is = provider.getContents(node); Properties properties = new Properties(); properties.load(is); projectProperties = properties; } } catch (Exception e) { }
- /* Set Project properties */
- exceptionMessage = "dialog.ErrorUpdatingProjectProperties.message";
-
- IProjectDescription projectDesc = project.getDescription();
- updateProjectDescription(projectDesc, projectProperties);
- project.setDescription(projectDesc, progressDialog.getProgressMonitor());
- } catch (Exception e) {
- if (progressDialog != null) progressDialog.close();
- if (exceptionMessage == null) exceptionMessage = "{0}";
- MessageDialog.openError(parentShell,
- LauncherPlugin.getResourceString("dialog.ImportProgramProblems.title"),
- LauncherPlugin.getResourceString(exceptionMessage, new Object[] { e.getMessage() }));
- return false;
- }
- /* Update the Classpath variables */ updateClasspathVariables(projectProperties, progressDialog.getProgressMonitor());
- /* Create the ImportOperation */
- ImportOperation importOperation = new ImportOperation(projectPath, source, provider,
- new IOverwriteQuery() {
- final String[] responses = new String[] {
- IOverwriteQuery.YES,
- IOverwriteQuery.NO,
- IOverwriteQuery.ALL,
- IOverwriteQuery.CANCEL};
- final String[] labels = new String[] {
- IDialogConstants.YES_LABEL,
- IDialogConstants.NO_LABEL,
- IDialogConstants.YES_TO_ALL_LABEL,
- IDialogConstants.CANCEL_LABEL};
-
- /* called to query user if existing files should be overwritten */
- public String queryOverwrite(String pathString) {
- final MessageDialog dialog =
- new MessageDialog(parentShell,
- LauncherPlugin.getResourceString("dialog.ImportProgramOverwrite.title"),
- null, LauncherPlugin.getResourceString("dialog.FileAlreadyExists.message",
- new Object[] { pathString }),
- MessageDialog.QUESTION, labels, 0);
- // run in syncExec because callback is from an operation,
- // which is probably not running in the UI thread.
- parentShell.getDisplay().syncExec(new Runnable() {
- public void run() {
- dialog.open();
- }
- });
- return dialog.getReturnCode() < 0 ? CANCEL : responses[dialog.getReturnCode()];
- }
- });
- importOperation.setOverwriteResources(false); // ask user before overwriting...
-
- /* Execute the operation */
- try {
- progressDialog.run(true, true, importOperation);
- } catch (InterruptedException e) {
- // aborted
- return false;
- } catch (InvocationTargetException e) {
- // failed
- MessageDialog.openError(parentShell,
- LauncherPlugin.getResourceString("dialog.ImportProgramProblems.title"),
- e.getTargetException().getMessage());
- return false;
- }
-
- /* Verify that the operation succeeded */
- IStatus status = importOperation.getStatus();
- if (! status.isOK()) {
- ErrorDialog.openError(parentShell,
- LauncherPlugin.getResourceString("dialog.ImportProgramProblems.title"),
- LauncherPlugin.getResourceString("dialog.ImportFailed.message"),
- status);
- return false;
- } /* Get the IJavaProject for this project */ IJavaProject javaProject = JavaCore.create(project); if (javaProject == null) { MessageDialog.openError(parentShell, LauncherPlugin.getResourceString("dialog.ImportProgramProblems.title"), LauncherPlugin.getResourceString("dialog.UnableToGetJavaProjectHandle.message")); return false; } /* Restore program and VM arguments */ updateProgramAndVMArguments(projectProperties, javaProject); return true;
- }
-
- /**
- * Updates a ProjectDescription prior to an import.
- *
- * @param projectDesc the IProjectDescription to fix * @param properties a Properties file containing entries of the form * natures = <string>[;<string>] * builders = <string>[;<string>] */
- private void updateProjectDescription(IProjectDescription projectDesc, Properties properties) { if (properties == null) return;
- /* Add natures */
- String[] natureIds = projectDesc.getNatureIds(); final String naturesList = properties.getProperty(PROPERTYKEY_NATURES); if (naturesList != null) { StringTokenizer entries = new StringTokenizer(naturesList, "; \t\n\r\f"); while (entries.hasMoreTokens()) { natureIds = addUniqueString(natureIds, entries.nextToken()); } projectDesc.setNatureIds(natureIds); }
-
- /* Add builders */
- ICommand[] buildSpecs = projectDesc.getBuildSpec();
- final String buildersList = properties.getProperty(PROPERTYKEY_BUILDERS); if (buildersList != null) { StringTokenizer entries = new StringTokenizer(buildersList, "; \t\n\r\f"); while (entries.hasMoreTokens()) { buildSpecs = addUniqueCommand(buildSpecs, entries.nextToken(), new HashMap()); } projectDesc.setBuildSpec(buildSpecs); } } /** * Updates the Classpath Variables. * * @param properties a Properties file containing entries of the form * var.<varname> = [<string>|<substitution string>] * @param progressMonitor an IProgressMonitor to use while setting things up */ private void updateClasspathVariables(Properties properties, IProgressMonitor progressMonitor) { Enumeration it = properties.propertyNames(); while (it.hasMoreElements()) { final String name = (String) it.nextElement(); if (name.startsWith(PROPERTYKEY_VARIABLES_PREFIX)) { final String varName = name.substring(PROPERTYKEY_VARIABLES_PREFIX.length()); final String path = properties.getProperty(name); if (path == null || path.length() == 0) continue; IPath oldValue = JavaCore.getClasspathVariable(varName); if (oldValue != null) continue; // silently ignore if set // Variable does not exist, set it. try { final IPath varPath = new Path(expandSubstitutionKeywords(path)); varPath.makeAbsolute(); JavaCore.setClasspathVariable(varName, varPath, progressMonitor); continue; } catch (Exception e) { } MessageDialog.openInformation(parentShell, LauncherPlugin.getResourceString("dialog.ImportProgramProblems.title"), LauncherPlugin.getResourceString("dialog.UnableToSetClasspathVariable.message", new Object[] { varName, path } )); } } } /** * Updates the Program and VM Arguments. * * @param properties a Properties file containing entries of the form * args.<resource path>%<class> = [<string>|<substitution string>] * vmargs.<resource path>%<class> = [<string>|<substitution string>] * @param javaProject the IJavaProject to work on */ private void updateProgramAndVMArguments(Properties properties, IJavaProject javaProject) { Enumeration it = properties.propertyNames(); while (it.hasMoreElements()) { final String name = (String) it.nextElement(); final String entry; final int argId; // 0 is program, 1 is VM // Get property key if (name.startsWith(PROPERTYKEY_ARGS_PREFIX)) { entry = name.substring(PROPERTYKEY_ARGS_PREFIX.length()); argId = 0; } else if (name.startsWith(PROPERTYKEY_VMARGS_PREFIX)) { entry = name.substring(PROPERTYKEY_VMARGS_PREFIX.length()); argId = 1; } else continue; // Parse entry int index = entry.indexOf('%'); if (index == -1) continue; // ignore invalid entry final String resource = entry.substring(0, index); final String className = entry.substring(index + 1); String value = properties.getProperty(name); if (value == null) continue; value = expandSubstitutionKeywords(value); try { IPath resourcePath = new Path(resource); IJavaElement javaElement = javaProject.findElement(resourcePath); if (javaElement != null && javaElement.getElementType() == IJavaElement.COMPILATION_UNIT && javaElement.exists()) { ICompilationUnit compilationUnit = (ICompilationUnit) javaElement; IType javaType = compilationUnit.getType(className); if (javaType != null && javaType.exists()) { ExecutionArguments oldArgs = ExecutionArguments.getArguments(javaType); String vmArgs; String programArgs; if (oldArgs == null) { vmArgs = ""; programArgs = ""; } else { vmArgs = oldArgs.getVMArguments(); programArgs = oldArgs.getProgramArguments(); } if (argId == 0) { programArgs = value; } else { vmArgs = value; } ExecutionArguments newArgs = new ExecutionArguments(vmArgs, programArgs); ExecutionArguments.setArguments(javaType, newArgs); continue; } } } catch (Exception e) { } MessageDialog.openInformation(parentShell, LauncherPlugin.getResourceString("dialog.ImportProgramProblems.title"), LauncherPlugin.getResourceString((argId == 0) ? "dialog.UnableToProgramArguments.message" : "dialog.UnableToVMArguments.message", new Object[] { resource, className, value } )); } } /** * Replaces any substitution keywords with their values. * * @param string the string to work on * @return the expanded string */ private String expandSubstitutionKeywords(String string) { int endIndex = 0; for (;;) { int index = string.indexOf(SUBST_KEYWORD_INTRO, endIndex); if (index == -1) return string; endIndex = string.indexOf(SUBST_KEYWORD_EXTRO, index); if (endIndex == -1) return string; endIndex += SUBST_KEYWORD_EXTRO.length(); final String keyword = string.substring(index, endIndex); String value = null; for (int i = 0; i < substitutionKeywords.length; ++i) { final SubstitutionKeyword subst = substitutionKeywords[i]; if (subst.isMatch(keyword)) { value = subst.getValue(); break; } } if (value == null) { MessageDialog.openInformation(parentShell, LauncherPlugin.getResourceString("dialog.ImportProgramProblems.title"), LauncherPlugin.getResourceString("dialog.UnableExpandSubstitutionKeyword.message", new Object[] { keyword, string } )); } else { string = string.substring(0, index) + value + string.substring(endIndex); } } } /** Data for subsitution keywords **/ static abstract class SubstitutionKeyword { public abstract boolean isMatch(String keyword); public abstract String getValue(); } static final SubstitutionKeyword[] substitutionKeywords = new SubstitutionKeyword[] { // <<ECLIPSE_PLUGINS>> new SubstitutionKeyword() { public boolean isMatch(String keyword) { return keyword.equalsIgnoreCase(SUBST_ECLIPSE_PLUGINS); } public String getValue() { try { // Guess at primary plugins directory location // get the platform's public plugin registry IPluginRegistry pluginRegistry = Platform.getPluginRegistry(); // retrieve plugin descriptor for org.eclipse.core IPluginDescriptor pd = pluginRegistry.getPluginDescriptor("org.eclipse.core.runtime"); // getInstallUrl() returns the path of the directory with the plugin manifest file(s) // for a specific plugin, find the parent directory final URL installUrl = Platform.resolve(pd.getInstallURL()); if (installUrl.getProtocol().equals("file")) { String pluginPath = installUrl.getFile(); pluginPath = pluginPath.substring(0, pluginPath.lastIndexOf('/')); // eliminate terminal '/' on directory pluginPath = pluginPath.substring(0, 1 + pluginPath.lastIndexOf('/')); // locate parent directory return pluginPath; } } catch (Exception e) { } return null; } }, // <<SWT_LIBRARY_PATH>> new SubstitutionKeyword() { public boolean isMatch(String keyword) { return keyword.equalsIgnoreCase(SUBST_SWT_LIBRARY_PATH); } public String getValue() { try { IPluginRegistry pluginRegistry = Platform.getPluginRegistry(); IPluginDescriptor pd = pluginRegistry.getPluginDescriptor("org.eclipse.swt"); final URL installUrl = pd.getInstallURL(); // not supported yet: final URL libraryUrl = new URL(installUrl, "$ws$"); final URL libraryUrl = new URL(installUrl, "ws/" + BootLoader.getWS()); final URL resolveUrl = Platform.resolve(libraryUrl); if (resolveUrl.getProtocol().equals("file")) { return resolveUrl.getFile(); } } catch (Exception e) { } return null; } } }; /**
- * Validates the target project path
- *
- * @param projectPath the project path to verify
- * @return true if the path is valid
- * Note that user feedback is provided when the result is false
- */
- private boolean importValidateProjectPath(IPath projectPath) {
- IWorkspace workspace = WorkbenchPlugin.getPluginWorkspace();
- IStatus status = workspace.validatePath(projectPath.toString(), IResource.PROJECT | IResource.FOLDER);
- if (! status.isOK()) {
- ErrorDialog.openError(parentShell,
- LauncherPlugin.getResourceString("dialog.ImportProgramProblems.title"),
- LauncherPlugin.getResourceString("dialog.InvalidTargetProjectPath.message",
- new Object[] { projectPath.toString() }),
- status);
- return false;
- }
- return true;
- }
-
- /**
- * Adds a unique String to a String[].
- *
- * @param array the old String array
- * @param string the new String
- * @return the new String array (may be same as old)
- */
- private String[] addUniqueString(String[] array, String string) {
- for (int i = 0; i < array.length; ++i) {
- if (array[i].equals(string)) return array;
- }
- String[] newArray = new String[array.length + 1];
- System.arraycopy(array, 0, newArray, 0, array.length);
- newArray[array.length] = string;
- return newArray;
- }
-
- /**
- * Adds a unique ICommand to a ICommand[].
- *
- * @param array the old ICommand array
- * @param builderName the new builder name
- * @param builderArgs the new arguments
- * @return the new ICommand array (may be same as old)
- */
- private ICommand[] addUniqueCommand(ICommand[] array, String builderName, Map builderArgs) {
- for (int i = 0; i < array.length; ++i) {
- final String name = array[i].getBuilderName();
- final Map args = array[i].getArguments();
-
- if ((name != null) && (name.equals(builderName))) return array;
- }
- ICommand[] newArray = new ICommand[array.length + 1];
- System.arraycopy(array, 0, newArray, 0, array.length);
- BuildCommand newCommand = new BuildCommand();
- newCommand.setBuilderName(builderName);
- newCommand.setArguments(builderArgs);
- newArray[array.length] = newCommand;
- return newArray;
- } /** * Finds a particular child of a container in an IImportStructureProvider. * */ private Object findStructuredChildElement(IImportStructureProvider provider, Object parent, String name) { if (! provider.isFolder(parent)) return null; java.util.List list = provider.getChildren(parent); if (list == null) return null; for (Iterator it = list.iterator(); it.hasNext(); ) { Object item = it.next(); if (provider.getLabel(item).equals(name)) return item; } return null; } /** * Get a File through which it is possible to access the contents of a URL. * Use this when you want to be able to access the contents of a URL immediately. * <p> * Will automatically cache contents from non-local files or Jars on the local filesystem. * Cannot resolve paths to non-local [not on filesystem] directories. * </p> * * @param url the URL to convert * @return a File where the URL's data can be accessed, or null if not accessible */ private static File urlToFile(URL url) { try { url = Platform.asLocalURL(url); } catch (IOException e) { try { url = Platform.resolve(url); // perhaps it is a directory on the local filesystem } catch (IOException e2) { } } final String urlProtocol = url.getProtocol(); if (urlProtocol.equals("file")) { return new File(url.getFile()).getAbsoluteFile(); } return null; }
-}
diff --git a/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/ItemDescriptor.java b/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/ItemDescriptor.java
deleted file mode 100755
index 735291513b..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/ItemDescriptor.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package org.eclipse.swt.examples.launcher; /* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved */ import java.net.*; import org.eclipse.swt.graphics.*;
- /** * ItemDescriptor collects information about a launch item. */
-class ItemDescriptor {
- private String id;
- private String name;
- private String description; private Image icon;
- private URL sourceCodePath;
- private LaunchDelegate launchDelegate;
-
- /**
- * Constructs an ItemDescriptor.
- *
- * @param id the id
- * @param name the name
- * @param description the description
- * @param launchDelegate a launch delegate for the program to be launched using this descriptor,
- * may be null if item is not launchable
- */
- public ItemDescriptor(String id, String name, String description, URL sourceCodePath,
- Image icon, LaunchDelegate launchDelegate) {
- this.id = id;
- this.name = name;
- this.description = description;
- this.sourceCodePath = sourceCodePath; this.icon = icon;
- this.launchDelegate = launchDelegate;
- }
-
- /**
- * Returns the ID for this program.
- *
- * @return the user-specified ID for this program
- */
- public String getId() {
- return id;
- }
-
- /**
- * Returns the translated name for the program.
- *
- * @return the name of the program
- */
- public String getName() {
- return name;
- }
-
- /**
- * Returns a short description for the program.
- *
- * @return a newline-delimited string describing the program, null if no description is available
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * Returns source code path
- *
- * @return a URL specifying the name of a zip/jar or the base of a directory where the source
- * code is stored, null if no source is available
- */
- public URL getSourceCodePath() {
- return sourceCodePath;
- }
- /** * Returns an icon for this descriptor * * @returns an icon, null if the item is a folder */ public Image getIcon() { return icon; }
- /**
- * Returns launch delegate for the program.
- *
- * @return the launch delegate, null if the item is a folder
- */
- public LaunchDelegate getLaunchDelegate() {
- return launchDelegate;
- } /** * Determines if an item is a folder. * * @return true if the item is a folder */ public boolean isFolder() { return launchDelegate == null; }
-
- /**
- * Determines the equality of descriptors.
- *
- * @return true if this.getId().equalsIgnoreCase(other.getId())
- */
- public boolean equals(Object other) { if (other instanceof ItemDescriptor) {
- ItemDescriptor otherDescriptor = (ItemDescriptor) other;
- return getId().equalsIgnoreCase(otherDescriptor.getId());
- }
- return false;
- } /** * Produces a hashcode. * * @return the hashcode */ public int hashCode() { return id.toUpperCase().hashCode(); }
-}
diff --git a/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/ItemTreeNode.java b/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/ItemTreeNode.java
deleted file mode 100755
index bc1a5ac185..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/ItemTreeNode.java
+++ /dev/null
@@ -1,73 +0,0 @@
-package org.eclipse.swt.examples.launcher;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-/**
- * Internal class used to store tree structures of ItemDescriptors
- */
-class ItemTreeNode {
- private ItemTreeNode nextSibling;
- private ItemTreeNode firstChild;
- private ItemDescriptor descriptor;
-
- /**
- * Constructs a leaf ItemTreeNode with a given descriptor.
- *
- * @param descriptor the descriptor
- */
- public ItemTreeNode(ItemDescriptor descriptor) {
- this.descriptor = descriptor;
- }
-
- /**
- * Adds a node to the Tree in sorted order by name.
- *
- * @param node the node to add. Note that node.nextSibling must be null
- */
- public void addSortedNode(ItemTreeNode node) {
- if (firstChild == null) {
- firstChild = node;
- } else if (firstChild.descriptor.getName().compareTo(node.descriptor.getName()) > 0) {
- node.nextSibling = firstChild;
- firstChild = node;
- } else {
- ItemTreeNode cursor;
- for (cursor = firstChild; cursor.nextSibling != null; cursor = cursor.nextSibling) {
- ItemTreeNode sibling = cursor.nextSibling;
- if (sibling.descriptor.getName().compareTo(node.descriptor.getName()) > 0) break;
- }
- node.nextSibling = cursor.nextSibling;
- cursor.nextSibling = node;
- }
- }
-
- /**
- * Returns the descriptor for this node.
- *
- * @return the descriptor
- */
- public ItemDescriptor getDescriptor() {
- return descriptor;
- }
-
- /**
- * Returns the next sibling of this node.
- *
- * @return the next sibling, or null if none
- */
- public ItemTreeNode getNextSibling() {
- return nextSibling;
- }
-
- /**
- * Returns the first child of this node.
- *
- * @return the first child, or null if none
- */
- public ItemTreeNode getFirstChild() {
- return firstChild;
- }
-}
diff --git a/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/LaunchDelegate.java b/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/LaunchDelegate.java
deleted file mode 100755
index 24548a3539..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/LaunchDelegate.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.eclipse.swt.examples.launcher;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
- import org.eclipse.core.runtime.*; import org.eclipse.ui.*; /** * LaunchDelegate provide a means of encapsulating a method for launching a * variety of programs of different types along with information about these * programs. */
-interface LaunchDelegate { /** * Launches the program described by this object. * * @param hostView the IViewPart for the launcher program. Use this to ensure that * child programs are visible on the same display / Eclipse perspective as * the launcher application * @return true if the launch was successful */
- public boolean launch(IViewPart hostView);
-}
diff --git a/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/LauncherApplication.java b/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/LauncherApplication.java
deleted file mode 100755
index fce7ce9e58..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/LauncherApplication.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package org.eclipse.swt.examples.launcher; /* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved */ import java.lang.reflect.*; import java.util.*; import org.eclipse.core.boot.*; import org.eclipse.core.runtime.*; /** * LauncherApplication provides a mechanism for launching arbitrary executable programs * from within the Eclipse Platform. This class binds to the * <core>org.eclipse.core.runtime.applications</code> extension point. */
-public class LauncherApplication implements IPlatformRunnable {
- public static final String APPLICATION_ID = "org.eclipse.swt.examples.launcher.application";
- /** * Invokes the program specified in the arguments. * * @param argsVanilla a String[] containing the arguments, one token per array index. * <ul> * <li>-appclass &lt;class name&gt; the name of the class whose main() method is to be invoked * [note: do not add a .java or .class suffix] * <li>-appplugin &lt;pluginid&gt; the id of the plugin containing the specified class * <li>-appargs &lt;args&gt; all remaining tokens to the right of this switch are passed as * arguments to the main() method when the program is launched * </ul> * @return null */
- public Object run(Object argsVanilla) throws Exception {
- final String[] args = (String[]) argsVanilla;
- String programPluginId = null; // id of plugin containing the program
- String[] programArgs = null; // arguments for the program
- String programClass = null; // class with main() method
-
- try {
- for (int i = 0; i < args.length; ++i) {
- if (args[i].equalsIgnoreCase("-appplugin")) {
- programPluginId = args[++i];
- } else if (args[i].equalsIgnoreCase("-appclass")) {
- programClass = args[++i];
- } else if (args[i].equalsIgnoreCase("-appargs")) {
- ++i;
- programArgs = new String[args.length - i];
- System.arraycopy(args, i, programArgs, 0, programArgs.length);
- break;
- } else {
- // ignore unrecognized argument
- }
- }
- } catch (ArrayIndexOutOfBoundsException e) {
- throw new IllegalArgumentException("run.error.MalformedArgumentList");
- }
-
- if (programPluginId == null) throw new IllegalArgumentException(
- "run.error.MissingAppPlugin");
- if (programClass == null) throw new IllegalArgumentException(
- "run.error.MissincAppClass");
- if (programArgs == null) programArgs = new String[0];
-
- // get the platform's public plugin registry
- IPluginRegistry pluginRegistry = Platform.getPluginRegistry();
- // retrieve plugin descriptors for all plugins matching pluginId
- // [array may contain multiple versions of a given plugin]
- IPluginDescriptor[] pluginDescriptors = pluginRegistry.getPluginDescriptors(programPluginId);
-
- if (pluginDescriptors == null || pluginDescriptors.length == 0) {
- LauncherPlugin.logError(LauncherPlugin.getResourceString("run.error.CouldNotFindPlugin",
- new Object[] { programPluginId }), null);
- return null;
- }
-
- // sort list of plugins in decreasing order by version number
- Arrays.sort(pluginDescriptors, new Comparator() {
- public int compare(Object a, Object b) {
- final PluginVersionIdentifier versionA = ((IPluginDescriptor) a).getVersionIdentifier();
- final PluginVersionIdentifier versionB = ((IPluginDescriptor) b).getVersionIdentifier();
- return versionA.isGreaterThan(versionB) ? -1 :
- (versionA.equals(versionB) ? 0 : 1);
- }
- });
-
- // attempt to load and run a program in decreasing order by version until we find one
- // that works or we run out of them
- for (int i = 0; i < pluginDescriptors.length; ++i) {
- final IPluginDescriptor pd = pluginDescriptors[i];
- final ClassLoader loader = pd.getPluginClassLoader();
-
- try {
- Class programMainClass = Class.forName(programClass, true, loader);
-
- final Class[] parameterList = { String[].class };
- Method programMainMethod = programMainClass.getMethod("main", parameterList);
-
- final Object[] parameters = { new String[0] };
- programMainMethod.invoke(null, parameters); // SUCCESS! return null; } catch (InvocationTargetException e) {
- LauncherPlugin.logError(LauncherPlugin.getResourceString("run.error.Execution"), e);
- break; // it ran so stop searching
- } catch (Throwable e) {
- LauncherPlugin.logError(LauncherPlugin.getResourceString("run.error.Invocation"), e);
- }
- }
- LauncherPlugin.logError(LauncherPlugin.getResourceString("run.error.CouldNotFindMain"), null);
- return null;
- }
-}
diff --git a/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/LauncherPlugin.java b/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/LauncherPlugin.java
deleted file mode 100755
index 1ee79c11e3..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/LauncherPlugin.java
+++ /dev/null
@@ -1,413 +0,0 @@
-package org.eclipse.swt.examples.launcher;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import java.io.*; import java.net.*; import java.text.*; import java.util.*; import org.eclipse.core.runtime.*; import org.eclipse.swt.graphics.*; import org.eclipse.ui.plugin.*;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class LauncherPlugin extends AbstractUIPlugin {
- //The shared instance.
- private static LauncherPlugin plugin;
- private static ResourceBundle resourceBundle;
-
- private static final String
- LAUNCH_ITEMS_POINT_ID = "org.eclipse.swt.examples.launcher.launchItems",
- LAUNCH_ITEMS_XML_CATEGORY = "category",
- LAUNCH_ITEMS_XML_ITEM = "item",
- LAUNCH_ITEMS_XML_ITEM_ICON = "icon",
- LAUNCH_ITEMS_XML_ITEM_DESCRIPTION = "description",
- LAUNCH_ITEMS_XML_PROGRAM = "program",
- LAUNCH_ITEMS_XML_PROGRAM_PLUGIN = "pluginId",
- LAUNCH_ITEMS_XML_PROGRAM_CLASS = "mainClass",
- LAUNCH_ITEMS_XML_VIEW = "view",
- LAUNCH_ITEMS_XML_VIEW_VIEWID = "viewId",
- LAUNCH_ITEMS_XML_SOURCE = "source",
- LAUNCH_ITEMS_XML_SOURCE_ZIP = "zip",
- LAUNCH_ITEMS_XML_ATTRIB_ID = "id",
- LAUNCH_ITEMS_XML_ATTRIB_NAME = "name",
- LAUNCH_ITEMS_XML_ATTRIB_ENABLED = "enabled",
- LAUNCH_ITEMS_XML_ATTRIB_CATEGORY = "category",
- LAUNCH_ITEMS_XML_VALUE_TRUE = "true",
- LAUNCH_ITEMS_XML_VALUE_FALSE = "false";
-
- static final int
- liClosedFolder = 0,
- liOpenFolder = 1,
- liGenericExample = 2;
- static final String[] imageLocations = {
- "icons/closedFolder.gif",
- "icons/openFolder.gif",
- "icons/generic_example.gif" };
- static Image images[];
-
- /**
- * Constructs the LauncherPlugin.
- */
- public LauncherPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- plugin = this;
- resourceBundle = descriptor.getResourceBundle();
- }
-
- /**
- * Clean up
- */
- public void shutdown() throws CoreException {
- super.shutdown();
- freeResources();
- }
-
- /**
- * Returns the shared instance.
- */
- public static LauncherPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Loads the resources
- */
- public static void initResources() {
- if (images == null) {
- images = new Image[imageLocations.length];
-
- for (int i = 0; i < imageLocations.length; ++i) {
- images[i] = getImageFromPlugin(plugin.getDescriptor(), imageLocations[i]);
- if (images[i] == null) {
- freeResources();
- logError(getResourceString("error.CouldNotLoadResources"), null);
- throw new IllegalStateException();
- }
- }
- }
- }
-
- /**
- * Frees the resources
- */
- public static 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;
- }
- }
-
- /**
- * Log an error to the ILog for this plugin
- *
- * @param message the localized error message text
- * @param exception the associated exception, or null
- */
- public static void logError(String message, Throwable exception) {
- plugin.getLog().log(new Status(IStatus.ERROR, plugin.getDescriptor().getUniqueIdentifier(),
- 0, message, exception));
- }
-
- /**
- * Returns a string from the resource bundle.
- * We don't want to crash because of a missing String.
- * Returns the key if not found.
- */
- public static String getResourceString(String key) {
- try {
- return resourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return key;
- } catch (NullPointerException e) {
- return "!" + key + "!";
- }
- }
-
- /**
- * Returns a string from the resource bundle and binds it
- * with the given arguments. If the key is not found,
- * return the key.
- */
- public static String getResourceString(String key, Object[] args) {
- try {
- return MessageFormat.format(getResourceString(key), args);
- } catch (MissingResourceException e) {
- return key;
- } catch (NullPointerException e) {
- return "!" + key + "!";
- }
- }
-
- /**
- * Constructs a list of available programs from registered extensions.
- *
- * @return an ItemTreeNode representing the root of a tree of items (the root is not to be displayed)
- */
- public static ItemTreeNode getLaunchItemTree() {
- ItemTreeNode categoryTree =
- new ItemTreeNode(new ItemDescriptor("<<Root>>", "<<Root>>", null, null, null, null));
-
- // get the platform's public plugin registry
- IPluginRegistry pluginRegistry = Platform.getPluginRegistry();
- // retrieve all configuration elements registered at our launchItems extension-point
- IConfigurationElement[] configurationElements =
- pluginRegistry.getConfigurationElementsFor(LAUNCH_ITEMS_POINT_ID);
-
- if (configurationElements == null || configurationElements.length == 0) {
- logError("Could not find registered extensions", null);
- return categoryTree;
- }
-
- /* Collect all launch categories -- coalesce those with same ID */
- HashMap idMap = new HashMap();
- for (int i = 0; i < configurationElements.length; ++i) {
- final IConfigurationElement ce = configurationElements[i];
- final String ceName = ce.getName();
- final String attribId = getItemAttribute(ce, LAUNCH_ITEMS_XML_ATTRIB_ID, null);
-
- if (idMap.containsKey(attribId)) continue;
- if (ceName.equalsIgnoreCase(LAUNCH_ITEMS_XML_CATEGORY)) {
- final String attribName = getItemName(ce);
- ItemDescriptor theDescriptor = new ItemDescriptor(attribId, attribName,
- getItemDescription(ce), null, null, null);
- idMap.put(attribId, new ItemTreeNode(theDescriptor));
- }
- }
-
- /* Generate launch category hierarchy */
- Set tempIdSet = new HashSet(); // used to prevent duplicates from being entered into the tree
- for (int i = 0; i < configurationElements.length; ++i) {
- final IConfigurationElement ce = configurationElements[i];
- final String ceName = ce.getName();
- final String attribId = getItemAttribute(ce, LAUNCH_ITEMS_XML_ATTRIB_ID, null);
-
- if (tempIdSet.contains(attribId)) continue;
- if (ceName.equalsIgnoreCase(LAUNCH_ITEMS_XML_CATEGORY)) {
- final ItemTreeNode theNode = (ItemTreeNode) idMap.get(attribId);
- addItemByCategory(ce, categoryTree, theNode, idMap);
- tempIdSet.add(attribId);
- }
- }
-
- /* Generate program tree */
- for (int i = 0; i < configurationElements.length; ++i) {
- final IConfigurationElement ce = configurationElements[i];
- final String ceName = ce.getName();
- final String attribId = getItemAttribute(ce, LAUNCH_ITEMS_XML_ATTRIB_ID, null);
-
- if (idMap.containsKey(attribId)) continue;
- if (ceName.equalsIgnoreCase(LAUNCH_ITEMS_XML_CATEGORY)) {
- // ignore
- } else if (ceName.equalsIgnoreCase(LAUNCH_ITEMS_XML_ITEM)) {
- final String enabled = getItemAttribute(ce, LAUNCH_ITEMS_XML_ATTRIB_ENABLED,
- LAUNCH_ITEMS_XML_VALUE_TRUE);
- if (enabled.equalsIgnoreCase(LAUNCH_ITEMS_XML_VALUE_FALSE)) continue;
- ItemDescriptor theDescriptor = createItemDescriptor(ce, attribId);
-
- if (theDescriptor != null) {
- final ItemTreeNode theNode = new ItemTreeNode(theDescriptor);
- addItemByCategory(ce, categoryTree, theNode, idMap);
- idMap.put(attribId, theNode);
- }
- }
- }
- return categoryTree;
- }
-
-
- /**
- * Adds an item to the category tree.
- */
- private static void addItemByCategory(IConfigurationElement ce, ItemTreeNode root,
- ItemTreeNode theNode, HashMap idMap) {
- final String attribCategory = getItemAttribute(ce, LAUNCH_ITEMS_XML_ATTRIB_CATEGORY, null);
-
- // locate the parent node
- ItemTreeNode parentNode = null;
- if (attribCategory != null) {
- parentNode = (ItemTreeNode) idMap.get(attribCategory);
- }
- if (parentNode == null) parentNode = root;
-
- // add the item
- parentNode.addSortedNode(theNode);
- }
-
- /**
- * Creates an ItemDescriptor from an XML definition.
- *
- * @param ce the IConfigurationElement describing the item
- * @param attribId the attribute id
- * @return a new ItemDescriptor, or null if an error occurs
- */
- private static ItemDescriptor createItemDescriptor(IConfigurationElement ce, String attribId) {
- final String attribName = getItemName(ce);
- final Image attribIcon = getItemIcon(ce);
- final String attribDescription = getItemDescription(ce);
- final URL attribSourceZip;
- final LaunchDelegate launchDelegate;
-
- IConfigurationElement sourceCE = getItemElement(ce, LAUNCH_ITEMS_XML_SOURCE);
- attribSourceZip = (sourceCE != null) ? getSourceCodePath(sourceCE) : null;
-
- IConfigurationElement viewCE = getItemElement(ce, LAUNCH_ITEMS_XML_VIEW);
- if (viewCE != null) {
- final String attribView = getItemAttribute(viewCE, LAUNCH_ITEMS_XML_VIEW_VIEWID, null);
- if (attribView == null) {
- logError(getResourceString("error.IncompleteViewLaunchItem",
- new Object[] { attribId } ), null);
- return null;
- }
- launchDelegate = new ViewLaunchDelegate(attribView);
- } else {
- IConfigurationElement programCE = getItemElement(ce, LAUNCH_ITEMS_XML_PROGRAM);
- if (programCE != null) {
- final String attribPluginId = getItemAttribute(programCE, LAUNCH_ITEMS_XML_PROGRAM_PLUGIN, null);
- final String attribClass = getItemAttribute(programCE, LAUNCH_ITEMS_XML_PROGRAM_CLASS, null);
-
- if (attribClass == null || attribPluginId == null) {
- logError(getResourceString("error.IncompleteProgramLaunchItem",
- new Object[] { attribId } ), null);
- return null;
- }
- launchDelegate = new ProgramLaunchDelegate(attribPluginId, attribClass);
- } else {
- logError(getResourceString("error.IncompleteLaunchItem",
- new Object[] { attribId } ), null);
- return null;
- }
- }
- return new ItemDescriptor(attribId, attribName, attribDescription, attribSourceZip,
- attribIcon, launchDelegate);
- }
-
- /**
- * Returns the first instance of a particular child XML element.
- *
- * @param ce the IConfigurationElement parent
- * @param element the name of the element to fetch
- * @return the element's IConfigurationElement, or null if not found
- */
- private static IConfigurationElement getItemElement(IConfigurationElement ce, String element) {
- IConfigurationElement[] elementCEs = ce.getChildren(element);
- return (elementCEs != null && elementCEs.length != 0) ? elementCEs[0] : null;
- }
-
- /**
- * Returns the value of an XML attribute for an item.
- *
- * @param ce the IConfigurationElement describing the item
- * @param attribute the attribute to fetch
- * @param defaultValue the value to return if the attribute is not found
- * @return the attribute value
- */
- private static String getItemAttribute(IConfigurationElement ce, String attribute, String defaultValue) {
- String value = ce.getAttribute(attribute);
- return (value != null) ? value : defaultValue;
- }
-
- /**
- * Returns the description string given the IConfigurationElement for an item.
- *
- * @param ce the IConfigurationElement describing the item
- * @return a newline-delimited string that describes this item, or null if none
- */
- private static String getItemDescription(IConfigurationElement ce) {
- String description = getItemAttribute(ce, LAUNCH_ITEMS_XML_ITEM_DESCRIPTION, "");
- return (description.length() == 0) ? null : description;
- }
-
- /**
- * Returns the name of an item.
- *
- * @param ce the IConfigurationElement describing the item
- * @return the attribute value
- */
- private static String getItemName(IConfigurationElement ce) {
- return getItemAttribute(ce, LAUNCH_ITEMS_XML_ATTRIB_NAME,
- getResourceString("launchitem.Missing.name"));
- }
-
-
- /**
- * Returns the icon for an item.
- *
- * @param ce the IConfigurationElement describing the item
- * @return an icon
- */
- private static Image getItemIcon(IConfigurationElement ce) {
- String iconPath = getItemAttribute(ce, LAUNCH_ITEMS_XML_ITEM_ICON, "");
- if (iconPath.length() != 0) {
- Image icon = getImageFromPlugin(ce.getDeclaringExtension().getDeclaringPluginDescriptor(),
- iconPath);
- if (icon != null) {
- Image[] newImages = new Image[images.length + 1];
- System.arraycopy(images, 0, newImages, 0, images.length);
- newImages[images.length] = icon;
- images = newImages;
- return icon;
- }
- }
- return images[liGenericExample];
- }
-
- /**
- * Gets an image from a path relative to the plugin install directory.
- *
- * @param pd the plugin descriptor for the plugin with the image
- * @param iconPath the path relative to the install directory
- * @return the image, or null if not found
- */
- private static Image getImageFromPlugin(IPluginDescriptor pd, String iconPath) {
- InputStream is = null;
- try {
- URL installUrl = pd.getInstallURL();
- URL url = new URL(installUrl, iconPath);
- is = url.openConnection().getInputStream();
- ImageData source = new ImageData(is);
- ImageData mask = source.getTransparencyMask();
- Image image = new Image(null, source, mask);
- return image;
- } catch (Throwable ex) {
- return null;
- } finally {
- try {
- if (is != null) is.close();
- } catch (IOException e) {
- }
- }
- }
-
- /**
- * Returns the path of the source code for an item.
- *
- * @param ce the IConfigurationElement describing the item
- * @return a URL containing the source code path, or null if none is available
- */
- private static URL getSourceCodePath(IConfigurationElement ce) {
- String sourcePath = getItemAttribute(ce, LAUNCH_ITEMS_XML_SOURCE_ZIP, "");
- if (sourcePath.length() != 0) {
- try {
- // Extract the URL
- IPluginDescriptor pd = ce.getDeclaringExtension().getDeclaringPluginDescriptor();
- URL sourceUrl = new URL(pd.getInstallURL(), sourcePath);
-
- // Test the URL to make sure there really is a resource here
- // (this helps to prevent the user from seeing "Add to Workspace" if no
- // source bundle is available but one has been specified)
- try {
- InputStream is = sourceUrl.openStream();
- is.close();
- } catch (IOException e) {
- return null;
- }
- return sourceUrl;
- } catch (MalformedURLException e) {
- }
- }
- return null;
- }
-} \ No newline at end of file
diff --git a/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/LauncherView.java b/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/LauncherView.java
deleted file mode 100755
index 740c663ab7..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/LauncherView.java
+++ /dev/null
@@ -1,234 +0,0 @@
-package org.eclipse.swt.examples.launcher;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import java.net.*; import org.eclipse.jface.dialogs.*; import org.eclipse.swt.*; import org.eclipse.swt.events.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; import org.eclipse.ui.part.*;
-
-/**
- * Launcher uses <code>org.eclipse.swt</code> and <code>org.eclipse.core</code>
- * to launch the other registered examples.
- *
- * @see ViewPart
- */
-public class LauncherView extends ViewPart {
- private Shell workbenchShell;
-
- private Tree launchTree;
- private Text descriptionText;
- //private Button importButton;
- private Button runButton;
-
- /**
- * Constructs a LauncherView.
- */
- public LauncherView() {
- LauncherPlugin.initResources();
- }
-
- /**
- * Creates the example.
- *
- * @see ViewPart#createPartControl
- */
- public void createPartControl(Composite parent) {
- workbenchShell = getSite().getShell();
- parent.setLayout(new SplitLayout());
-
- Group launchGroup = new Group(parent, SWT.NULL);
- launchGroup.setText(LauncherPlugin.getResourceString("view.launchGroup.text"));
-
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 2;
- launchGroup.setLayout(gridLayout);
-
- launchTree = new Tree(launchGroup, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
- gridData.horizontalSpan = 2;
- launchTree.setLayoutData(gridData);
- launchTree.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent event) {
- final ItemDescriptor item = getSelectedItem();
- setDescriptionByItem(item);
- }
- public void widgetDefaultSelected(SelectionEvent event) {
- final ItemDescriptor item = getSelectedItem();
- setDescriptionByItem(item);
- runItem(getSelectedItem());
- }
- });
- launchTree.addTreeListener(new TreeListener() {
- public void treeCollapsed(TreeEvent event) {
- final TreeItem item = (TreeItem) event.item;
- if (item == null) return;
- item.setImage(LauncherPlugin.images[LauncherPlugin.liClosedFolder]);
- }
- public void treeExpanded(TreeEvent event) {
- final TreeItem item = (TreeItem) event.item;
- if (item == null) return;
- item.setImage(LauncherPlugin.images[LauncherPlugin.liOpenFolder]);
- }
- });
-
- runButton = new Button(launchGroup, SWT.PUSH);
- runButton.setText(LauncherPlugin.getResourceString("view.launchButton.text"));
- runButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent event) {
- runItem(getSelectedItem());
- }
- public void widgetDefaultSelected(SelectionEvent event) {
- }
- });
-
- //importButton = new Button(launchGroup, SWT.PUSH);
- //importButton.setText(LauncherPlugin.getResourceString("view.importButton.text"));
- //importButton.addSelectionListener(new SelectionListener() {
- // public void widgetSelected(SelectionEvent event) {
- // importItem(getSelectedItem());
- // }
- // public void widgetDefaultSelected(SelectionEvent event) {
- // }
- //});
-
-
- Group descriptionGroup = new Group(parent, SWT.NULL);
- descriptionGroup.setText(LauncherPlugin.getResourceString("view.descriptionGroup.text"));
- descriptionGroup.setLayout(new FillLayout());
-
- descriptionText = new Text(descriptionGroup, SWT.MULTI | SWT.BORDER |
- SWT.WRAP | SWT.V_SCROLL | SWT.READ_ONLY);
-
- setDescriptionByItem(null);
- setItemDescriptors(LauncherPlugin.getLaunchItemTree());
- }
-
- /**
- * Called when we must grab focus.
- *
- * @see org.eclipse.ui.part.ViewPart#setFocus
- */
- public void setFocus() {
- launchTree.setFocus();
- runButton.getShell().setDefaultButton(runButton);
- }
-
- /**
- * Called when the View is to be disposed
- */
- public void dispose() {
- workbenchShell = null;
- launchTree = null;
- descriptionText = null;
- //importButton = null;
- runButton = null;
- super.dispose();
- }
-
- /**
- * Installs a new launch list.
- *
- * @param newRoot the new tree of launch items for the UI
- */
- public void setItemDescriptors(final ItemTreeNode newRoot) {
- if (workbenchShell == null) return;
- workbenchShell.getDisplay().syncExec(new Runnable() {
- public void run() {
- if ((launchTree == null) || (launchTree.isDisposed())) return;
- launchTree.removeAll();
-
- for (ItemTreeNode node = newRoot.getFirstChild(); node != null;
- node = node.getNextSibling()) {
- doNode(node, new TreeItem(launchTree, SWT.NONE)); // top-level TreeItem
- }
- }
- private void addGroup(TreeItem parent, ItemTreeNode node) {
- for (;node != null; node = node.getNextSibling()) {
- doNode(node, new TreeItem(parent, SWT.NONE)); // TreeItem at depth > 0
- }
- }
- private void doNode(ItemTreeNode node, TreeItem treeItem) {
- final ItemDescriptor item = node.getDescriptor();
- treeItem.setText(item.getName());
- treeItem.setData(item);
- if (node.getDescriptor().isFolder()) {
- treeItem.setExpanded(false);
- treeItem.setImage(LauncherPlugin.images[LauncherPlugin.liClosedFolder]);
- } else {
- treeItem.setImage(node.getDescriptor().getIcon());
- }
- addGroup(treeItem, node.getFirstChild());
- }
- });
- }
-
- /**
- * Runs the specified launch item.
- *
- * @param itemDescriptor the launch item to execute
- */
- private void runItem(final ItemDescriptor itemDescriptor) {
- if ((workbenchShell == null) || (itemDescriptor == null)) return;
- final LaunchDelegate launchDelegate = itemDescriptor.getLaunchDelegate();
- if (launchDelegate == null) return;
-
- boolean result = launchDelegate.launch(this);
- if (! result) {
- MessageDialog.openError(workbenchShell,
- LauncherPlugin.getResourceString("dialog.RunProgramProblems.title"),
- LauncherPlugin.getResourceString("dialog.RunProgramErrorCheckLog.message",
- new Object[] { itemDescriptor.getName() }));
- }
- }
-
- /**
- * Imports the specified launch item into the workspace.
- *
- * @param itemDescriptor the launch item to import.
- */
- private void importItem(final ItemDescriptor itemDescriptor) {
- if ((workbenchShell == null) || (itemDescriptor == null)) return;
-
- URL sourceUrl = itemDescriptor.getSourceCodePath();
- if (sourceUrl == null) return; // oops! can't do that!
-
- ImportProjectTask task = new ImportProjectTask(workbenchShell, itemDescriptor.getName(),
- sourceUrl);
- boolean success = task.execute();
- task.dispose();
- }
- /**
- * Obtains the selected launch item.
- *
- * @return the currently selected ItemDescriptor
- */
- private ItemDescriptor getSelectedItem() {
- final TreeItem[] selections = launchTree.getSelection();
- if (selections.length == 0) return null;
- final ItemDescriptor itemDescriptor = (ItemDescriptor) selections[0].getData();
- return itemDescriptor;
- }
-
- /**
- * Sets the currently visible description text to reflect that of a particular ItemDescriptor.
- *
- * @param itemDescriptor the launch item whose description is to be displayed, or null if none
- */
- private void setDescriptionByItem(ItemDescriptor itemDescriptor) {
- String description;
- if (itemDescriptor == null) {
- description = LauncherPlugin.getResourceString("launchitem.Null.description");
- if (runButton != null) runButton.setEnabled(false);
- //if (importButton != null) importButton.setEnabled(false);
- } else {
- description = itemDescriptor.getDescription();
- if (description == null)
- description = LauncherPlugin.getResourceString("launchitem.Missing.description");
-
- if (runButton != null) runButton.setEnabled(itemDescriptor.getLaunchDelegate() != null);
- //if (importButton != null) importButton.setEnabled(itemDescriptor.getSourceCodePath() != null);
- }
- descriptionText.setText(description);
- }
-} \ No newline at end of file
diff --git a/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/ProgramLaunchDelegate.java b/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/ProgramLaunchDelegate.java
deleted file mode 100755
index b1e2f2c123..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/ProgramLaunchDelegate.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package org.eclipse.swt.examples.launcher;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.core.runtime.*; import org.eclipse.debug.core.*; import org.eclipse.debug.core.model.*; import org.eclipse.jdt.launching.*; import org.eclipse.ui.*;
-
-/**
- * A launch delegate for running a standalone program embedded inside a plugin package.
- */
-class ProgramLaunchDelegate implements LaunchDelegate {
- private String mainClassName;
- private String pluginId;
-
- public ProgramLaunchDelegate(String pluginId, String mainClassName) {
- this.pluginId = pluginId;
- this.mainClassName = mainClassName;
- }
-
- public boolean launch(IViewPart hostView) {
- boolean result = launchHelper(hostView);
- return result;
- }
-
- public boolean launchHelper(IViewPart hostView) {
- // get the platform's public plugin registry
- IPluginRegistry pluginRegistry = Platform.getPluginRegistry();
- // retrieve plugin descriptors for all plugins matching pluginId
- // [array may contain multiple versions of a given plugin]
- IPluginDescriptor[] pluginDescriptors = pluginRegistry.getPluginDescriptors(pluginId);
-
- if (pluginDescriptors == null || pluginDescriptors.length == 0) {
- LauncherPlugin.logError(LauncherPlugin.getResourceString("run.error.CouldNotFindPlugin",
- new Object[] { pluginId }), null);
- return false;
- }
-
- String[] appArgs = new String[] { "-appplugin", pluginId, "-appclass", mainClassName };
- ApplicationRunner runner = new ApplicationRunner(LauncherApplication.APPLICATION_ID, appArgs);
- runner.setPluginsPath(ApplicationRunner.getCurrentPluginsPath());
- runner.setStatePath(LauncherPlugin.getDefault().getStateLocation().toFile().getAbsolutePath());
- VMRunnerResult result = runner.run();
- if (! ApplicationRunner.isResultOk(result)) return false;
-
- initWatch(result);
- return true;
- }
-
- private void initWatch(VMRunnerResult result) {
- final IProcess[] processes = result.getProcesses();
- for (int i = 0; i < processes.length; ++i) {
- final IProcess process = processes[i];
- if (process == null) continue;
- final IStreamsProxy streamsProxy = process.getStreamsProxy();
- if (streamsProxy == null) continue;
-
- final IStreamMonitor outMonitor = streamsProxy.getOutputStreamMonitor();
- if (outMonitor != null) {
- outMonitor.addListener(new IStreamListener() {
- public void streamAppended(String text, IStreamMonitor monitor) {
- System.out.println(text);
- }
- });
- }
-
- final IStreamMonitor errMonitor = streamsProxy.getErrorStreamMonitor();
- if (errMonitor != null) {
- errMonitor.addListener(new IStreamListener() {
- public void streamAppended(String text, IStreamMonitor monitor) {
- System.err.println(text);
- }
- });
- }
- }
- }
-}
-
diff --git a/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/SplitLayout.java b/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/SplitLayout.java
deleted file mode 100755
index 01913074c4..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/SplitLayout.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.eclipse.swt.examples.launcher; /* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved */ import org.eclipse.swt.*; import org.eclipse.swt.graphics.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; /** * A Layout class that automatically switches from a horizontal split to a vertical * split layout to accomodate changing size conditions. * * Later on we might improve this class to take into account the "preferred" size of * the widgets. */
-public class SplitLayout extends Layout { private static final int splitHorizontally = 0, splitVertically = 1; private int splitDirection = splitHorizontally; public int spacing = 3; public int marginTop = 3;
- public int marginLeft = 3; public int marginRight = 3; public int marginBottom = 3; /**
- * Creates a new layout
- */
- public SplitLayout() { }
- /** * @see Layout#computeSize(Composite, int, int, boolean) */ protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) { if (wHint == SWT.DEFAULT) { if (hHint == SWT.DEFAULT) { Point hSplitSize = computeHSplitSize(composite, wHint, hHint, flushCache); Point vSplitSize = computeVSplitSize(composite, wHint, hHint, false); int hSplitArea = hSplitSize.x * hSplitSize.y; int vSplitArea = vSplitSize.x * vSplitSize.y; // Choose direction consuming least area if (hSplitArea < vSplitArea) { splitDirection = splitHorizontally; return hSplitSize; } else { splitDirection = splitVertically; return vSplitSize; } } else { // Constrained in height: split vertically splitDirection = splitVertically; return computeVSplitSize(composite, wHint, hHint, flushCache); } } else { if (hHint == SWT.DEFAULT) { // Constrained in width: split horizontally splitDirection = splitHorizontally; return computeHSplitSize(composite, wHint, hHint, flushCache); } else { if (hHint < wHint) { splitDirection = splitVertically; return computeVSplitSize(composite, wHint, hHint, flushCache); } else { splitDirection = splitHorizontally; return computeHSplitSize(composite, wHint, hHint, flushCache); } } } }
- /**
- * @see Layout#layout(Composite, boolean)
- */
- protected void layout(Composite composite, boolean flushCache) { Rectangle clientArea = composite.getClientArea(); computeSize(composite, clientArea.width, clientArea.height, false); Control[] children = composite.getChildren(); clientArea.x += marginLeft; clientArea.y += marginTop; clientArea.width -= marginRight + marginLeft; clientArea.height -= marginBottom + marginTop; Point position = new Point(clientArea.x, clientArea.y); for (int i = 0; i < children.length; ++i) { final Control child = children[i]; final Rectangle bounds; if (splitDirection == splitHorizontally) { int height = clientArea.height / children.length; bounds = new Rectangle(position.x, position.y, clientArea.width, height); position.y += height + spacing; } else { int width = clientArea.width / children.length; bounds = new Rectangle(position.x, position.y, width, clientArea.height); position.x += width + spacing; } bounds.width = Math.max(bounds.width, 0); bounds.height = Math.max(bounds.height, 0); child.setBounds(bounds); } }
- private Point computeHSplitSize(Composite composite, int wHint, int hHint, boolean flushCache) { Point size = new Point(marginLeft + marginRight, marginTop + marginBottom); Control[] children = composite.getChildren(); for (int i = 0; i < children.length; ++i) { final Control child = children[i]; Point childSize = child.computeSize(wHint, hHint, flushCache); size.x = Math.max(size.x, childSize.x); size.y += childSize.y + spacing; } return size; } private Point computeVSplitSize(Composite composite, int wHint, int hHint, boolean flushCache) { Point size = new Point(marginLeft + marginRight, marginTop + marginBottom); Control[] children = composite.getChildren(); for (int i = 0; i < children.length; ++i) { final Control child = children[i]; Point childSize = child.computeSize(wHint, hHint, flushCache); size.x += childSize.x + spacing; size.y = Math.max(size.y, childSize.y); } return size; } }
diff --git a/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/ViewLaunchDelegate.java b/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/ViewLaunchDelegate.java
deleted file mode 100755
index fd85c88b56..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/org/eclipse/swt/examples/launcher/ViewLaunchDelegate.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.eclipse.swt.examples.launcher;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
- import org.eclipse.core.runtime.*; import org.eclipse.ui.*;
- /** * A launch delegate for starting an Eclipse view. */
-class ViewLaunchDelegate implements LaunchDelegate {
- private String pluginViewId;
-
- public ViewLaunchDelegate(String pluginViewId) {
- this.pluginViewId = pluginViewId;
- }
- public boolean launch(IViewPart hostView) { boolean result = launchHelper(hostView); return result; }
- public boolean launchHelper(IViewPart hostView) {
- final IWorkbenchPart workbenchPart = hostView;
- final IWorkbenchPartSite workbenchPartSite = workbenchPart.getSite();
- final IWorkbenchPage workbenchPage = workbenchPartSite.getPage();
-
- try {
- workbenchPage.showView(pluginViewId);
- return true; } catch (PartInitException e) { LauncherPlugin.logError(LauncherPlugin.getResourceString("run.error.Invocation"), e); } return false; }
-}
diff --git a/examples/org.eclipse.swt.examples.launcher/plugin.properties b/examples/org.eclipse.swt.examples.launcher/plugin.properties
deleted file mode 100755
index 90ba763c82..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/plugin.properties
+++ /dev/null
@@ -1,96 +0,0 @@
-plugin.SWTLauncherExample.name = SWT Launcher Example Plugin
-category.SWTExamples.name = SWT Examples
-view.LauncherExample.name = SWT Example Launcher
-
-extension-point.launchItems.name = Launch Items
-
-launchcategory.SWTViewExamples.name = Workbench Views
-launchcategory.SWTViewExamples.description = \
- A collection of Standard Widget Toolkit examples that run as Views inside the Workbench. \
- These examples will create a new View in the current Perspective.
-
-launchitem.LauncherExample.name = Launcher
-launchitem.LauncherExample.description = \
- Introduction\n\
- The Example Launcher is a tool for enumerating, running and browsing a variety of examples. \
- While these operations may be performed manually (with some difficulty), the Example Launcher \
- offers a convenient interface. For information on how to manipulate particular examples \
- manually, please consult their related documentation.\n\n\
- Running the Example Launcher\n\
- To run the Example Launcher, pull down the Perspective menu, select the \
- Show View menu item, then select Other from the submenu. A dialog \
- will come up with a list of views. Expand SWT Examples and select \
- the view named SWT Example Launcher. A view containing a list of examples to \
- choose will appear.\n\n\
- About the examples\n\
- The Example Launcher can launch two different types of examples: Workbench Views, \
- and Standalone applications. Examples will generally be organized into categories to \
- distinguish the one from the other.\n\n\
- Workbench Views are GUI panels that sit inside a given perspective. When the Launcher \
- starts a program that is written to interact with the Workbench as a view, it is opened and \
- embedded into the currently active perspective.\n\n\
- Standalone applications are programs that run independently of the current \
- Eclipse Platform environment. First, a new Java VM and Eclipse Platform runtime \
- is started, then the application's main() method is invoked. For this reason, \
- these applications may take some time to load.\n\n\
- Details\n\n\
- The example launcher view contains a tree list, a text area, and 2 buttons. \
- The tree list contains a list of all the SWT examples you can choose \
- to run. When an example is selected from the tree, the text area \
- shows a short description of each example. The selected example can \
- be executed by clicking on the Run button, which can be found just below \
- the tree list. For some of the examples, you can also import the example \
- source code into a project in the Workspace. A project, with a name specified \
- by the user, is created and all the java classes required to run that example \
- will be added to that newly created project.\n\n\
- Depending on the example and on the configuration of your system, it may be \
- necessary to alter Project build paths or to define classpath variables to compile \
- or run examples that have been imported to the Workspace.
-
-error.CouldNotLoadResources = Unable to load resources
-error.IncompleteProgramLaunchItem = Incomplete XML ProgramLaunchItem definition, id = {0}
-error.IncompleteViewLaunchItem = Incomplete XML ViewLaunchItem definition, id = {0}
-error.IncompleteLaunchItem = Incomplete or unrecognized XML LaunchItem definition, id = {0}
-
-dialog.RunProgramProblems.title = Run Program Problems
-dialog.RunProgramErrorCheckLog.message = Error while running program "{0}", check log for details.
-
-dialog.ImportPathInput.title = Add to Workbench
-dialog.ImportPathInput.message = Enter the name of the new project to create.
-dialog.InvalidTargetProjectPath.interactive = Not a valid project name.
-dialog.ExistingProjectPath.interactive = A project with that name already exists.
-
-dialog.ImportProgramProblems.title = Add to Workbench Problems
-dialog.InvalidTargetProjectPath.message = "{0}" is not a valid project name.
-dialog.ErrorAccessingZipFile.message = Error accessing Zip/Jar file "{0}" for import. {1}
-dialog.ErrorCreatingNewProject.message = Error creating new project. {0}
-dialog.ErrorUpdatingProjectProperties.message = Error updating project properties. {0}
-dialog.UnableToGetJavaProjectHandle.message = Could not retrieve Java Project handle.
-dialog.UnableToSetClasspathVariable.message = Could not set classpath variable "{0}" to "{1}".
-dialog.UnableExpandSubstitutionKeyword.message = Could not expand substitution variable "{0}" in "{1}" line of import.properties.
-dialog.UnableToProgramArguments.message = Could not set program arguments for type "{1}" in resource "{0}" to "{2}".
-dialog.UnableToVMArguments.message = Could not set VM arguments for type "{1}" resource "{0}" to "{2}".
-
-dialog.ImportProgramOverwrite.title = Add to Workbench
-dialog.FileAlreadyExists.message = {0} already exists. Would you like to overwrite it?
-
-launchitem.Null.description = <<no item selected>>
-
-launchitem.Missing.name = <<unnamed>>
-launchitem.Missing.description = <<no description available>>
-
-view.launchGroup.text = Examples
-view.launchButton.text = Run
-view.importButton.text = Add to Workspace
-view.descriptionGroup.text = Description
-
-run.error.Invocation = A fatal error occurred while launching the program.
-run.error.Execution = An uncaught exception occured while running the program.
-run.error.CouldNotFindPlugin = Could not find plugin: {0}
-run.error.CouldNotFindMain = Could not find a suitable main method to run.
-run.error.CouldNotFindDefaultVM = Could not find default VM. Please ensure that a default VM has been selected in the Java Properties editor.
-run.error.CouldNotFindVMRunner = The VM "{0}" does not support launching Java programs in ''Run'' mode. Please select a default VM that supports this mode in the Java Properties editor.
-run.error.CouldNotDetermineClasspath = Internal Error: Unable to determine classpath for plugin: {0}
-run.error.MalformedArgumentList = Malformed argument list
-run.error.MissingAppPlugin = Missing -appplugin argument. Must specify the plugin with the program to launch.
-run.error.MissingAppClass = Missing -appclass argument. Must specify the class with the main() method to invoke.
diff --git a/examples/org.eclipse.swt.examples.launcher/plugin.xml b/examples/org.eclipse.swt.examples.launcher/plugin.xml
deleted file mode 100755
index 96e0f550f7..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/plugin.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- File written by PDE 1.0 -->
-<plugin
- id="org.eclipse.swt.examples.launcher"
- name="%plugin.SWTLauncherExample.name"
- version="2.0"
- provider-name="Object Technology International, Inc."
- class="org.eclipse.swt.examples.launcher.LauncherPlugin">
-<!-- Required plugins -->
-<requires>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.swt"/>
- <import plugin="org.eclipse.jdt.launching"/>
- <import plugin="org.eclipse.debug.core"/>
- <import plugin="org.eclipse.core.boot"/>
- <import plugin="org.eclipse.jdt.core"/>
-</requires>
-
-<!-- Runtime -->
-<!-- Runtime -->
-<!-- Runtime -->
-<!-- Runtime -->
-<runtime>
- <library name="launcher.jar"/>
-</runtime>
-
-<!-- Extension points -->
-<extension-point id="launchItems" name="%extension-point.launchItems.name" schema="schema/org.eclipse.swt.examples.launcher.launchItems.xsd"/>
-
-<!-- Extensions -->
-<extension
- id="application"
- point="org.eclipse.core.runtime.applications">
- <application>
- <run
- name="%launchitem.LauncherApplication.name"
- class="org.eclipse.swt.examples.launcher.LauncherApplication">
- </run>
- </application>
-</extension>
-<extension
- point="org.eclipse.ui.views">
- <category
- name="%category.SWTExamples.name"
- id="org.eclipse.swt.examples.category">
- </category>
- <view
- name="%view.LauncherExample.name"
- icon="icons/launcher_example.gif"
- category="org.eclipse.swt.examples.category"
- class="org.eclipse.swt.examples.launcher.LauncherView"
- id="org.eclipse.swt.examples.launcher.view">
- </view>
-</extension>
-<extension
- point="org.eclipse.swt.examples.launcher.launchItems">
- <category
- name="%launchcategory.SWTViewExamples.name"
- description="%launchcategory.SWTViewExamples.description"
- id="org.eclipse.swt.examples.launchViewCategory">
- </category>
- <item
- enabled="false"
- name="%launchitem.LauncherExample.name"
- icon="icons/launcher_example.gif"
- description="%launchitem.LauncherExample.description"
- category="org.eclipse.swt.examples.launchViewCategory"
- id="org.eclipse.swt.examples.launcher.viewlauncher">
- <view
- viewId="org.eclipse.swt.examples.launcher.view"/>
- <source
- zip="launchersrc.zip"/>
- </item>
-</extension>
-</plugin>
diff --git a/examples/org.eclipse.swt.examples.launcher/schema/org.eclipse.swt.examples.launcher.launchItems.xsd b/examples/org.eclipse.swt.examples.launcher/schema/org.eclipse.swt.examples.launcher.launchItems.xsd
deleted file mode 100755
index 4dee880333..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/schema/org.eclipse.swt.examples.launcher.launchItems.xsd
+++ /dev/null
@@ -1,217 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.swt.examples.launcher">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.swt.examples.launcher" id="launchItems" name="Launch Items"/>
- </appInfo>
- <documentation>
- This extension point is used to add 'standalone program' and 'Workbench view'
- launch items to the Launcher, optionally grouping them into
- categories so as to form a multi-tiered hierarchy.
- Standalone programs are executed in new run-time environments.
- Workbench views are created within the active Workbench Perspective.
- </documentation>
-</annotation>
-
- <element name="extension">
- <complexType>
- <all>
- <element ref="category" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="item" minOccurs="0" maxOccurs="unbounded"/>
- </all>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="program">
- <annotation>
- <documentation>
- Specifies a "Standalone Program" for a launch item to run.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="mainClass" type="string" use="required">
- <annotation>
- <documentation>
- The fully-qualified name of the class whose main() method is to be launched.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="pluginId" type="string" use="required">
- <annotation>
- <documentation>
- The unique id of the Eclipse Platform plugin containing the program.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="view">
- <annotation>
- <documentation>
- Specifies a "Workbench View" for a launch item to activate.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="viewId" type="string" use="required">
- <annotation>
- <documentation>
- The unique id of the Workbench View to be activated when the item is launched.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="category">
- <annotation>
- <documentation>
- Specifies a launch item category heading.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- The localized name of this category.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- The unique id of this category. Categories with duplicate id's will be discarded.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="category" type="string">
- <annotation>
- <documentation>
- The unique id of the parent category.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="item">
- <annotation>
- <documentation>
- Specifies a launch item.
- </documentation>
- </annotation>
- <complexType>
- <all>
- <choice>
- <element ref="program"/>
- <element ref="view"/>
- </choice>
- <element ref="source" minOccurs="0" maxOccurs="1"/>
- </all>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- The localized name of this launch item.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- The unique id of this launch item. Launch items with duplicate id's will be discarded.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="category" type="string">
- <annotation>
- <documentation>
- The unique id of the category this launch item belongs to.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="icon" type="string">
- <annotation>
- <documentation>
- The declaring plugin relative path of an icon to display with this launch item in the Launcher.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="enabled" type="boolean" use="default" value="true">
- <annotation>
- <documentation>
- Set to "false" to disable this launch item, or to "true" to enable it (default).
- </documentation>
- </annotation>
- </attribute>
- <attribute name="description" type="string">
- <annotation>
- <documentation>
- The localized plain-text description of this launch item.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="source">
- <complexType>
- <attribute name="zip" type="string">
- <annotation>
- <documentation>
- The declaring plugin relative path of a ZIP file containing source code associated with a launch item.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
-</schema>
diff --git a/examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/ItemDescriptor.java b/examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/ItemDescriptor.java
deleted file mode 100755
index 735291513b..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/ItemDescriptor.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package org.eclipse.swt.examples.launcher; /* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved */ import java.net.*; import org.eclipse.swt.graphics.*;
- /** * ItemDescriptor collects information about a launch item. */
-class ItemDescriptor {
- private String id;
- private String name;
- private String description; private Image icon;
- private URL sourceCodePath;
- private LaunchDelegate launchDelegate;
-
- /**
- * Constructs an ItemDescriptor.
- *
- * @param id the id
- * @param name the name
- * @param description the description
- * @param launchDelegate a launch delegate for the program to be launched using this descriptor,
- * may be null if item is not launchable
- */
- public ItemDescriptor(String id, String name, String description, URL sourceCodePath,
- Image icon, LaunchDelegate launchDelegate) {
- this.id = id;
- this.name = name;
- this.description = description;
- this.sourceCodePath = sourceCodePath; this.icon = icon;
- this.launchDelegate = launchDelegate;
- }
-
- /**
- * Returns the ID for this program.
- *
- * @return the user-specified ID for this program
- */
- public String getId() {
- return id;
- }
-
- /**
- * Returns the translated name for the program.
- *
- * @return the name of the program
- */
- public String getName() {
- return name;
- }
-
- /**
- * Returns a short description for the program.
- *
- * @return a newline-delimited string describing the program, null if no description is available
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * Returns source code path
- *
- * @return a URL specifying the name of a zip/jar or the base of a directory where the source
- * code is stored, null if no source is available
- */
- public URL getSourceCodePath() {
- return sourceCodePath;
- }
- /** * Returns an icon for this descriptor * * @returns an icon, null if the item is a folder */ public Image getIcon() { return icon; }
- /**
- * Returns launch delegate for the program.
- *
- * @return the launch delegate, null if the item is a folder
- */
- public LaunchDelegate getLaunchDelegate() {
- return launchDelegate;
- } /** * Determines if an item is a folder. * * @return true if the item is a folder */ public boolean isFolder() { return launchDelegate == null; }
-
- /**
- * Determines the equality of descriptors.
- *
- * @return true if this.getId().equalsIgnoreCase(other.getId())
- */
- public boolean equals(Object other) { if (other instanceof ItemDescriptor) {
- ItemDescriptor otherDescriptor = (ItemDescriptor) other;
- return getId().equalsIgnoreCase(otherDescriptor.getId());
- }
- return false;
- } /** * Produces a hashcode. * * @return the hashcode */ public int hashCode() { return id.toUpperCase().hashCode(); }
-}
diff --git a/examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/ItemTreeNode.java b/examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/ItemTreeNode.java
deleted file mode 100755
index bc1a5ac185..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/ItemTreeNode.java
+++ /dev/null
@@ -1,73 +0,0 @@
-package org.eclipse.swt.examples.launcher;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-/**
- * Internal class used to store tree structures of ItemDescriptors
- */
-class ItemTreeNode {
- private ItemTreeNode nextSibling;
- private ItemTreeNode firstChild;
- private ItemDescriptor descriptor;
-
- /**
- * Constructs a leaf ItemTreeNode with a given descriptor.
- *
- * @param descriptor the descriptor
- */
- public ItemTreeNode(ItemDescriptor descriptor) {
- this.descriptor = descriptor;
- }
-
- /**
- * Adds a node to the Tree in sorted order by name.
- *
- * @param node the node to add. Note that node.nextSibling must be null
- */
- public void addSortedNode(ItemTreeNode node) {
- if (firstChild == null) {
- firstChild = node;
- } else if (firstChild.descriptor.getName().compareTo(node.descriptor.getName()) > 0) {
- node.nextSibling = firstChild;
- firstChild = node;
- } else {
- ItemTreeNode cursor;
- for (cursor = firstChild; cursor.nextSibling != null; cursor = cursor.nextSibling) {
- ItemTreeNode sibling = cursor.nextSibling;
- if (sibling.descriptor.getName().compareTo(node.descriptor.getName()) > 0) break;
- }
- node.nextSibling = cursor.nextSibling;
- cursor.nextSibling = node;
- }
- }
-
- /**
- * Returns the descriptor for this node.
- *
- * @return the descriptor
- */
- public ItemDescriptor getDescriptor() {
- return descriptor;
- }
-
- /**
- * Returns the next sibling of this node.
- *
- * @return the next sibling, or null if none
- */
- public ItemTreeNode getNextSibling() {
- return nextSibling;
- }
-
- /**
- * Returns the first child of this node.
- *
- * @return the first child, or null if none
- */
- public ItemTreeNode getFirstChild() {
- return firstChild;
- }
-}
diff --git a/examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/LauncherPlugin.java b/examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/LauncherPlugin.java
deleted file mode 100755
index 1ee79c11e3..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/LauncherPlugin.java
+++ /dev/null
@@ -1,413 +0,0 @@
-package org.eclipse.swt.examples.launcher;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import java.io.*; import java.net.*; import java.text.*; import java.util.*; import org.eclipse.core.runtime.*; import org.eclipse.swt.graphics.*; import org.eclipse.ui.plugin.*;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class LauncherPlugin extends AbstractUIPlugin {
- //The shared instance.
- private static LauncherPlugin plugin;
- private static ResourceBundle resourceBundle;
-
- private static final String
- LAUNCH_ITEMS_POINT_ID = "org.eclipse.swt.examples.launcher.launchItems",
- LAUNCH_ITEMS_XML_CATEGORY = "category",
- LAUNCH_ITEMS_XML_ITEM = "item",
- LAUNCH_ITEMS_XML_ITEM_ICON = "icon",
- LAUNCH_ITEMS_XML_ITEM_DESCRIPTION = "description",
- LAUNCH_ITEMS_XML_PROGRAM = "program",
- LAUNCH_ITEMS_XML_PROGRAM_PLUGIN = "pluginId",
- LAUNCH_ITEMS_XML_PROGRAM_CLASS = "mainClass",
- LAUNCH_ITEMS_XML_VIEW = "view",
- LAUNCH_ITEMS_XML_VIEW_VIEWID = "viewId",
- LAUNCH_ITEMS_XML_SOURCE = "source",
- LAUNCH_ITEMS_XML_SOURCE_ZIP = "zip",
- LAUNCH_ITEMS_XML_ATTRIB_ID = "id",
- LAUNCH_ITEMS_XML_ATTRIB_NAME = "name",
- LAUNCH_ITEMS_XML_ATTRIB_ENABLED = "enabled",
- LAUNCH_ITEMS_XML_ATTRIB_CATEGORY = "category",
- LAUNCH_ITEMS_XML_VALUE_TRUE = "true",
- LAUNCH_ITEMS_XML_VALUE_FALSE = "false";
-
- static final int
- liClosedFolder = 0,
- liOpenFolder = 1,
- liGenericExample = 2;
- static final String[] imageLocations = {
- "icons/closedFolder.gif",
- "icons/openFolder.gif",
- "icons/generic_example.gif" };
- static Image images[];
-
- /**
- * Constructs the LauncherPlugin.
- */
- public LauncherPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- plugin = this;
- resourceBundle = descriptor.getResourceBundle();
- }
-
- /**
- * Clean up
- */
- public void shutdown() throws CoreException {
- super.shutdown();
- freeResources();
- }
-
- /**
- * Returns the shared instance.
- */
- public static LauncherPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Loads the resources
- */
- public static void initResources() {
- if (images == null) {
- images = new Image[imageLocations.length];
-
- for (int i = 0; i < imageLocations.length; ++i) {
- images[i] = getImageFromPlugin(plugin.getDescriptor(), imageLocations[i]);
- if (images[i] == null) {
- freeResources();
- logError(getResourceString("error.CouldNotLoadResources"), null);
- throw new IllegalStateException();
- }
- }
- }
- }
-
- /**
- * Frees the resources
- */
- public static 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;
- }
- }
-
- /**
- * Log an error to the ILog for this plugin
- *
- * @param message the localized error message text
- * @param exception the associated exception, or null
- */
- public static void logError(String message, Throwable exception) {
- plugin.getLog().log(new Status(IStatus.ERROR, plugin.getDescriptor().getUniqueIdentifier(),
- 0, message, exception));
- }
-
- /**
- * Returns a string from the resource bundle.
- * We don't want to crash because of a missing String.
- * Returns the key if not found.
- */
- public static String getResourceString(String key) {
- try {
- return resourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return key;
- } catch (NullPointerException e) {
- return "!" + key + "!";
- }
- }
-
- /**
- * Returns a string from the resource bundle and binds it
- * with the given arguments. If the key is not found,
- * return the key.
- */
- public static String getResourceString(String key, Object[] args) {
- try {
- return MessageFormat.format(getResourceString(key), args);
- } catch (MissingResourceException e) {
- return key;
- } catch (NullPointerException e) {
- return "!" + key + "!";
- }
- }
-
- /**
- * Constructs a list of available programs from registered extensions.
- *
- * @return an ItemTreeNode representing the root of a tree of items (the root is not to be displayed)
- */
- public static ItemTreeNode getLaunchItemTree() {
- ItemTreeNode categoryTree =
- new ItemTreeNode(new ItemDescriptor("<<Root>>", "<<Root>>", null, null, null, null));
-
- // get the platform's public plugin registry
- IPluginRegistry pluginRegistry = Platform.getPluginRegistry();
- // retrieve all configuration elements registered at our launchItems extension-point
- IConfigurationElement[] configurationElements =
- pluginRegistry.getConfigurationElementsFor(LAUNCH_ITEMS_POINT_ID);
-
- if (configurationElements == null || configurationElements.length == 0) {
- logError("Could not find registered extensions", null);
- return categoryTree;
- }
-
- /* Collect all launch categories -- coalesce those with same ID */
- HashMap idMap = new HashMap();
- for (int i = 0; i < configurationElements.length; ++i) {
- final IConfigurationElement ce = configurationElements[i];
- final String ceName = ce.getName();
- final String attribId = getItemAttribute(ce, LAUNCH_ITEMS_XML_ATTRIB_ID, null);
-
- if (idMap.containsKey(attribId)) continue;
- if (ceName.equalsIgnoreCase(LAUNCH_ITEMS_XML_CATEGORY)) {
- final String attribName = getItemName(ce);
- ItemDescriptor theDescriptor = new ItemDescriptor(attribId, attribName,
- getItemDescription(ce), null, null, null);
- idMap.put(attribId, new ItemTreeNode(theDescriptor));
- }
- }
-
- /* Generate launch category hierarchy */
- Set tempIdSet = new HashSet(); // used to prevent duplicates from being entered into the tree
- for (int i = 0; i < configurationElements.length; ++i) {
- final IConfigurationElement ce = configurationElements[i];
- final String ceName = ce.getName();
- final String attribId = getItemAttribute(ce, LAUNCH_ITEMS_XML_ATTRIB_ID, null);
-
- if (tempIdSet.contains(attribId)) continue;
- if (ceName.equalsIgnoreCase(LAUNCH_ITEMS_XML_CATEGORY)) {
- final ItemTreeNode theNode = (ItemTreeNode) idMap.get(attribId);
- addItemByCategory(ce, categoryTree, theNode, idMap);
- tempIdSet.add(attribId);
- }
- }
-
- /* Generate program tree */
- for (int i = 0; i < configurationElements.length; ++i) {
- final IConfigurationElement ce = configurationElements[i];
- final String ceName = ce.getName();
- final String attribId = getItemAttribute(ce, LAUNCH_ITEMS_XML_ATTRIB_ID, null);
-
- if (idMap.containsKey(attribId)) continue;
- if (ceName.equalsIgnoreCase(LAUNCH_ITEMS_XML_CATEGORY)) {
- // ignore
- } else if (ceName.equalsIgnoreCase(LAUNCH_ITEMS_XML_ITEM)) {
- final String enabled = getItemAttribute(ce, LAUNCH_ITEMS_XML_ATTRIB_ENABLED,
- LAUNCH_ITEMS_XML_VALUE_TRUE);
- if (enabled.equalsIgnoreCase(LAUNCH_ITEMS_XML_VALUE_FALSE)) continue;
- ItemDescriptor theDescriptor = createItemDescriptor(ce, attribId);
-
- if (theDescriptor != null) {
- final ItemTreeNode theNode = new ItemTreeNode(theDescriptor);
- addItemByCategory(ce, categoryTree, theNode, idMap);
- idMap.put(attribId, theNode);
- }
- }
- }
- return categoryTree;
- }
-
-
- /**
- * Adds an item to the category tree.
- */
- private static void addItemByCategory(IConfigurationElement ce, ItemTreeNode root,
- ItemTreeNode theNode, HashMap idMap) {
- final String attribCategory = getItemAttribute(ce, LAUNCH_ITEMS_XML_ATTRIB_CATEGORY, null);
-
- // locate the parent node
- ItemTreeNode parentNode = null;
- if (attribCategory != null) {
- parentNode = (ItemTreeNode) idMap.get(attribCategory);
- }
- if (parentNode == null) parentNode = root;
-
- // add the item
- parentNode.addSortedNode(theNode);
- }
-
- /**
- * Creates an ItemDescriptor from an XML definition.
- *
- * @param ce the IConfigurationElement describing the item
- * @param attribId the attribute id
- * @return a new ItemDescriptor, or null if an error occurs
- */
- private static ItemDescriptor createItemDescriptor(IConfigurationElement ce, String attribId) {
- final String attribName = getItemName(ce);
- final Image attribIcon = getItemIcon(ce);
- final String attribDescription = getItemDescription(ce);
- final URL attribSourceZip;
- final LaunchDelegate launchDelegate;
-
- IConfigurationElement sourceCE = getItemElement(ce, LAUNCH_ITEMS_XML_SOURCE);
- attribSourceZip = (sourceCE != null) ? getSourceCodePath(sourceCE) : null;
-
- IConfigurationElement viewCE = getItemElement(ce, LAUNCH_ITEMS_XML_VIEW);
- if (viewCE != null) {
- final String attribView = getItemAttribute(viewCE, LAUNCH_ITEMS_XML_VIEW_VIEWID, null);
- if (attribView == null) {
- logError(getResourceString("error.IncompleteViewLaunchItem",
- new Object[] { attribId } ), null);
- return null;
- }
- launchDelegate = new ViewLaunchDelegate(attribView);
- } else {
- IConfigurationElement programCE = getItemElement(ce, LAUNCH_ITEMS_XML_PROGRAM);
- if (programCE != null) {
- final String attribPluginId = getItemAttribute(programCE, LAUNCH_ITEMS_XML_PROGRAM_PLUGIN, null);
- final String attribClass = getItemAttribute(programCE, LAUNCH_ITEMS_XML_PROGRAM_CLASS, null);
-
- if (attribClass == null || attribPluginId == null) {
- logError(getResourceString("error.IncompleteProgramLaunchItem",
- new Object[] { attribId } ), null);
- return null;
- }
- launchDelegate = new ProgramLaunchDelegate(attribPluginId, attribClass);
- } else {
- logError(getResourceString("error.IncompleteLaunchItem",
- new Object[] { attribId } ), null);
- return null;
- }
- }
- return new ItemDescriptor(attribId, attribName, attribDescription, attribSourceZip,
- attribIcon, launchDelegate);
- }
-
- /**
- * Returns the first instance of a particular child XML element.
- *
- * @param ce the IConfigurationElement parent
- * @param element the name of the element to fetch
- * @return the element's IConfigurationElement, or null if not found
- */
- private static IConfigurationElement getItemElement(IConfigurationElement ce, String element) {
- IConfigurationElement[] elementCEs = ce.getChildren(element);
- return (elementCEs != null && elementCEs.length != 0) ? elementCEs[0] : null;
- }
-
- /**
- * Returns the value of an XML attribute for an item.
- *
- * @param ce the IConfigurationElement describing the item
- * @param attribute the attribute to fetch
- * @param defaultValue the value to return if the attribute is not found
- * @return the attribute value
- */
- private static String getItemAttribute(IConfigurationElement ce, String attribute, String defaultValue) {
- String value = ce.getAttribute(attribute);
- return (value != null) ? value : defaultValue;
- }
-
- /**
- * Returns the description string given the IConfigurationElement for an item.
- *
- * @param ce the IConfigurationElement describing the item
- * @return a newline-delimited string that describes this item, or null if none
- */
- private static String getItemDescription(IConfigurationElement ce) {
- String description = getItemAttribute(ce, LAUNCH_ITEMS_XML_ITEM_DESCRIPTION, "");
- return (description.length() == 0) ? null : description;
- }
-
- /**
- * Returns the name of an item.
- *
- * @param ce the IConfigurationElement describing the item
- * @return the attribute value
- */
- private static String getItemName(IConfigurationElement ce) {
- return getItemAttribute(ce, LAUNCH_ITEMS_XML_ATTRIB_NAME,
- getResourceString("launchitem.Missing.name"));
- }
-
-
- /**
- * Returns the icon for an item.
- *
- * @param ce the IConfigurationElement describing the item
- * @return an icon
- */
- private static Image getItemIcon(IConfigurationElement ce) {
- String iconPath = getItemAttribute(ce, LAUNCH_ITEMS_XML_ITEM_ICON, "");
- if (iconPath.length() != 0) {
- Image icon = getImageFromPlugin(ce.getDeclaringExtension().getDeclaringPluginDescriptor(),
- iconPath);
- if (icon != null) {
- Image[] newImages = new Image[images.length + 1];
- System.arraycopy(images, 0, newImages, 0, images.length);
- newImages[images.length] = icon;
- images = newImages;
- return icon;
- }
- }
- return images[liGenericExample];
- }
-
- /**
- * Gets an image from a path relative to the plugin install directory.
- *
- * @param pd the plugin descriptor for the plugin with the image
- * @param iconPath the path relative to the install directory
- * @return the image, or null if not found
- */
- private static Image getImageFromPlugin(IPluginDescriptor pd, String iconPath) {
- InputStream is = null;
- try {
- URL installUrl = pd.getInstallURL();
- URL url = new URL(installUrl, iconPath);
- is = url.openConnection().getInputStream();
- ImageData source = new ImageData(is);
- ImageData mask = source.getTransparencyMask();
- Image image = new Image(null, source, mask);
- return image;
- } catch (Throwable ex) {
- return null;
- } finally {
- try {
- if (is != null) is.close();
- } catch (IOException e) {
- }
- }
- }
-
- /**
- * Returns the path of the source code for an item.
- *
- * @param ce the IConfigurationElement describing the item
- * @return a URL containing the source code path, or null if none is available
- */
- private static URL getSourceCodePath(IConfigurationElement ce) {
- String sourcePath = getItemAttribute(ce, LAUNCH_ITEMS_XML_SOURCE_ZIP, "");
- if (sourcePath.length() != 0) {
- try {
- // Extract the URL
- IPluginDescriptor pd = ce.getDeclaringExtension().getDeclaringPluginDescriptor();
- URL sourceUrl = new URL(pd.getInstallURL(), sourcePath);
-
- // Test the URL to make sure there really is a resource here
- // (this helps to prevent the user from seeing "Add to Workspace" if no
- // source bundle is available but one has been specified)
- try {
- InputStream is = sourceUrl.openStream();
- is.close();
- } catch (IOException e) {
- return null;
- }
- return sourceUrl;
- } catch (MalformedURLException e) {
- }
- }
- return null;
- }
-} \ No newline at end of file
diff --git a/examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/LauncherView.java b/examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/LauncherView.java
deleted file mode 100755
index 740c663ab7..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/LauncherView.java
+++ /dev/null
@@ -1,234 +0,0 @@
-package org.eclipse.swt.examples.launcher;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import java.net.*; import org.eclipse.jface.dialogs.*; import org.eclipse.swt.*; import org.eclipse.swt.events.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; import org.eclipse.ui.part.*;
-
-/**
- * Launcher uses <code>org.eclipse.swt</code> and <code>org.eclipse.core</code>
- * to launch the other registered examples.
- *
- * @see ViewPart
- */
-public class LauncherView extends ViewPart {
- private Shell workbenchShell;
-
- private Tree launchTree;
- private Text descriptionText;
- //private Button importButton;
- private Button runButton;
-
- /**
- * Constructs a LauncherView.
- */
- public LauncherView() {
- LauncherPlugin.initResources();
- }
-
- /**
- * Creates the example.
- *
- * @see ViewPart#createPartControl
- */
- public void createPartControl(Composite parent) {
- workbenchShell = getSite().getShell();
- parent.setLayout(new SplitLayout());
-
- Group launchGroup = new Group(parent, SWT.NULL);
- launchGroup.setText(LauncherPlugin.getResourceString("view.launchGroup.text"));
-
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 2;
- launchGroup.setLayout(gridLayout);
-
- launchTree = new Tree(launchGroup, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
- gridData.horizontalSpan = 2;
- launchTree.setLayoutData(gridData);
- launchTree.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent event) {
- final ItemDescriptor item = getSelectedItem();
- setDescriptionByItem(item);
- }
- public void widgetDefaultSelected(SelectionEvent event) {
- final ItemDescriptor item = getSelectedItem();
- setDescriptionByItem(item);
- runItem(getSelectedItem());
- }
- });
- launchTree.addTreeListener(new TreeListener() {
- public void treeCollapsed(TreeEvent event) {
- final TreeItem item = (TreeItem) event.item;
- if (item == null) return;
- item.setImage(LauncherPlugin.images[LauncherPlugin.liClosedFolder]);
- }
- public void treeExpanded(TreeEvent event) {
- final TreeItem item = (TreeItem) event.item;
- if (item == null) return;
- item.setImage(LauncherPlugin.images[LauncherPlugin.liOpenFolder]);
- }
- });
-
- runButton = new Button(launchGroup, SWT.PUSH);
- runButton.setText(LauncherPlugin.getResourceString("view.launchButton.text"));
- runButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent event) {
- runItem(getSelectedItem());
- }
- public void widgetDefaultSelected(SelectionEvent event) {
- }
- });
-
- //importButton = new Button(launchGroup, SWT.PUSH);
- //importButton.setText(LauncherPlugin.getResourceString("view.importButton.text"));
- //importButton.addSelectionListener(new SelectionListener() {
- // public void widgetSelected(SelectionEvent event) {
- // importItem(getSelectedItem());
- // }
- // public void widgetDefaultSelected(SelectionEvent event) {
- // }
- //});
-
-
- Group descriptionGroup = new Group(parent, SWT.NULL);
- descriptionGroup.setText(LauncherPlugin.getResourceString("view.descriptionGroup.text"));
- descriptionGroup.setLayout(new FillLayout());
-
- descriptionText = new Text(descriptionGroup, SWT.MULTI | SWT.BORDER |
- SWT.WRAP | SWT.V_SCROLL | SWT.READ_ONLY);
-
- setDescriptionByItem(null);
- setItemDescriptors(LauncherPlugin.getLaunchItemTree());
- }
-
- /**
- * Called when we must grab focus.
- *
- * @see org.eclipse.ui.part.ViewPart#setFocus
- */
- public void setFocus() {
- launchTree.setFocus();
- runButton.getShell().setDefaultButton(runButton);
- }
-
- /**
- * Called when the View is to be disposed
- */
- public void dispose() {
- workbenchShell = null;
- launchTree = null;
- descriptionText = null;
- //importButton = null;
- runButton = null;
- super.dispose();
- }
-
- /**
- * Installs a new launch list.
- *
- * @param newRoot the new tree of launch items for the UI
- */
- public void setItemDescriptors(final ItemTreeNode newRoot) {
- if (workbenchShell == null) return;
- workbenchShell.getDisplay().syncExec(new Runnable() {
- public void run() {
- if ((launchTree == null) || (launchTree.isDisposed())) return;
- launchTree.removeAll();
-
- for (ItemTreeNode node = newRoot.getFirstChild(); node != null;
- node = node.getNextSibling()) {
- doNode(node, new TreeItem(launchTree, SWT.NONE)); // top-level TreeItem
- }
- }
- private void addGroup(TreeItem parent, ItemTreeNode node) {
- for (;node != null; node = node.getNextSibling()) {
- doNode(node, new TreeItem(parent, SWT.NONE)); // TreeItem at depth > 0
- }
- }
- private void doNode(ItemTreeNode node, TreeItem treeItem) {
- final ItemDescriptor item = node.getDescriptor();
- treeItem.setText(item.getName());
- treeItem.setData(item);
- if (node.getDescriptor().isFolder()) {
- treeItem.setExpanded(false);
- treeItem.setImage(LauncherPlugin.images[LauncherPlugin.liClosedFolder]);
- } else {
- treeItem.setImage(node.getDescriptor().getIcon());
- }
- addGroup(treeItem, node.getFirstChild());
- }
- });
- }
-
- /**
- * Runs the specified launch item.
- *
- * @param itemDescriptor the launch item to execute
- */
- private void runItem(final ItemDescriptor itemDescriptor) {
- if ((workbenchShell == null) || (itemDescriptor == null)) return;
- final LaunchDelegate launchDelegate = itemDescriptor.getLaunchDelegate();
- if (launchDelegate == null) return;
-
- boolean result = launchDelegate.launch(this);
- if (! result) {
- MessageDialog.openError(workbenchShell,
- LauncherPlugin.getResourceString("dialog.RunProgramProblems.title"),
- LauncherPlugin.getResourceString("dialog.RunProgramErrorCheckLog.message",
- new Object[] { itemDescriptor.getName() }));
- }
- }
-
- /**
- * Imports the specified launch item into the workspace.
- *
- * @param itemDescriptor the launch item to import.
- */
- private void importItem(final ItemDescriptor itemDescriptor) {
- if ((workbenchShell == null) || (itemDescriptor == null)) return;
-
- URL sourceUrl = itemDescriptor.getSourceCodePath();
- if (sourceUrl == null) return; // oops! can't do that!
-
- ImportProjectTask task = new ImportProjectTask(workbenchShell, itemDescriptor.getName(),
- sourceUrl);
- boolean success = task.execute();
- task.dispose();
- }
- /**
- * Obtains the selected launch item.
- *
- * @return the currently selected ItemDescriptor
- */
- private ItemDescriptor getSelectedItem() {
- final TreeItem[] selections = launchTree.getSelection();
- if (selections.length == 0) return null;
- final ItemDescriptor itemDescriptor = (ItemDescriptor) selections[0].getData();
- return itemDescriptor;
- }
-
- /**
- * Sets the currently visible description text to reflect that of a particular ItemDescriptor.
- *
- * @param itemDescriptor the launch item whose description is to be displayed, or null if none
- */
- private void setDescriptionByItem(ItemDescriptor itemDescriptor) {
- String description;
- if (itemDescriptor == null) {
- description = LauncherPlugin.getResourceString("launchitem.Null.description");
- if (runButton != null) runButton.setEnabled(false);
- //if (importButton != null) importButton.setEnabled(false);
- } else {
- description = itemDescriptor.getDescription();
- if (description == null)
- description = LauncherPlugin.getResourceString("launchitem.Missing.description");
-
- if (runButton != null) runButton.setEnabled(itemDescriptor.getLaunchDelegate() != null);
- //if (importButton != null) importButton.setEnabled(itemDescriptor.getSourceCodePath() != null);
- }
- descriptionText.setText(description);
- }
-} \ No newline at end of file
diff --git a/examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/SplitLayout.java b/examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/SplitLayout.java
deleted file mode 100755
index 01913074c4..0000000000
--- a/examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/SplitLayout.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.eclipse.swt.examples.launcher; /* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved */ import org.eclipse.swt.*; import org.eclipse.swt.graphics.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; /** * A Layout class that automatically switches from a horizontal split to a vertical * split layout to accomodate changing size conditions. * * Later on we might improve this class to take into account the "preferred" size of * the widgets. */
-public class SplitLayout extends Layout { private static final int splitHorizontally = 0, splitVertically = 1; private int splitDirection = splitHorizontally; public int spacing = 3; public int marginTop = 3;
- public int marginLeft = 3; public int marginRight = 3; public int marginBottom = 3; /**
- * Creates a new layout
- */
- public SplitLayout() { }
- /** * @see Layout#computeSize(Composite, int, int, boolean) */ protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) { if (wHint == SWT.DEFAULT) { if (hHint == SWT.DEFAULT) { Point hSplitSize = computeHSplitSize(composite, wHint, hHint, flushCache); Point vSplitSize = computeVSplitSize(composite, wHint, hHint, false); int hSplitArea = hSplitSize.x * hSplitSize.y; int vSplitArea = vSplitSize.x * vSplitSize.y; // Choose direction consuming least area if (hSplitArea < vSplitArea) { splitDirection = splitHorizontally; return hSplitSize; } else { splitDirection = splitVertically; return vSplitSize; } } else { // Constrained in height: split vertically splitDirection = splitVertically; return computeVSplitSize(composite, wHint, hHint, flushCache); } } else { if (hHint == SWT.DEFAULT) { // Constrained in width: split horizontally splitDirection = splitHorizontally; return computeHSplitSize(composite, wHint, hHint, flushCache); } else { if (hHint < wHint) { splitDirection = splitVertically; return computeVSplitSize(composite, wHint, hHint, flushCache); } else { splitDirection = splitHorizontally; return computeHSplitSize(composite, wHint, hHint, flushCache); } } } }
- /**
- * @see Layout#layout(Composite, boolean)
- */
- protected void layout(Composite composite, boolean flushCache) { Rectangle clientArea = composite.getClientArea(); computeSize(composite, clientArea.width, clientArea.height, false); Control[] children = composite.getChildren(); clientArea.x += marginLeft; clientArea.y += marginTop; clientArea.width -= marginRight + marginLeft; clientArea.height -= marginBottom + marginTop; Point position = new Point(clientArea.x, clientArea.y); for (int i = 0; i < children.length; ++i) { final Control child = children[i]; final Rectangle bounds; if (splitDirection == splitHorizontally) { int height = clientArea.height / children.length; bounds = new Rectangle(position.x, position.y, clientArea.width, height); position.y += height + spacing; } else { int width = clientArea.width / children.length; bounds = new Rectangle(position.x, position.y, width, clientArea.height); position.x += width + spacing; } bounds.width = Math.max(bounds.width, 0); bounds.height = Math.max(bounds.height, 0); child.setBounds(bounds); } }
- private Point computeHSplitSize(Composite composite, int wHint, int hHint, boolean flushCache) { Point size = new Point(marginLeft + marginRight, marginTop + marginBottom); Control[] children = composite.getChildren(); for (int i = 0; i < children.length; ++i) { final Control child = children[i]; Point childSize = child.computeSize(wHint, hHint, flushCache); size.x = Math.max(size.x, childSize.x); size.y += childSize.y + spacing; } return size; } private Point computeVSplitSize(Composite composite, int wHint, int hHint, boolean flushCache) { Point size = new Point(marginLeft + marginRight, marginTop + marginBottom); Control[] children = composite.getChildren(); for (int i = 0; i < children.length; ++i) { final Control child = children[i]; Point childSize = child.computeSize(wHint, hHint, flushCache); size.x += childSize.x + spacing; size.y = Math.max(size.y, childSize.y); } return size; } }
diff --git a/examples/org.eclipse.swt.examples.ole.win32/.classpath b/examples/org.eclipse.swt.examples.ole.win32/.classpath
deleted file mode 100755
index 69fb28eb43..0000000000
--- a/examples/org.eclipse.swt.examples.ole.win32/.classpath
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path=""/>
- <classpathentry kind="var" path="JRE_LIB"/>
- <classpathentry kind="var"
- path="ECLIPSE_HOME/plugins/org.eclipse.core.runtime/runtime.jar" sourcepath="ECLIPSE_HOME/plugins/org.eclipse.core.runtime/runtimesrc.zip"/>
- <classpathentry kind="var"
- path="ECLIPSE_HOME/plugins/org.eclipse.ui/workbench.jar" sourcepath="ECLIPSE_HOME/plugins/org.eclipse.ui/workbenchsrc.zip"/>
- <classpathentry kind="src" path="/org.eclipse.swt"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/examples/org.eclipse.swt.examples.ole.win32/.cvsignore b/examples/org.eclipse.swt.examples.ole.win32/.cvsignore
deleted file mode 100755
index c5e82d7458..0000000000
--- a/examples/org.eclipse.swt.examples.ole.win32/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin \ No newline at end of file
diff --git a/examples/org.eclipse.swt.examples.ole.win32/.vcm_meta b/examples/org.eclipse.swt.examples.ole.win32/.vcm_meta
deleted file mode 100755
index d64b057431..0000000000
--- a/examples/org.eclipse.swt.examples.ole.win32/.vcm_meta
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project-description>
- <comment></comment>
- <nature id="org.eclipse.jdt.core.javanature"/>
- <nature id="org.eclipse.pde.PluginNature"/>
- <reference project-name="org.eclipse.swt"/>
- <builder name="org.eclipse.jdt.core.javabuilder">
- </builder>
- <builder name="org.eclipse.pde.ManifestBuilder">
- </builder>
- <builder name="org.eclipse.pde.SchemaBuilder">
- </builder>
-</project-description>
diff --git a/examples/org.eclipse.swt.examples.ole.win32/build.properties b/examples/org.eclipse.swt.examples.ole.win32/build.properties
deleted file mode 100755
index a4017f32a9..0000000000
--- a/examples/org.eclipse.swt.examples.ole.win32/build.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-bin.includes = doc-html/,\
- icons/,\
- plugin.properties,\
- plugin.xml
-
-source.olewin32.jar = org/,import.properties
diff --git a/examples/org.eclipse.swt.examples.ole.win32/doc-html/hglegal.htm b/examples/org.eclipse.swt.examples.ole.win32/doc-html/hglegal.htm
deleted file mode 100755
index b071dbdf45..0000000000
--- a/examples/org.eclipse.swt.examples.ole.win32/doc-html/hglegal.htm
+++ /dev/null
@@ -1,14 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="GENERATOR" content="Mozilla/4.73 [en] (Win98; U) [Netscape]">
- <title>Legal Notices</title>
-</head>
-<body>
-
-<h3>
-<a NAME="Notices"></a>Notices</h3>
-(c) Copyright IBM Corp. 2000, 2001. All Rights Reserved.
-</body>
-</html>
diff --git a/examples/org.eclipse.swt.examples.ole.win32/doc-html/ngibmcpy.gif b/examples/org.eclipse.swt.examples.ole.win32/doc-html/ngibmcpy.gif
deleted file mode 100755
index 360f8e9989..0000000000
--- a/examples/org.eclipse.swt.examples.ole.win32/doc-html/ngibmcpy.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.ole.win32/doc-html/swt_ole_ex.html b/examples/org.eclipse.swt.examples.ole.win32/doc-html/swt_ole_ex.html
deleted file mode 100755
index 882d680053..0000000000
--- a/examples/org.eclipse.swt.examples.ole.win32/doc-html/swt_ole_ex.html
+++ /dev/null
@@ -1,40 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>SWT - OLE Web Browser</title>
-</head>
-<body>
-
-<h2>Example - OLE Web Browser</h2>
-
-<h3>Introduction</h3>
-<p>This example demonstrates how to embed Active X / OLE controls into an
-SWT application or an Eclipse view.&nbsp; When the view is activated, it
-will create an instance of a Windows "Shell.Explorer" control and provide
-a GUI interface to it via OLE Automation.&nbsp; To run this example, Internet
-Explorer must be installed.
-</p>
-
-<h3>Running the example</h3>
-<p>To run the OLE Web Browser Example, pull down the Perspective menu, select the
-Show View menu item, then select Other from the submenu.&nbsp; A dialog
-will come up with a list of views.&nbsp; Expand SWT Examples and select
-the view named OLE Web Browser.&nbsp; A view containing an editor that
-appears similar to your default web browser will appear.
-</p>
-
-<h3>Details</h3>
-<p>The OLE Web Browser has Back and Forward buttons to take you to recently
-visited pages.&nbsp; The browser also contains a Home button to take you
-to the web browser's home page, a Stop button which stops the current transfer,
-a Search button which will search for text typed in the Address text field,
-and a Refresh button which re-draws the contents of the currently displayed
-page.&nbsp; There is also a Go button which, when clicked, will attempt
-to load the page specified in the Address field.&nbsp; One would expect
-each of these operations on every web browser.
-</p>
-
-<p><a href="hglegal.htm"><img SRC="ngibmcpy.gif" ALT="Copyright IBM Corporation 2000, 2001. All Rights Reserved." BORDER=0 height=12 width=195></a></p>
-</body>
-</html>
diff --git a/examples/org.eclipse.swt.examples.ole.win32/icons/backward_nav.gif b/examples/org.eclipse.swt.examples.ole.win32/icons/backward_nav.gif
deleted file mode 100755
index 5fcf41b783..0000000000
--- a/examples/org.eclipse.swt.examples.ole.win32/icons/backward_nav.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.ole.win32/icons/forward_nav.gif b/examples/org.eclipse.swt.examples.ole.win32/icons/forward_nav.gif
deleted file mode 100755
index 3b9b6af9b1..0000000000
--- a/examples/org.eclipse.swt.examples.ole.win32/icons/forward_nav.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.ole.win32/icons/home_nav.gif b/examples/org.eclipse.swt.examples.ole.win32/icons/home_nav.gif
deleted file mode 100755
index 77a2306ed2..0000000000
--- a/examples/org.eclipse.swt.examples.ole.win32/icons/home_nav.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.ole.win32/icons/refresh_nav.gif b/examples/org.eclipse.swt.examples.ole.win32/icons/refresh_nav.gif
deleted file mode 100755
index e270e18bde..0000000000
--- a/examples/org.eclipse.swt.examples.ole.win32/icons/refresh_nav.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.ole.win32/icons/search_nav.gif b/examples/org.eclipse.swt.examples.ole.win32/icons/search_nav.gif
deleted file mode 100755
index 73ac91bddb..0000000000
--- a/examples/org.eclipse.swt.examples.ole.win32/icons/search_nav.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.ole.win32/icons/stop_nav.gif b/examples/org.eclipse.swt.examples.ole.win32/icons/stop_nav.gif
deleted file mode 100755
index 653d347b57..0000000000
--- a/examples/org.eclipse.swt.examples.ole.win32/icons/stop_nav.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.ole.win32/icons/webbrowser_example.gif b/examples/org.eclipse.swt.examples.ole.win32/icons/webbrowser_example.gif
deleted file mode 100755
index 895e22110d..0000000000
--- a/examples/org.eclipse.swt.examples.ole.win32/icons/webbrowser_example.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.ole.win32/import.properties b/examples/org.eclipse.swt.examples.ole.win32/import.properties
deleted file mode 100755
index 9185f56fc8..0000000000
--- a/examples/org.eclipse.swt.examples.ole.win32/import.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-# 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 = <<ECLIPSE_PLUGINS>>
diff --git a/examples/org.eclipse.swt.examples.ole.win32/org/eclipse/swt/examples/ole/win32/OleBrowserView.java b/examples/org.eclipse.swt.examples.ole.win32/org/eclipse/swt/examples/ole/win32/OleBrowserView.java
deleted file mode 100755
index 2d2c94fac2..0000000000
--- a/examples/org.eclipse.swt.examples.ole.win32/org/eclipse/swt/examples/ole/win32/OleBrowserView.java
+++ /dev/null
@@ -1,354 +0,0 @@
-package org.eclipse.swt.examples.ole.win32;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.*; import org.eclipse.swt.events.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.ole.win32.*; import org.eclipse.swt.widgets.*; import org.eclipse.ui.part.*;
-
-/**
- * Ole uses <code>org.eclipse.swt</code> to demonstrate Win32 OLE / ActiveX
- * integration.
- *
- * @see ViewPart
- */
-public class OleBrowserView extends ViewPart {
-
- private Composite displayArea;
-
- private OleFrame webFrame;
- private OleWebBrowser webBrowser;
- private Text webUrl;
- private OleControlSite webControlSite;
- private ProgressBar webProgress;
- private Label webStatus;
- private Button webNavigateButton;
-
- private ToolItem webCommandBackward;
- private ToolItem webCommandForward;
- private ToolItem webCommandHome;
- private ToolItem webCommandStop;
- private ToolItem webCommandRefresh;
- private ToolItem webCommandSearch;
-
- private boolean activated = false;
-
- /**
- * Constructs the OLE browser view.
- */
- public OleBrowserView() {
- OlePlugin.initResources();
- }
-
- /**
- * Creates the example.
- *
- * @see ViewPart#createPartControl
- */
- public void createPartControl(Composite parent) {
- displayArea = new Composite(parent, SWT.NONE);
-
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 3;
- displayArea.setLayout(gridLayout);
-
- createToolbar();
- createBrowserFrame();
- createStatusArea();
- createBrowserControl();
- }
-
- /**
- * Cleanup
- */
- public void dispose() {
- if (activated) {
- webControlSite.deactivateInPlaceClient();
- activated = false;
- }
- if (webBrowser != null) webBrowser.dispose();
- webBrowser = null;
- super.dispose();
- }
-
- /**
- * Called when we must grab focus.
- *
- * @see org.eclipse.ui.part.ViewPart#setFocus
- */
- public void setFocus() {
- webUrl.setFocus();
- }
-
- /**
- * Creates the Web browser toolbar.
- */
- private void createToolbar() {
- // Add a toolbar
- ToolBar bar = new ToolBar(displayArea, SWT.NONE);
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
- gridData.horizontalSpan = 3;
- bar.setLayoutData(gridData);
-
- // Add a button to navigate backwards through previously visited web sites
- webCommandBackward = new ToolItem(bar, SWT.NONE);
- webCommandBackward.setToolTipText(OlePlugin.getResourceString("browser.Back.tooltip"));
- webCommandBackward.setText(OlePlugin.getResourceString("browser.Back.text"));
- webCommandBackward.setImage(OlePlugin.images[OlePlugin.biBack]);
- webCommandBackward.setEnabled(false);
- webCommandBackward.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event e) {
- if (webBrowser == null) return;
- webBrowser.GoBack();
- }
- });
-
- // Add a button to navigate forward through previously visited web sites
- webCommandForward = new ToolItem(bar, SWT.NONE);
- webCommandForward.setToolTipText(OlePlugin.getResourceString("browser.Forward.tooltip"));
- webCommandForward.setText(OlePlugin.getResourceString("browser.Forward.text"));
- webCommandForward.setImage(OlePlugin.images[OlePlugin.biForward]);
- webCommandForward.setEnabled(false);
- webCommandForward.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event e) {
- if (webBrowser == null) return;
- webBrowser.GoForward();
- }
- });
-
- // Add a separator
- new ToolItem(bar, SWT.SEPARATOR);
-
- // Add a button to navigate to the Home page
- webCommandHome = new ToolItem(bar, SWT.NONE);
- webCommandHome.setToolTipText(OlePlugin.getResourceString("browser.Home.tooltip"));
- webCommandHome.setText(OlePlugin.getResourceString("browser.Home.text"));
- webCommandHome.setImage(OlePlugin.images[OlePlugin.biHome]);
- webCommandHome.setEnabled(false);
- webCommandHome.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event e) {
- if (webBrowser == null) return;
- webBrowser.GoHome();
- }
- });
-
- // Add a button to abort web page loading
- webCommandStop = new ToolItem(bar, SWT.NONE);
- webCommandStop.setToolTipText(OlePlugin.getResourceString("browser.Stop.tooltip"));
- webCommandStop.setText(OlePlugin.getResourceString("browser.Stop.text"));
- webCommandStop.setImage(OlePlugin.images[OlePlugin.biStop]);
- webCommandStop.setEnabled(false);
- webCommandStop.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event e) {
- if (webBrowser == null) return;
- webBrowser.Stop();
- }
- });
-
- // Add a button to refresh the current web page
- webCommandRefresh = new ToolItem(bar, SWT.NONE);
- webCommandRefresh.setToolTipText(OlePlugin.getResourceString("browser.Refresh.tooltip"));
- webCommandRefresh.setText(OlePlugin.getResourceString("browser.Refresh.text"));
- webCommandRefresh.setImage(OlePlugin.images[OlePlugin.biRefresh]);
- webCommandRefresh.setEnabled(false);
- webCommandRefresh.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event e) {
- if (webBrowser == null) return;
- webBrowser.Refresh();
- }
- });
-
- // Add a separator
- new ToolItem(bar, SWT.SEPARATOR);
-
- // Add a button to search the web
- webCommandSearch = new ToolItem(bar, SWT.NONE);
- webCommandSearch.setToolTipText(OlePlugin.getResourceString("browser.Search.tooltip"));
- webCommandSearch.setText(OlePlugin.getResourceString("browser.Search.text"));
- webCommandSearch.setImage(OlePlugin.images[OlePlugin.biSearch]);
- webCommandSearch.setEnabled(false);
- webCommandSearch.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event e) {
- if (webBrowser == null) return;
- webBrowser.GoSearch();
- }
- });
-
- // Add a text area for Users to enter a url
- Composite addressBar = new Composite(displayArea, SWT.NONE);
- gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
- gridData.horizontalSpan = 3;
- addressBar.setLayoutData(gridData);
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 3;
- addressBar.setLayout(gridLayout);
-
- Label addressLabel = new Label(addressBar, SWT.NONE);
- gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL);
- addressLabel.setLayoutData(gridData);
- addressLabel.setText(OlePlugin.getResourceString("browser.Address.label"));
- addressLabel.setFont(OlePlugin.browserFont);
-
- webUrl = new Text(addressBar, SWT.SINGLE | SWT.BORDER);
- webUrl.setFont(OlePlugin.browserFont);
- gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
- webUrl.setLayoutData(gridData);
- webUrl.addFocusListener(new FocusAdapter() {
- public void focusGained(FocusEvent e) {
- webNavigateButton.getShell().setDefaultButton(webNavigateButton);
- }
- });
-
- // Add a button to navigate to the web site specified in the Text area defined above
- webNavigateButton = new Button(addressBar, SWT.PUSH);
- gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL);
- webNavigateButton.setLayoutData(gridData);
- webNavigateButton.setText(OlePlugin.getResourceString("browser.Go.text"));
- webNavigateButton.setFont(OlePlugin.browserFont);
- webNavigateButton.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event event) {
- if (webBrowser == null) return;
- webBrowser.Navigate(webUrl.getText());
- }
- });
- }
-
- /**
- * Creates the Web browser OleFrame.
- */
- private void createBrowserFrame() {
- // Every control must have an associated OleFrame:
- webFrame = new OleFrame(displayArea, SWT.NONE);
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
- gridData.horizontalSpan = 3;
- webFrame.setLayoutData(gridData);
- }
-
- /**
- * Creates the Web browser status area.
- */
- private void createStatusArea() {
- // Add a progress bar to display downloading progress information
- webProgress = new ProgressBar(displayArea, SWT.BORDER);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.BEGINNING;
- gridData.verticalAlignment = GridData.FILL;
- webProgress.setLayoutData(gridData);
-
- // Add a label for displaying status messages as they are received from the control
- webStatus = new Label(displayArea, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
- gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
- gridData.horizontalSpan = 2;
- webStatus.setLayoutData(gridData);
- webStatus.setFont(OlePlugin.browserFont);
- }
-
- /**
- * Creates Web browser control.
- */
- private void createBrowserControl() {
- try {
- // Create an Automation object for access to extended capabilities
- webControlSite = new OleControlSite(webFrame, SWT.NONE, "Shell.Explorer");
- OleAutomation oleAutomation = new OleAutomation(webControlSite);
- webBrowser = new OleWebBrowser(oleAutomation);
- } catch (SWTException ex) {
- // Creation may have failed because control is not installed on machine
- Label label = new Label(webFrame, SWT.BORDER);
- OlePlugin.logError(OlePlugin.getResourceString("error.CouldNotCreateBrowserControl"), ex);
- label.setText(OlePlugin.getResourceString("error.CouldNotCreateBrowserControl"));
- return;
- }
-
- // Respond to ProgressChange events by updating the Progress bar
- webControlSite.addEventListener(OleWebBrowser.ProgressChange, new OleListener() {
- public void handleEvent(OleEvent event) {
- Variant progress = event.arguments[0];
- Variant maxProgress = event.arguments[1];
- if (progress == null || maxProgress == null)
- return;
- webProgress.setMaximum(maxProgress.getInt());
- webProgress.setSelection(progress.getInt());
- }
- });
-
- // Respond to StatusTextChange events by updating the Status Text label
- webControlSite.addEventListener(OleWebBrowser.StatusTextChange, new OleListener() {
- public void handleEvent(OleEvent event) {
- Variant statusText = event.arguments[0];
- if (statusText == null) return;
- String text = statusText.getString();
- if (text != null)
- webStatus.setText(text);
- }
- });
-
- // Listen for changes to the ready state and print out the current state
- webControlSite.addPropertyListener(OleWebBrowser.DISPID_READYSTATE, new OleListener() {
- public void handleEvent(OleEvent event) {
- if (event.detail == OLE.PROPERTY_CHANGING) return;
- int state = webBrowser.getReadyState();
- switch (state) {
- case OleWebBrowser.READYSTATE_UNINITIALIZED:
- webStatus.setText(
- OlePlugin.getResourceString("browser.State.Uninitialized.text"));
- webCommandBackward.setEnabled(false);
- webCommandForward.setEnabled(false);
- webCommandHome.setEnabled(false);
- webCommandRefresh.setEnabled(false);
- webCommandStop.setEnabled(false);
- webCommandSearch.setEnabled(false);
- break;
- case OleWebBrowser.READYSTATE_LOADING:
- webStatus.setText(
- OlePlugin.getResourceString("browser.State.Loading.text"));
- webCommandHome.setEnabled(true);
- webCommandRefresh.setEnabled(true);
- webCommandStop.setEnabled(true);
- webCommandSearch.setEnabled(true);
- break;
- case OleWebBrowser.READYSTATE_LOADED:
- webStatus.setText(
- OlePlugin.getResourceString("browser.State.Loaded.text"));
- webCommandStop.setEnabled(true);
- break;
- case OleWebBrowser.READYSTATE_INTERACTIVE:
- webStatus.setText(
- OlePlugin.getResourceString("browser.State.Interactive.text"));
- webCommandStop.setEnabled(true);
- break;
- case OleWebBrowser.READYSTATE_COMPLETE:
- webStatus.setText(
- OlePlugin.getResourceString("browser.State.Complete.text"));
- webCommandStop.setEnabled(false);
- break;
- }
- }
- });
-
- // Listen for changes to the active command states
- webControlSite.addEventListener(OleWebBrowser.CommandStateChange, new OleListener() {
- public void handleEvent(OleEvent event) {
- if (event.type != OleWebBrowser.CommandStateChange) return;
- final int commandID =
- (event.arguments[0] != null) ? event.arguments[0].getInt() : 0;
- final boolean commandEnabled =
- (event.arguments[1] != null) ? event.arguments[1].getBoolean() : false;
-
- switch (commandID) {
- case OleWebBrowser.CSC_NAVIGATEBACK:
- webCommandBackward.setEnabled(commandEnabled);
- break;
- case OleWebBrowser.CSC_NAVIGATEFORWARD:
- webCommandForward.setEnabled(commandEnabled);
- break;
- }
- }
- });
-
- // in place activate the ActiveX control
- activated = (webControlSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE) == OLE.S_OK);
- if (activated) webBrowser.GoHome();
- }
-}
diff --git a/examples/org.eclipse.swt.examples.ole.win32/org/eclipse/swt/examples/ole/win32/OlePlugin.java b/examples/org.eclipse.swt.examples.ole.win32/org/eclipse/swt/examples/ole/win32/OlePlugin.java
deleted file mode 100755
index 4fee12a0b9..0000000000
--- a/examples/org.eclipse.swt.examples.ole.win32/org/eclipse/swt/examples/ole/win32/OlePlugin.java
+++ /dev/null
@@ -1,170 +0,0 @@
-package org.eclipse.swt.examples.ole.win32;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import java.io.*; import java.net.*; import java.text.*; import java.util.*; import org.eclipse.core.runtime.*; import org.eclipse.swt.*; import org.eclipse.swt.graphics.*; import org.eclipse.ui.plugin.*;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class OlePlugin extends AbstractUIPlugin {
- //The shared instance.
- private static OlePlugin plugin;
- private static ResourceBundle resourceBundle;
-
- static final int
- biBack = 0,
- biForward = 1,
- biHome = 2,
- biStop = 3,
- biRefresh = 4,
- biSearch = 5;
- static final String[] imageLocations = {
- "icons/backward_nav.gif",
- "icons/forward_nav.gif",
- "icons/home_nav.gif",
- "icons/stop_nav.gif",
- "icons/refresh_nav.gif",
- "icons/search_nav.gif" };
- static Image images[];
- static Font browserFont;
-
- /**
- * Constructs an OLE plugin.
- */
- public OlePlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- plugin = this;
- resourceBundle = descriptor.getResourceBundle();
- }
-
- /**
- * Clean up
- */
- public void shutdown() throws CoreException {
- super.shutdown();
- freeResources();
- }
-
- /**
- * Returns the shared instance.
- */
- public static OlePlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns a string from the resource bundle.
- * We don't want to crash because of a missing String.
- * Returns the key if not found.
- */
- public static String getResourceString(String key) {
- try {
- return resourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return key;
- } catch (NullPointerException e) {
- return "!" + key + "!";
- }
- }
-
- /**
- * Returns a string from the resource bundle and binds it
- * with the given arguments. If the key is not found,
- * return the key.
- */
- public static String getResourceString(String key, Object[] args) {
- try {
- return MessageFormat.format(getResourceString(key), args);
- } catch (MissingResourceException e) {
- return key;
- } catch (NullPointerException e) {
- return "!" + key + "!";
- }
- }
-
- /**
- * Log an error to the ILog for this plugin
- *
- * @param message the localized error message text
- * @param exception the associated exception, or null
- */
- public static void logError(String message, Throwable exception) {
- plugin.getLog().log(new Status(IStatus.ERROR, plugin.getDescriptor().getUniqueIdentifier(),
- 0, message, exception));
- }
-
- /**
- * Loads the resources.
- */
- public static void initResources() {
- if (images == null) {
- images = new Image[imageLocations.length];
-
- for (int i = 0; i < imageLocations.length; ++i) {
- images[i] = getImageFromPlugin(plugin.getDescriptor(), imageLocations[i]);
- if (images[i] == null) {
- freeResources();
- logError(getResourceString("error.CouldNotLoadResources"), null);
- throw new IllegalStateException();
- }
- }
- }
- if (browserFont == null) {
- try {
- browserFont = new Font (null, "MS Sans Serif", 8, SWT.NULL);
- } catch (Throwable ex) {
- }
- }
- if (images == null || browserFont == null) {
- freeResources();
- logError(getResourceString("error.CouldNotLoadResources"), null);
- throw new IllegalStateException();
- }
- }
-
- /**
- * Frees the resources
- */
- public static 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;
- }
- if (browserFont != null) browserFont.dispose ();
- browserFont = null;
- }
-
- /**
- * Gets an image from a path relative to the plugin install directory.
- *
- * @param pd the plugin descriptor for the plugin with the image
- * @param iconPath the path relative to the install directory
- * @return the image, or null if not found
- */
- private static Image getImageFromPlugin(IPluginDescriptor pd, String iconPath) {
- InputStream is = null;
- try {
- URL installUrl = pd.getInstallURL();
- URL url = new URL(installUrl, iconPath);
- is = url.openConnection().getInputStream();
- ImageData source = new ImageData(is);
- ImageData mask = source.getTransparencyMask();
- Image image = new Image(null, source, mask);
- return image;
- } catch (Throwable ex) {
- return null;
- } finally {
- try {
- if (is != null) is.close();
- } catch (IOException e) {
- }
- }
- }
-}
diff --git a/examples/org.eclipse.swt.examples.ole.win32/org/eclipse/swt/examples/ole/win32/OleWebBrowser.java b/examples/org.eclipse.swt.examples.ole.win32/org/eclipse/swt/examples/ole/win32/OleWebBrowser.java
deleted file mode 100755
index 555cfb935e..0000000000
--- a/examples/org.eclipse.swt.examples.ole.win32/org/eclipse/swt/examples/ole/win32/OleWebBrowser.java
+++ /dev/null
@@ -1,251 +0,0 @@
-package org.eclipse.swt.examples.ole.win32;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.ole.win32.*;
-
-/**
- * Wrapper for an OleAutomation object used to send commands
- * to a Win32 "Shell.Explorer" OLE control.
- *
- * Instances of this class manage the setup, typical use and teardown of
- * a simple web browser.
- */
-class OleWebBrowser {
- /* See the Windows Platform SDK documentation for more information about the
- * OLE control used here and its usage.
- */
- // Generated from typelib filename: shdocvw.dll
-
- // Constants for WebBrowser CommandStateChange
- public static final int CSC_UPDATECOMMANDS = -1;
- public static final int CSC_NAVIGATEFORWARD = 1;
- public static final int CSC_NAVIGATEBACK = 2;
-
- // COnstants for Web Browser ReadyState
- public static final int READYSTATE_UNINITIALIZED = 0;
- public static final int READYSTATE_LOADING = 1;
- public static final int READYSTATE_LOADED = 2;
- public static final int READYSTATE_INTERACTIVE = 3;
- public static final int READYSTATE_COMPLETE = 4;
-
- // Web Browser Control Events
- public static final int BeforeNavigate = 100; // Fired when a new hyperlink is being navigated to.
- public static final int NavigateComplete = 101; // Fired when the document being navigated to becomes visible and enters the navigation stack.
- public static final int StatusTextChange = 102; // Statusbar text changed.
- public static final int ProgressChange = 108; // Fired when download progress is updated.
- public static final int DownloadComplete = 104; // Download of page complete.
- public static final int CommandStateChange = 105; // The enabled state of a command changed
- public static final int DownloadBegin = 106; // Download of a page started.
- public static final int NewWindow = 107; // Fired when a new window should be created.
- public static final int TitleChange = 113; // Document title changed.
- public static final int FrameBeforeNavigate = 200; // Fired when a new hyperlink is being navigated to in a frame.
- public static final int FrameNavigateComplete = 201; // Fired when a new hyperlink is being navigated to in a frame.
- public static final int FrameNewWindow = 204; // Fired when a new window should be created.
- public static final int Quit = 103; // Fired when application is quiting.
- public static final int WindowMove = 109; // Fired when window has been moved.
- public static final int WindowResize = 110; // Fired when window has been sized.
- public static final int WindowActivate = 111; // Fired when window has been activated.
- public static final int PropertyChange = 112; // Fired when the PutProperty method has been called.
-
- // Web Browser properties
- public static final int DISPID_READYSTATE = -525;
-
- private OleAutomation oleAutomation;
-
- /**
- * Creates a Web browser control.
- * <p>
- * Typical use:<br>
- * <code>
- * OleControlSite oleControlSite = new OleControlSite(oleFrame, style, "Shell.Explorer");<br>
- * OleAutomation oleAutomation = new OleAutomation(oleControlSite);<br>
- * OleWebBrowser webBrowser = new OleWebBrowser(oleControlSite, oleAutomation);<br>
- * </code>
- *
- * @param oleAutomation the OleAutomation object for this control.
- * @param oleControlSite the OleControlSite object for this control.
- */
- public OleWebBrowser(OleAutomation oleAutomation) {
- this.oleAutomation = oleAutomation;
- }
-
-
- /**
- * Disposes of the Web browser control.
- */
- public void dispose() {
- if (oleAutomation != null) oleAutomation.dispose();
- oleAutomation = null;
- }
-
- /*
- * Interact with the Control via OLE Automation
- *
- * Note: You can hard code the DISPIDs if you know them beforehand
- * this is of course the fastest way, but you increase coupling
- * to the control.
- */
-
- /**
- * Returns the current web page title.
- *
- * @return the current web page title String
- */
- public String getLocationName() {
- // dispid=210, type=PROPGET, name="LocationName"
- int[] rgdispid = oleAutomation.getIDsOfNames(new String[]{"LocationName"});
- int dispIdMember = rgdispid[0];
- Variant pVarResult = oleAutomation.getProperty(dispIdMember);
- if (pVarResult == null) return null;
- return pVarResult.getString();
- }
-
- /**
- * Returns the current URL.
- *
- * @return the current URL String
- */
- public String getLocationURL() {
- // dispid=211, type=PROPGET, name="LocationURL"
- int[] rgdispid = oleAutomation.getIDsOfNames(new String[]{"LocationURL"});
- int dispIdMember = rgdispid[0];
-
- Variant pVarResult = oleAutomation.getProperty(dispIdMember);
- if (pVarResult == null) return null;
- return pVarResult.getString();
- }
-
- /**
- * Returns the current state of the control.
- *
- * @return the current state of the control, one of:
- * READYSTATE_UNINITIALIZED;
- * READYSTATE_LOADING;
- * READYSTATE_LOADED;
- * READYSTATE_INTERACTIVE;
- * READYSTATE_COMPLETE.
- */
- public int getReadyState() {
- // dispid=4294966771, type=PROPGET, name="ReadyState"
- int[] rgdispid = oleAutomation.getIDsOfNames(new String[]{"ReadyState"});
- int dispIdMember = rgdispid[0];
-
- Variant pVarResult = oleAutomation.getProperty(dispIdMember);
- if (pVarResult == null) return -1;
- return pVarResult.getInt();
- }
-
- /**
- * Navigates backwards through previously visited web sites.
- *
- * @return the platform-defined result code for the "GoBack" method invocation
- */
- public int GoBack() {
-
- // dispid=100, type=METHOD, name="GoBack"
- int[] rgdispid = oleAutomation.getIDsOfNames(new String[]{"GoBack"});
- int dispIdMember = rgdispid[0];
-
- Variant pVarResult = oleAutomation.invoke(dispIdMember);
- if (pVarResult == null) return 0;
- return pVarResult.getInt();
- }
-
- /**
- * Navigates backwards through previously visited web sites.
- *
- * @return the platform-defined result code for the "GoForward" method invocation
- */
- public int GoForward() {
-
- // dispid=101, type=METHOD, name="GoForward"
- int[] rgdispid = oleAutomation.getIDsOfNames(new String[]{"GoForward"});
- int dispIdMember = rgdispid[0];
-
- Variant pVarResult = oleAutomation.invoke(dispIdMember);
- if (pVarResult == null) return 0;
- return pVarResult.getInt();
- }
-
- /**
- * Navigates to home page.
- *
- * @return the platform-defined result code for the "GoHome" method invocation
- */
- public int GoHome() {
- // dispid=102, type=METHOD, name="GoHome"
- int[] rgdispid = oleAutomation.getIDsOfNames(new String[]{"GoHome"});
- int dispIdMember = rgdispid[0];
-
- Variant pVarResult = oleAutomation.invoke(dispIdMember);
- if (pVarResult == null) return 0;
- return pVarResult.getInt();
- }
-
- /**
- * Navigates to user-specified Web search gateway.
- *
- * @return the platform-defined result code for the "GoSearch" method invocation
- */
- public int GoSearch() {
- // dispid=103, type=METHOD, name="GoSearch"
- int[] rgdispid = oleAutomation.getIDsOfNames(new String[]{"GoSearch"});
- int dispIdMember = rgdispid[0];
-
- Variant pVarResult = oleAutomation.invoke(dispIdMember);
- if (pVarResult == null) return 0;
- return pVarResult.getInt();
- }
-
- /**
- * Navigates to a particular URL.
- *
- * @return the platform-defined result code for the "Navigate" method invocation
- */
- public int Navigate(String url) {
- // dispid=104, type=METHOD, name="Navigate"
- int[] rgdispid = oleAutomation.getIDsOfNames(new String[]{"Navigate", "URL"});
- int dispIdMember = rgdispid[0];
-
- Variant[] rgvarg = new Variant[1];
- rgvarg[0] = new Variant(url);
- int[] rgdispidNamedArgs = new int[1];
- rgdispidNamedArgs[0] = rgdispid[1]; // identifier of argument
- Variant pVarResult = oleAutomation.invoke(dispIdMember, rgvarg, rgdispidNamedArgs);
-
- if (pVarResult == null) return 0;
- return pVarResult.getInt();
- }
-
- /**
- * Refreshes the currently viewed page.
- *
- * @return the platform-defined result code for the "Refresh" method invocation
- */
- public void Refresh(){
- // dispid= 4294966746, type=METHOD, name="Refresh"
- int[] rgdispid = oleAutomation.getIDsOfNames(new String[]{"Refresh"});
- int dispIdMember = rgdispid[0];
-
- oleAutomation.invokeNoReply(dispIdMember);
- }
-
- /**
- * Aborts loading of the currnet page.
- *
- * @return the platform-defined result code for the "Stop" method invocation
- */
- public void Stop() {
- // dispid=106, type=METHOD, name="Stop"
- int[] rgdispid = oleAutomation.getIDsOfNames(new String[]{"Stop"});
- int dispIdMember = rgdispid[0];
-
- Variant pVarResult = oleAutomation.invoke(dispIdMember);
- }
-}
diff --git a/examples/org.eclipse.swt.examples.ole.win32/plugin.properties b/examples/org.eclipse.swt.examples.ole.win32/plugin.properties
deleted file mode 100755
index b28c799ff5..0000000000
--- a/examples/org.eclipse.swt.examples.ole.win32/plugin.properties
+++ /dev/null
@@ -1,52 +0,0 @@
-plugin.SWTOLEExample.name = SWT OLE Example Plugin (Win32)
-category.SWTExamples.name = SWT Examples
-view.OLEWebBrowserExample.name = OLE Web Browser (Win32)
-
-launchcategory.SWTWin32OnlyExamples.name = Win32 only
-launchcategory.SWTWin32OnlyExamples.description = \
- A collection of Standard Widget Toolkit examples for Windows systems only.
-
-launchitem.OLEWebBrowserExample.name = OLE Web Browser
-launchitem.OLEWebBrowserExample.description = \
- This example demonstrates how to embed Active X / OLE controls into an SWT \
- application or an Eclipse view.\n\n\
- When the view is activated, it will create an instance of a Windows "Shell.Explorer" \
- control and provide a GUI interface to it via OLE Automation. The OLE Web Browser has \
- Back and Forward buttons to take you to recently visited pages. The browser also contains \
- a Home button to take you to the web browser's home page, a Stop button which stops the \
- current transfer, a Search button which will search for text typed in the Address text field, and \
- a Refresh button which re-draws the contents of the currently displayed page. There is also a \
- Go button which, when clicked, will attempt to load the page specified in the Address field. \
- One would expect each of these operations on every web browser.\n\n\
- To run this example, Internet Explorer must be installed.
-
-browser.Back.text = Backward
-browser.Back.tooltip = Surf to previously viewed Web site
-
-browser.Forward.text = Forward
-browser.Forward.tooltip = Surf to next viewed Web site
-
-browser.Home.text = Home
-browser.Home.tooltip = Surf to home Web site
-
-browser.Stop.text = Stop
-browser.Stop.tooltip = Stop loading current Web site
-
-browser.Refresh.text = Refresh
-browser.Refresh.tooltip = Refresh current Web site
-
-browser.Search.text = Search
-browser.Search.tooltip = Search the Web
-
-browser.Address.label = Address :
-
-browser.Go.text = Go
-
-browser.State.Uninitialized.text = Not ready.
-browser.State.Loading.text = Loading Web site...
-browser.State.Loaded.text = Ready.
-browser.State.Interactive.text = Loading Web site...
-browser.State.Complete.text = Done.
-
-error.CouldNotLoadResources = Unable to load resources
-error.CouldNotCreateBrowserControl = Unable to create <<Browser Control>>
diff --git a/examples/org.eclipse.swt.examples.ole.win32/plugin.xml b/examples/org.eclipse.swt.examples.ole.win32/plugin.xml
deleted file mode 100755
index b91876cadd..0000000000
--- a/examples/org.eclipse.swt.examples.ole.win32/plugin.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- File written by PDE 1.0 -->
-<plugin
- id="org.eclipse.swt.examples.ole.win32"
- name="%plugin.SWTOLEExample.name"
- version="2.0"
- provider-name="Object Technology International, Inc."
- class="org.eclipse.swt.examples.ole.win32.OlePlugin">
-<!-- Required plugins -->
-<requires>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.swt"/>
-</requires>
-
-<!-- Runtime -->
-<!-- Runtime -->
-<runtime>
- <library name="olewin32.jar"/>
-</runtime>
-
-<!-- Extensions -->
-<!-- Extension points -->
-<extension
- point="org.eclipse.ui.views">
- <view
- name="%view.OLEWebBrowserExample.name"
- icon="icons/webbrowser_example.gif"
- category="org.eclipse.swt.examples.category"
- class="org.eclipse.swt.examples.ole.win32.OleBrowserView"
- id="org.eclipse.swt.examples.ole.win32.browserView">
- </view>
-</extension>
-<extension
- point="org.eclipse.swt.examples.launcher.launchItems">
- <category
- name="%launchcategory.SWTWin32OnlyExamples.name"
- description="%launchcategory.SWTWin32OnlyExamples.description"
- id="org.eclipse.swt.examples.launchWin32OnlyCategory">
- </category>
- <item
- name="%launchitem.OLEWebBrowserExample.name"
- icon="icons/webbrowser_example.gif"
- description="%launchitem.OLEWebBrowserExample.description"
- category="org.eclipse.swt.examples.launchWin32OnlyCategory"
- id="org.eclipse.swt.examples.ole.win32.viewlauncher">
- <view
- viewId="org.eclipse.swt.examples.ole.win32.browserView">
- </view>
- <source
- zip="olewin32src.zip">
- </source>
- </item>
-</extension>
-</plugin>
diff --git a/examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OleBrowserView.java b/examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OleBrowserView.java
deleted file mode 100755
index 2d2c94fac2..0000000000
--- a/examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OleBrowserView.java
+++ /dev/null
@@ -1,354 +0,0 @@
-package org.eclipse.swt.examples.ole.win32;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.*; import org.eclipse.swt.events.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.ole.win32.*; import org.eclipse.swt.widgets.*; import org.eclipse.ui.part.*;
-
-/**
- * Ole uses <code>org.eclipse.swt</code> to demonstrate Win32 OLE / ActiveX
- * integration.
- *
- * @see ViewPart
- */
-public class OleBrowserView extends ViewPart {
-
- private Composite displayArea;
-
- private OleFrame webFrame;
- private OleWebBrowser webBrowser;
- private Text webUrl;
- private OleControlSite webControlSite;
- private ProgressBar webProgress;
- private Label webStatus;
- private Button webNavigateButton;
-
- private ToolItem webCommandBackward;
- private ToolItem webCommandForward;
- private ToolItem webCommandHome;
- private ToolItem webCommandStop;
- private ToolItem webCommandRefresh;
- private ToolItem webCommandSearch;
-
- private boolean activated = false;
-
- /**
- * Constructs the OLE browser view.
- */
- public OleBrowserView() {
- OlePlugin.initResources();
- }
-
- /**
- * Creates the example.
- *
- * @see ViewPart#createPartControl
- */
- public void createPartControl(Composite parent) {
- displayArea = new Composite(parent, SWT.NONE);
-
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 3;
- displayArea.setLayout(gridLayout);
-
- createToolbar();
- createBrowserFrame();
- createStatusArea();
- createBrowserControl();
- }
-
- /**
- * Cleanup
- */
- public void dispose() {
- if (activated) {
- webControlSite.deactivateInPlaceClient();
- activated = false;
- }
- if (webBrowser != null) webBrowser.dispose();
- webBrowser = null;
- super.dispose();
- }
-
- /**
- * Called when we must grab focus.
- *
- * @see org.eclipse.ui.part.ViewPart#setFocus
- */
- public void setFocus() {
- webUrl.setFocus();
- }
-
- /**
- * Creates the Web browser toolbar.
- */
- private void createToolbar() {
- // Add a toolbar
- ToolBar bar = new ToolBar(displayArea, SWT.NONE);
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
- gridData.horizontalSpan = 3;
- bar.setLayoutData(gridData);
-
- // Add a button to navigate backwards through previously visited web sites
- webCommandBackward = new ToolItem(bar, SWT.NONE);
- webCommandBackward.setToolTipText(OlePlugin.getResourceString("browser.Back.tooltip"));
- webCommandBackward.setText(OlePlugin.getResourceString("browser.Back.text"));
- webCommandBackward.setImage(OlePlugin.images[OlePlugin.biBack]);
- webCommandBackward.setEnabled(false);
- webCommandBackward.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event e) {
- if (webBrowser == null) return;
- webBrowser.GoBack();
- }
- });
-
- // Add a button to navigate forward through previously visited web sites
- webCommandForward = new ToolItem(bar, SWT.NONE);
- webCommandForward.setToolTipText(OlePlugin.getResourceString("browser.Forward.tooltip"));
- webCommandForward.setText(OlePlugin.getResourceString("browser.Forward.text"));
- webCommandForward.setImage(OlePlugin.images[OlePlugin.biForward]);
- webCommandForward.setEnabled(false);
- webCommandForward.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event e) {
- if (webBrowser == null) return;
- webBrowser.GoForward();
- }
- });
-
- // Add a separator
- new ToolItem(bar, SWT.SEPARATOR);
-
- // Add a button to navigate to the Home page
- webCommandHome = new ToolItem(bar, SWT.NONE);
- webCommandHome.setToolTipText(OlePlugin.getResourceString("browser.Home.tooltip"));
- webCommandHome.setText(OlePlugin.getResourceString("browser.Home.text"));
- webCommandHome.setImage(OlePlugin.images[OlePlugin.biHome]);
- webCommandHome.setEnabled(false);
- webCommandHome.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event e) {
- if (webBrowser == null) return;
- webBrowser.GoHome();
- }
- });
-
- // Add a button to abort web page loading
- webCommandStop = new ToolItem(bar, SWT.NONE);
- webCommandStop.setToolTipText(OlePlugin.getResourceString("browser.Stop.tooltip"));
- webCommandStop.setText(OlePlugin.getResourceString("browser.Stop.text"));
- webCommandStop.setImage(OlePlugin.images[OlePlugin.biStop]);
- webCommandStop.setEnabled(false);
- webCommandStop.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event e) {
- if (webBrowser == null) return;
- webBrowser.Stop();
- }
- });
-
- // Add a button to refresh the current web page
- webCommandRefresh = new ToolItem(bar, SWT.NONE);
- webCommandRefresh.setToolTipText(OlePlugin.getResourceString("browser.Refresh.tooltip"));
- webCommandRefresh.setText(OlePlugin.getResourceString("browser.Refresh.text"));
- webCommandRefresh.setImage(OlePlugin.images[OlePlugin.biRefresh]);
- webCommandRefresh.setEnabled(false);
- webCommandRefresh.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event e) {
- if (webBrowser == null) return;
- webBrowser.Refresh();
- }
- });
-
- // Add a separator
- new ToolItem(bar, SWT.SEPARATOR);
-
- // Add a button to search the web
- webCommandSearch = new ToolItem(bar, SWT.NONE);
- webCommandSearch.setToolTipText(OlePlugin.getResourceString("browser.Search.tooltip"));
- webCommandSearch.setText(OlePlugin.getResourceString("browser.Search.text"));
- webCommandSearch.setImage(OlePlugin.images[OlePlugin.biSearch]);
- webCommandSearch.setEnabled(false);
- webCommandSearch.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event e) {
- if (webBrowser == null) return;
- webBrowser.GoSearch();
- }
- });
-
- // Add a text area for Users to enter a url
- Composite addressBar = new Composite(displayArea, SWT.NONE);
- gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
- gridData.horizontalSpan = 3;
- addressBar.setLayoutData(gridData);
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 3;
- addressBar.setLayout(gridLayout);
-
- Label addressLabel = new Label(addressBar, SWT.NONE);
- gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL);
- addressLabel.setLayoutData(gridData);
- addressLabel.setText(OlePlugin.getResourceString("browser.Address.label"));
- addressLabel.setFont(OlePlugin.browserFont);
-
- webUrl = new Text(addressBar, SWT.SINGLE | SWT.BORDER);
- webUrl.setFont(OlePlugin.browserFont);
- gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
- webUrl.setLayoutData(gridData);
- webUrl.addFocusListener(new FocusAdapter() {
- public void focusGained(FocusEvent e) {
- webNavigateButton.getShell().setDefaultButton(webNavigateButton);
- }
- });
-
- // Add a button to navigate to the web site specified in the Text area defined above
- webNavigateButton = new Button(addressBar, SWT.PUSH);
- gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL);
- webNavigateButton.setLayoutData(gridData);
- webNavigateButton.setText(OlePlugin.getResourceString("browser.Go.text"));
- webNavigateButton.setFont(OlePlugin.browserFont);
- webNavigateButton.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event event) {
- if (webBrowser == null) return;
- webBrowser.Navigate(webUrl.getText());
- }
- });
- }
-
- /**
- * Creates the Web browser OleFrame.
- */
- private void createBrowserFrame() {
- // Every control must have an associated OleFrame:
- webFrame = new OleFrame(displayArea, SWT.NONE);
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
- gridData.horizontalSpan = 3;
- webFrame.setLayoutData(gridData);
- }
-
- /**
- * Creates the Web browser status area.
- */
- private void createStatusArea() {
- // Add a progress bar to display downloading progress information
- webProgress = new ProgressBar(displayArea, SWT.BORDER);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.BEGINNING;
- gridData.verticalAlignment = GridData.FILL;
- webProgress.setLayoutData(gridData);
-
- // Add a label for displaying status messages as they are received from the control
- webStatus = new Label(displayArea, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
- gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
- gridData.horizontalSpan = 2;
- webStatus.setLayoutData(gridData);
- webStatus.setFont(OlePlugin.browserFont);
- }
-
- /**
- * Creates Web browser control.
- */
- private void createBrowserControl() {
- try {
- // Create an Automation object for access to extended capabilities
- webControlSite = new OleControlSite(webFrame, SWT.NONE, "Shell.Explorer");
- OleAutomation oleAutomation = new OleAutomation(webControlSite);
- webBrowser = new OleWebBrowser(oleAutomation);
- } catch (SWTException ex) {
- // Creation may have failed because control is not installed on machine
- Label label = new Label(webFrame, SWT.BORDER);
- OlePlugin.logError(OlePlugin.getResourceString("error.CouldNotCreateBrowserControl"), ex);
- label.setText(OlePlugin.getResourceString("error.CouldNotCreateBrowserControl"));
- return;
- }
-
- // Respond to ProgressChange events by updating the Progress bar
- webControlSite.addEventListener(OleWebBrowser.ProgressChange, new OleListener() {
- public void handleEvent(OleEvent event) {
- Variant progress = event.arguments[0];
- Variant maxProgress = event.arguments[1];
- if (progress == null || maxProgress == null)
- return;
- webProgress.setMaximum(maxProgress.getInt());
- webProgress.setSelection(progress.getInt());
- }
- });
-
- // Respond to StatusTextChange events by updating the Status Text label
- webControlSite.addEventListener(OleWebBrowser.StatusTextChange, new OleListener() {
- public void handleEvent(OleEvent event) {
- Variant statusText = event.arguments[0];
- if (statusText == null) return;
- String text = statusText.getString();
- if (text != null)
- webStatus.setText(text);
- }
- });
-
- // Listen for changes to the ready state and print out the current state
- webControlSite.addPropertyListener(OleWebBrowser.DISPID_READYSTATE, new OleListener() {
- public void handleEvent(OleEvent event) {
- if (event.detail == OLE.PROPERTY_CHANGING) return;
- int state = webBrowser.getReadyState();
- switch (state) {
- case OleWebBrowser.READYSTATE_UNINITIALIZED:
- webStatus.setText(
- OlePlugin.getResourceString("browser.State.Uninitialized.text"));
- webCommandBackward.setEnabled(false);
- webCommandForward.setEnabled(false);
- webCommandHome.setEnabled(false);
- webCommandRefresh.setEnabled(false);
- webCommandStop.setEnabled(false);
- webCommandSearch.setEnabled(false);
- break;
- case OleWebBrowser.READYSTATE_LOADING:
- webStatus.setText(
- OlePlugin.getResourceString("browser.State.Loading.text"));
- webCommandHome.setEnabled(true);
- webCommandRefresh.setEnabled(true);
- webCommandStop.setEnabled(true);
- webCommandSearch.setEnabled(true);
- break;
- case OleWebBrowser.READYSTATE_LOADED:
- webStatus.setText(
- OlePlugin.getResourceString("browser.State.Loaded.text"));
- webCommandStop.setEnabled(true);
- break;
- case OleWebBrowser.READYSTATE_INTERACTIVE:
- webStatus.setText(
- OlePlugin.getResourceString("browser.State.Interactive.text"));
- webCommandStop.setEnabled(true);
- break;
- case OleWebBrowser.READYSTATE_COMPLETE:
- webStatus.setText(
- OlePlugin.getResourceString("browser.State.Complete.text"));
- webCommandStop.setEnabled(false);
- break;
- }
- }
- });
-
- // Listen for changes to the active command states
- webControlSite.addEventListener(OleWebBrowser.CommandStateChange, new OleListener() {
- public void handleEvent(OleEvent event) {
- if (event.type != OleWebBrowser.CommandStateChange) return;
- final int commandID =
- (event.arguments[0] != null) ? event.arguments[0].getInt() : 0;
- final boolean commandEnabled =
- (event.arguments[1] != null) ? event.arguments[1].getBoolean() : false;
-
- switch (commandID) {
- case OleWebBrowser.CSC_NAVIGATEBACK:
- webCommandBackward.setEnabled(commandEnabled);
- break;
- case OleWebBrowser.CSC_NAVIGATEFORWARD:
- webCommandForward.setEnabled(commandEnabled);
- break;
- }
- }
- });
-
- // in place activate the ActiveX control
- activated = (webControlSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE) == OLE.S_OK);
- if (activated) webBrowser.GoHome();
- }
-}
diff --git a/examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OlePlugin.java b/examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OlePlugin.java
deleted file mode 100755
index 4fee12a0b9..0000000000
--- a/examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OlePlugin.java
+++ /dev/null
@@ -1,170 +0,0 @@
-package org.eclipse.swt.examples.ole.win32;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import java.io.*; import java.net.*; import java.text.*; import java.util.*; import org.eclipse.core.runtime.*; import org.eclipse.swt.*; import org.eclipse.swt.graphics.*; import org.eclipse.ui.plugin.*;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class OlePlugin extends AbstractUIPlugin {
- //The shared instance.
- private static OlePlugin plugin;
- private static ResourceBundle resourceBundle;
-
- static final int
- biBack = 0,
- biForward = 1,
- biHome = 2,
- biStop = 3,
- biRefresh = 4,
- biSearch = 5;
- static final String[] imageLocations = {
- "icons/backward_nav.gif",
- "icons/forward_nav.gif",
- "icons/home_nav.gif",
- "icons/stop_nav.gif",
- "icons/refresh_nav.gif",
- "icons/search_nav.gif" };
- static Image images[];
- static Font browserFont;
-
- /**
- * Constructs an OLE plugin.
- */
- public OlePlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- plugin = this;
- resourceBundle = descriptor.getResourceBundle();
- }
-
- /**
- * Clean up
- */
- public void shutdown() throws CoreException {
- super.shutdown();
- freeResources();
- }
-
- /**
- * Returns the shared instance.
- */
- public static OlePlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns a string from the resource bundle.
- * We don't want to crash because of a missing String.
- * Returns the key if not found.
- */
- public static String getResourceString(String key) {
- try {
- return resourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return key;
- } catch (NullPointerException e) {
- return "!" + key + "!";
- }
- }
-
- /**
- * Returns a string from the resource bundle and binds it
- * with the given arguments. If the key is not found,
- * return the key.
- */
- public static String getResourceString(String key, Object[] args) {
- try {
- return MessageFormat.format(getResourceString(key), args);
- } catch (MissingResourceException e) {
- return key;
- } catch (NullPointerException e) {
- return "!" + key + "!";
- }
- }
-
- /**
- * Log an error to the ILog for this plugin
- *
- * @param message the localized error message text
- * @param exception the associated exception, or null
- */
- public static void logError(String message, Throwable exception) {
- plugin.getLog().log(new Status(IStatus.ERROR, plugin.getDescriptor().getUniqueIdentifier(),
- 0, message, exception));
- }
-
- /**
- * Loads the resources.
- */
- public static void initResources() {
- if (images == null) {
- images = new Image[imageLocations.length];
-
- for (int i = 0; i < imageLocations.length; ++i) {
- images[i] = getImageFromPlugin(plugin.getDescriptor(), imageLocations[i]);
- if (images[i] == null) {
- freeResources();
- logError(getResourceString("error.CouldNotLoadResources"), null);
- throw new IllegalStateException();
- }
- }
- }
- if (browserFont == null) {
- try {
- browserFont = new Font (null, "MS Sans Serif", 8, SWT.NULL);
- } catch (Throwable ex) {
- }
- }
- if (images == null || browserFont == null) {
- freeResources();
- logError(getResourceString("error.CouldNotLoadResources"), null);
- throw new IllegalStateException();
- }
- }
-
- /**
- * Frees the resources
- */
- public static 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;
- }
- if (browserFont != null) browserFont.dispose ();
- browserFont = null;
- }
-
- /**
- * Gets an image from a path relative to the plugin install directory.
- *
- * @param pd the plugin descriptor for the plugin with the image
- * @param iconPath the path relative to the install directory
- * @return the image, or null if not found
- */
- private static Image getImageFromPlugin(IPluginDescriptor pd, String iconPath) {
- InputStream is = null;
- try {
- URL installUrl = pd.getInstallURL();
- URL url = new URL(installUrl, iconPath);
- is = url.openConnection().getInputStream();
- ImageData source = new ImageData(is);
- ImageData mask = source.getTransparencyMask();
- Image image = new Image(null, source, mask);
- return image;
- } catch (Throwable ex) {
- return null;
- } finally {
- try {
- if (is != null) is.close();
- } catch (IOException e) {
- }
- }
- }
-}
diff --git a/examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OleWebBrowser.java b/examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OleWebBrowser.java
deleted file mode 100755
index 555cfb935e..0000000000
--- a/examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OleWebBrowser.java
+++ /dev/null
@@ -1,251 +0,0 @@
-package org.eclipse.swt.examples.ole.win32;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.ole.win32.*;
-
-/**
- * Wrapper for an OleAutomation object used to send commands
- * to a Win32 "Shell.Explorer" OLE control.
- *
- * Instances of this class manage the setup, typical use and teardown of
- * a simple web browser.
- */
-class OleWebBrowser {
- /* See the Windows Platform SDK documentation for more information about the
- * OLE control used here and its usage.
- */
- // Generated from typelib filename: shdocvw.dll
-
- // Constants for WebBrowser CommandStateChange
- public static final int CSC_UPDATECOMMANDS = -1;
- public static final int CSC_NAVIGATEFORWARD = 1;
- public static final int CSC_NAVIGATEBACK = 2;
-
- // COnstants for Web Browser ReadyState
- public static final int READYSTATE_UNINITIALIZED = 0;
- public static final int READYSTATE_LOADING = 1;
- public static final int READYSTATE_LOADED = 2;
- public static final int READYSTATE_INTERACTIVE = 3;
- public static final int READYSTATE_COMPLETE = 4;
-
- // Web Browser Control Events
- public static final int BeforeNavigate = 100; // Fired when a new hyperlink is being navigated to.
- public static final int NavigateComplete = 101; // Fired when the document being navigated to becomes visible and enters the navigation stack.
- public static final int StatusTextChange = 102; // Statusbar text changed.
- public static final int ProgressChange = 108; // Fired when download progress is updated.
- public static final int DownloadComplete = 104; // Download of page complete.
- public static final int CommandStateChange = 105; // The enabled state of a command changed
- public static final int DownloadBegin = 106; // Download of a page started.
- public static final int NewWindow = 107; // Fired when a new window should be created.
- public static final int TitleChange = 113; // Document title changed.
- public static final int FrameBeforeNavigate = 200; // Fired when a new hyperlink is being navigated to in a frame.
- public static final int FrameNavigateComplete = 201; // Fired when a new hyperlink is being navigated to in a frame.
- public static final int FrameNewWindow = 204; // Fired when a new window should be created.
- public static final int Quit = 103; // Fired when application is quiting.
- public static final int WindowMove = 109; // Fired when window has been moved.
- public static final int WindowResize = 110; // Fired when window has been sized.
- public static final int WindowActivate = 111; // Fired when window has been activated.
- public static final int PropertyChange = 112; // Fired when the PutProperty method has been called.
-
- // Web Browser properties
- public static final int DISPID_READYSTATE = -525;
-
- private OleAutomation oleAutomation;
-
- /**
- * Creates a Web browser control.
- * <p>
- * Typical use:<br>
- * <code>
- * OleControlSite oleControlSite = new OleControlSite(oleFrame, style, "Shell.Explorer");<br>
- * OleAutomation oleAutomation = new OleAutomation(oleControlSite);<br>
- * OleWebBrowser webBrowser = new OleWebBrowser(oleControlSite, oleAutomation);<br>
- * </code>
- *
- * @param oleAutomation the OleAutomation object for this control.
- * @param oleControlSite the OleControlSite object for this control.
- */
- public OleWebBrowser(OleAutomation oleAutomation) {
- this.oleAutomation = oleAutomation;
- }
-
-
- /**
- * Disposes of the Web browser control.
- */
- public void dispose() {
- if (oleAutomation != null) oleAutomation.dispose();
- oleAutomation = null;
- }
-
- /*
- * Interact with the Control via OLE Automation
- *
- * Note: You can hard code the DISPIDs if you know them beforehand
- * this is of course the fastest way, but you increase coupling
- * to the control.
- */
-
- /**
- * Returns the current web page title.
- *
- * @return the current web page title String
- */
- public String getLocationName() {
- // dispid=210, type=PROPGET, name="LocationName"
- int[] rgdispid = oleAutomation.getIDsOfNames(new String[]{"LocationName"});
- int dispIdMember = rgdispid[0];
- Variant pVarResult = oleAutomation.getProperty(dispIdMember);
- if (pVarResult == null) return null;
- return pVarResult.getString();
- }
-
- /**
- * Returns the current URL.
- *
- * @return the current URL String
- */
- public String getLocationURL() {
- // dispid=211, type=PROPGET, name="LocationURL"
- int[] rgdispid = oleAutomation.getIDsOfNames(new String[]{"LocationURL"});
- int dispIdMember = rgdispid[0];
-
- Variant pVarResult = oleAutomation.getProperty(dispIdMember);
- if (pVarResult == null) return null;
- return pVarResult.getString();
- }
-
- /**
- * Returns the current state of the control.
- *
- * @return the current state of the control, one of:
- * READYSTATE_UNINITIALIZED;
- * READYSTATE_LOADING;
- * READYSTATE_LOADED;
- * READYSTATE_INTERACTIVE;
- * READYSTATE_COMPLETE.
- */
- public int getReadyState() {
- // dispid=4294966771, type=PROPGET, name="ReadyState"
- int[] rgdispid = oleAutomation.getIDsOfNames(new String[]{"ReadyState"});
- int dispIdMember = rgdispid[0];
-
- Variant pVarResult = oleAutomation.getProperty(dispIdMember);
- if (pVarResult == null) return -1;
- return pVarResult.getInt();
- }
-
- /**
- * Navigates backwards through previously visited web sites.
- *
- * @return the platform-defined result code for the "GoBack" method invocation
- */
- public int GoBack() {
-
- // dispid=100, type=METHOD, name="GoBack"
- int[] rgdispid = oleAutomation.getIDsOfNames(new String[]{"GoBack"});
- int dispIdMember = rgdispid[0];
-
- Variant pVarResult = oleAutomation.invoke(dispIdMember);
- if (pVarResult == null) return 0;
- return pVarResult.getInt();
- }
-
- /**
- * Navigates backwards through previously visited web sites.
- *
- * @return the platform-defined result code for the "GoForward" method invocation
- */
- public int GoForward() {
-
- // dispid=101, type=METHOD, name="GoForward"
- int[] rgdispid = oleAutomation.getIDsOfNames(new String[]{"GoForward"});
- int dispIdMember = rgdispid[0];
-
- Variant pVarResult = oleAutomation.invoke(dispIdMember);
- if (pVarResult == null) return 0;
- return pVarResult.getInt();
- }
-
- /**
- * Navigates to home page.
- *
- * @return the platform-defined result code for the "GoHome" method invocation
- */
- public int GoHome() {
- // dispid=102, type=METHOD, name="GoHome"
- int[] rgdispid = oleAutomation.getIDsOfNames(new String[]{"GoHome"});
- int dispIdMember = rgdispid[0];
-
- Variant pVarResult = oleAutomation.invoke(dispIdMember);
- if (pVarResult == null) return 0;
- return pVarResult.getInt();
- }
-
- /**
- * Navigates to user-specified Web search gateway.
- *
- * @return the platform-defined result code for the "GoSearch" method invocation
- */
- public int GoSearch() {
- // dispid=103, type=METHOD, name="GoSearch"
- int[] rgdispid = oleAutomation.getIDsOfNames(new String[]{"GoSearch"});
- int dispIdMember = rgdispid[0];
-
- Variant pVarResult = oleAutomation.invoke(dispIdMember);
- if (pVarResult == null) return 0;
- return pVarResult.getInt();
- }
-
- /**
- * Navigates to a particular URL.
- *
- * @return the platform-defined result code for the "Navigate" method invocation
- */
- public int Navigate(String url) {
- // dispid=104, type=METHOD, name="Navigate"
- int[] rgdispid = oleAutomation.getIDsOfNames(new String[]{"Navigate", "URL"});
- int dispIdMember = rgdispid[0];
-
- Variant[] rgvarg = new Variant[1];
- rgvarg[0] = new Variant(url);
- int[] rgdispidNamedArgs = new int[1];
- rgdispidNamedArgs[0] = rgdispid[1]; // identifier of argument
- Variant pVarResult = oleAutomation.invoke(dispIdMember, rgvarg, rgdispidNamedArgs);
-
- if (pVarResult == null) return 0;
- return pVarResult.getInt();
- }
-
- /**
- * Refreshes the currently viewed page.
- *
- * @return the platform-defined result code for the "Refresh" method invocation
- */
- public void Refresh(){
- // dispid= 4294966746, type=METHOD, name="Refresh"
- int[] rgdispid = oleAutomation.getIDsOfNames(new String[]{"Refresh"});
- int dispIdMember = rgdispid[0];
-
- oleAutomation.invokeNoReply(dispIdMember);
- }
-
- /**
- * Aborts loading of the currnet page.
- *
- * @return the platform-defined result code for the "Stop" method invocation
- */
- public void Stop() {
- // dispid=106, type=METHOD, name="Stop"
- int[] rgdispid = oleAutomation.getIDsOfNames(new String[]{"Stop"});
- int dispIdMember = rgdispid[0];
-
- Variant pVarResult = oleAutomation.invoke(dispIdMember);
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/.classpath b/examples/org.eclipse.swt.examples.paint/.classpath
deleted file mode 100755
index 573ea74d8c..0000000000
--- a/examples/org.eclipse.swt.examples.paint/.classpath
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path=""/>
- <classpathentry kind="var" path="JRE_LIB"/>
- <classpathentry kind="src" path="/org.eclipse.swt"/>
- <classpathentry kind="var"
- path="ECLIPSE_HOME/plugins/org.eclipse.core.runtime/runtime.jar" sourcepath="ECLIPSE_HOME/plugins/org.eclipse.core.runtime/runtimesrc.zip"/>
- <classpathentry kind="var"
- path="ECLIPSE_HOME/plugins/org.eclipse.ui/workbench.jar" sourcepath="ECLIPSE_HOME/plugins/org.eclipse.ui/workbenchsrc.zip"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/examples/org.eclipse.swt.examples.paint/.cvsignore b/examples/org.eclipse.swt.examples.paint/.cvsignore
deleted file mode 100755
index c5e82d7458..0000000000
--- a/examples/org.eclipse.swt.examples.paint/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin \ No newline at end of file
diff --git a/examples/org.eclipse.swt.examples.paint/.vcm_meta b/examples/org.eclipse.swt.examples.paint/.vcm_meta
deleted file mode 100755
index d64b057431..0000000000
--- a/examples/org.eclipse.swt.examples.paint/.vcm_meta
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project-description>
- <comment></comment>
- <nature id="org.eclipse.jdt.core.javanature"/>
- <nature id="org.eclipse.pde.PluginNature"/>
- <reference project-name="org.eclipse.swt"/>
- <builder name="org.eclipse.jdt.core.javabuilder">
- </builder>
- <builder name="org.eclipse.pde.ManifestBuilder">
- </builder>
- <builder name="org.eclipse.pde.SchemaBuilder">
- </builder>
-</project-description>
diff --git a/examples/org.eclipse.swt.examples.paint/build.properties b/examples/org.eclipse.swt.examples.paint/build.properties
deleted file mode 100755
index c958b7dd5b..0000000000
--- a/examples/org.eclipse.swt.examples.paint/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-bin.includes = doc-html/,\
- icons/,\
- plugin.properties,\
- plugin.xml
-source.paint.jar = org/,import.properties
diff --git a/examples/org.eclipse.swt.examples.paint/doc-html/hglegal.htm b/examples/org.eclipse.swt.examples.paint/doc-html/hglegal.htm
deleted file mode 100755
index b071dbdf45..0000000000
--- a/examples/org.eclipse.swt.examples.paint/doc-html/hglegal.htm
+++ /dev/null
@@ -1,14 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="GENERATOR" content="Mozilla/4.73 [en] (Win98; U) [Netscape]">
- <title>Legal Notices</title>
-</head>
-<body>
-
-<h3>
-<a NAME="Notices"></a>Notices</h3>
-(c) Copyright IBM Corp. 2000, 2001. All Rights Reserved.
-</body>
-</html>
diff --git a/examples/org.eclipse.swt.examples.paint/doc-html/ngibmcpy.gif b/examples/org.eclipse.swt.examples.paint/doc-html/ngibmcpy.gif
deleted file mode 100755
index 360f8e9989..0000000000
--- a/examples/org.eclipse.swt.examples.paint/doc-html/ngibmcpy.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.paint/doc-html/swt_paint_ex.html b/examples/org.eclipse.swt.examples.paint/doc-html/swt_paint_ex.html
deleted file mode 100755
index 458c380093..0000000000
--- a/examples/org.eclipse.swt.examples.paint/doc-html/swt_paint_ex.html
+++ /dev/null
@@ -1,37 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>SWT - Paint Example</title>
-</head>
-<body>
-
-<h2>Example - Paint Example</h2>
-
-<h3>Introduction</h3>
-<p>This example demonstrates the use of SWT graphics operations in the form
-of a rudimentary bitmap painting program.&nbsp; The Airbrush Tool implementation also
-demonstrates a mechanism for managing timed GUI operations in the background
-that are triggered by user input (see ContinuousPaintSession.java).
-</p>
-
-<h3>Running the example</h3>
-<p>To run the Paint Example, pull down the Perspective menu, select the Show
-View menu item, then select Other from the submenu.&nbsp; A dialog will
-come up with a list of views.&nbsp; Expand SWT Examples and select the
-view named Paint.&nbsp; A view containing a drawing area, various toolbar
-buttons, and a color selection palette will appear.
-</p>
-
-<h3>Details</h3>
-<p>Select a tool with which to draw in the drawing area.&nbsp; There are a
-number of tools to choose from on the toolbar.&nbsp; To change the color selection,
-click on a color in the palette below the drawing area:
-left-click for the foreground color, right-click for the background color.
-</p>
-<p>Uses SWT's GC and FontDialog, and JFace's InputDialog and action set support.
-</p>
-
-<p><a href="hglegal.htm"><img SRC="ngibmcpy.gif" ALT="Copyright IBM Corporation 2000, 2001. All Rights Reserved." BORDER=0 height=12 width=195></a></p>
-</body>
-</html>
diff --git a/examples/org.eclipse.swt.examples.paint/icons/fill_none.gif b/examples/org.eclipse.swt.examples.paint/icons/fill_none.gif
deleted file mode 100755
index d26dd584e7..0000000000
--- a/examples/org.eclipse.swt.examples.paint/icons/fill_none.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.paint/icons/fill_outline.gif b/examples/org.eclipse.swt.examples.paint/icons/fill_outline.gif
deleted file mode 100755
index c6ccfee10e..0000000000
--- a/examples/org.eclipse.swt.examples.paint/icons/fill_outline.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.paint/icons/fill_solid.gif b/examples/org.eclipse.swt.examples.paint/icons/fill_solid.gif
deleted file mode 100755
index cb34e64a30..0000000000
--- a/examples/org.eclipse.swt.examples.paint/icons/fill_solid.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.paint/icons/linestyle_dash.gif b/examples/org.eclipse.swt.examples.paint/icons/linestyle_dash.gif
deleted file mode 100644
index fb57bb38b7..0000000000
--- a/examples/org.eclipse.swt.examples.paint/icons/linestyle_dash.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.paint/icons/linestyle_dashdot.gif b/examples/org.eclipse.swt.examples.paint/icons/linestyle_dashdot.gif
deleted file mode 100644
index 322968c30b..0000000000
--- a/examples/org.eclipse.swt.examples.paint/icons/linestyle_dashdot.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.paint/icons/linestyle_dot.gif b/examples/org.eclipse.swt.examples.paint/icons/linestyle_dot.gif
deleted file mode 100644
index 4937ccb06d..0000000000
--- a/examples/org.eclipse.swt.examples.paint/icons/linestyle_dot.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.paint/icons/linestyle_solid.gif b/examples/org.eclipse.swt.examples.paint/icons/linestyle_solid.gif
deleted file mode 100644
index 70a57ce2c4..0000000000
--- a/examples/org.eclipse.swt.examples.paint/icons/linestyle_solid.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.paint/icons/options_font.gif b/examples/org.eclipse.swt.examples.paint/icons/options_font.gif
deleted file mode 100755
index 965fe08560..0000000000
--- a/examples/org.eclipse.swt.examples.paint/icons/options_font.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.paint/icons/paint_example.gif b/examples/org.eclipse.swt.examples.paint/icons/paint_example.gif
deleted file mode 100755
index c48d9a9567..0000000000
--- a/examples/org.eclipse.swt.examples.paint/icons/paint_example.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.paint/icons/tool_airbrush.gif b/examples/org.eclipse.swt.examples.paint/icons/tool_airbrush.gif
deleted file mode 100755
index a310edddb2..0000000000
--- a/examples/org.eclipse.swt.examples.paint/icons/tool_airbrush.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.paint/icons/tool_ellipse.gif b/examples/org.eclipse.swt.examples.paint/icons/tool_ellipse.gif
deleted file mode 100755
index dc2142f8e2..0000000000
--- a/examples/org.eclipse.swt.examples.paint/icons/tool_ellipse.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.paint/icons/tool_line.gif b/examples/org.eclipse.swt.examples.paint/icons/tool_line.gif
deleted file mode 100755
index 2ff819f129..0000000000
--- a/examples/org.eclipse.swt.examples.paint/icons/tool_line.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.paint/icons/tool_pencil.gif b/examples/org.eclipse.swt.examples.paint/icons/tool_pencil.gif
deleted file mode 100755
index f16a234c13..0000000000
--- a/examples/org.eclipse.swt.examples.paint/icons/tool_pencil.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.paint/icons/tool_polyline.gif b/examples/org.eclipse.swt.examples.paint/icons/tool_polyline.gif
deleted file mode 100755
index aa384e9b30..0000000000
--- a/examples/org.eclipse.swt.examples.paint/icons/tool_polyline.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.paint/icons/tool_rectangle.gif b/examples/org.eclipse.swt.examples.paint/icons/tool_rectangle.gif
deleted file mode 100755
index d26dd584e7..0000000000
--- a/examples/org.eclipse.swt.examples.paint/icons/tool_rectangle.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.paint/icons/tool_roundedrectangle.gif b/examples/org.eclipse.swt.examples.paint/icons/tool_roundedrectangle.gif
deleted file mode 100755
index bf845d7602..0000000000
--- a/examples/org.eclipse.swt.examples.paint/icons/tool_roundedrectangle.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.paint/icons/tool_text.gif b/examples/org.eclipse.swt.examples.paint/icons/tool_text.gif
deleted file mode 100755
index 0d7457ffa3..0000000000
--- a/examples/org.eclipse.swt.examples.paint/icons/tool_text.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.paint/import.properties b/examples/org.eclipse.swt.examples.paint/import.properties
deleted file mode 100755
index 9185f56fc8..0000000000
--- a/examples/org.eclipse.swt.examples.paint/import.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-# 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 = <<ECLIPSE_PLUGINS>>
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/AirbrushTool.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/AirbrushTool.java
deleted file mode 100755
index 8eeabb9920..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/AirbrushTool.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import java.util.Random; import org.eclipse.swt.graphics.*;
-
-/**
- * An airbrush tool.
- */
-public class AirbrushTool extends ContinuousPaintSession implements PaintTool {
- private ToolSettings settings;
- private Random random;
- private int cachedRadiusSquared;
- private int cachedNumPoints;
-
- /**
- * Constructs a Tool.
- *
- * @param toolSettings the new tool settings
- * @param paintSurface the PaintSurface we will render on.
- */
- public AirbrushTool(ToolSettings toolSettings, PaintSurface paintSurface) {
- super(paintSurface);
- random = new Random();
- setRetriggerTimer(10);
- set(toolSettings);
- }
-
- /**
- * Sets the tool's settings.
- *
- * @param toolSettings the new tool settings
- */
- public void set(ToolSettings toolSettings) {
- // compute things we need to know for drawing
- settings = toolSettings;
- cachedRadiusSquared = settings.airbrushRadius * settings.airbrushRadius;
- cachedNumPoints = 314 * settings.airbrushIntensity * cachedRadiusSquared / 250000;
- if (cachedNumPoints == 0 && settings.airbrushIntensity != 0)
- cachedNumPoints = 1;
- }
-
- /**
- * Returns the name associated with this tool.
- *
- * @return the localized name of this tool
- */
- public String getDisplayName() {
- return PaintPlugin.getResourceString("tool.Airbrush.label");
- }
-
- /*
- * Template method for drawing
- */
- protected void render(Point point) {
- // Draws a bunch (cachedNumPoints) of random pixels within a specified circle (cachedRadiusSquared).
- ContainerFigure cfig = new ContainerFigure();
-
- for (int i = 0; i < cachedNumPoints; ++i) {
- int randX, randY;
- do {
- randX = (int) ((random.nextDouble() - 0.5) * settings.airbrushRadius * 2.0);
- randY = (int) ((random.nextDouble() - 0.5) * settings.airbrushRadius * 2.0);
- } while (randX * randX + randY * randY > cachedRadiusSquared);
- cfig.add(new PointFigure(settings.commonForegroundColor, point.x + randX, point.y + randY));
- }
- getPaintSurface().drawFigure(cfig);
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/BasicPaintSession.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/BasicPaintSession.java
deleted file mode 100755
index 0af229175a..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/BasicPaintSession.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-public abstract class BasicPaintSession implements PaintSession {
- /** * The paint surface */ private PaintSurface paintSurface; /** * Constructs a PaintSession. * * @param paintSurface the drawing surface to use */ protected BasicPaintSession(PaintSurface paintSurface) { this.paintSurface = paintSurface; } /**
- * Returns the paint surface associated with this paint session. * * @return the associated PaintSurface */ public PaintSurface getPaintSurface() { return paintSurface; } }
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/ContainerFigure.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/ContainerFigure.java
deleted file mode 100755
index 0c2d64996a..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/ContainerFigure.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.graphics.*;
-
-/**
- * Container for Figure objects with stacking preview mechanism.
- */
-public class ContainerFigure extends Figure {
- private static final int INITIAL_ARRAY_SIZE = 16;
-
- Figure[] objectStack = null;
- int nextIndex = 0;
-
- /**
- * Constructs an empty Container
- */
- public ContainerFigure() {
- }
- /**
- * Adds an object to the container for later drawing.
- *
- * @param object the object to add to the drawing list
- */
- public void add(Figure object) {
- if (objectStack == null) {
- objectStack = new Figure[INITIAL_ARRAY_SIZE];
- } else if (objectStack.length <= nextIndex) {
- Figure[] newObjectStack = new Figure[objectStack.length * 2];
- System.arraycopy(objectStack, 0, newObjectStack, 0, objectStack.length);
- objectStack = newObjectStack;
- }
- objectStack[nextIndex] = object;
- ++nextIndex;
- }
- /**
- * Determines if the container is empty.
- * @return true if the container is empty
- */
- public boolean isEmpty() {
- return nextIndex == 0;
- }
- /**
- * Adds an object to the container and draws its preview then updates the supplied preview state.
- *
- * @param object the object to add to the drawing list
- * @param gc the GC to draw on
- * @param offset the offset to add to virtual coordinates to get display coordinates
- * @param rememberedState the state returned by a previous drawPreview() or addAndPreview()
- * using this Container, may be null if there was no such previous call
- * @return object state that must be passed to erasePreview() later to erase this object
- */
-// public Object addAndPreview(Figure object, GC gc, Point offset, Object rememberedState) {
-// Object[] stateStack = (Object[]) rememberedState;
-// if (stateStack == null) {
-// stateStack = new Object[INITIAL_ARRAY_SIZE];
-// } else if (stateStack.length <= nextIndex) {
-// Object[] newStateStack = new Object[stateStack.length * 2];
-// System.arraycopy(stateStack, 0, newStateStack, 0, stateStack.length);
-// stateStack = newStateStack;
-// }
-// add(object);
-// stateStack[nextIndex - 1] = object.drawPreview(gc, offset);
-// return stateStack;
-// }
- /**
- * Clears the container.
- * <p>
- * Note that erasePreview() cannot be called after this point to erase any previous
- * drawPreview()'s.
- * </p>
- */
- public void clear() {
- while (--nextIndex > 0) objectStack[nextIndex] = null;
- nextIndex = 0;
- }
- public void draw(FigureDrawContext fdc) {
- for (int i = 0; i < nextIndex; ++i) objectStack[i].draw(fdc);
- }
- public void addDamagedRegion(FigureDrawContext fdc, Region region) {
- for (int i = 0; i < nextIndex; ++i) objectStack[i].addDamagedRegion(fdc, region);
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/ContinuousPaintSession.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/ContinuousPaintSession.java
deleted file mode 100755
index 22aa5eb1d9..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/ContinuousPaintSession.java
+++ /dev/null
@@ -1,226 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.events.*; import org.eclipse.swt.graphics.*; import org.eclipse.swt.widgets.*;
-
-/**
- * The superclass for paint tools that draw continuously along the path
- * traced by the mouse's movement while the button is depressed
- */
-public abstract class ContinuousPaintSession extends BasicPaintSession {
- /**
- * True if a click-drag is in progress.
- */
- private boolean dragInProgress = false;
-
- /**
- * A cached Point array for drawing.
- */
- private Point[] points = new Point[] { new Point(-1, -1), new Point(-1, -1) };
-
- /**
- * The time to wait between retriggers in milliseconds.
- */
- private int retriggerInterval = 0;
-
- /**
- * The currently valid RetriggerHandler
- */
- protected Runnable retriggerHandler = null;
-
- /**
- * Constructs a ContinuousPaintSession.
- *
- * @param paintSurface the drawing surface to use
- */
- protected ContinuousPaintSession(PaintSurface paintSurface) {
- super(paintSurface);
- }
-
- /**
- * Sets the retrigger timer.
- * <p>
- * After the timer elapses, if the mouse is still hovering over the same point with the
- * drag button pressed, a new render order is issued and the timer is restarted.
- * </p>
- * @param interval the time in milliseconds to wait between retriggers, 0 to disable
- */
- public void setRetriggerTimer(int interval) {
- retriggerInterval = interval;
- }
-
- /**
- * Activates the tool.
- */
- public void beginSession() {
- getPaintSurface().
- setStatusMessage(PaintPlugin.getResourceString("session.ContinuousPaint.message"));
- dragInProgress = false;
- }
-
- /**
- * Deactivates the tool.
- */
- public void endSession() {
- abortRetrigger();
- }
-
- /**
- * Aborts the current operation.
- */
- public void resetSession() {
- abortRetrigger();
- }
-
- /**
- * Handles a mouseDown event.
- *
- * @param event the mouse event detail information
- */
- public final void mouseDown(MouseEvent event) {
- if (event.button != 1) return;
- if (dragInProgress) return; // spurious event
- dragInProgress = true;
-
- points[0].x = event.x;
- points[0].y = event.y;
- render(points[0]);
- prepareRetrigger();
- }
-
- /**
- * Handles a mouseDoubleClick event.
- *
- * @param event the mouse event detail information
- */
- public final void mouseDoubleClick(MouseEvent event) {
- }
-
- /**
- * Handles a mouseUp event.
- *
- * @param event the mouse event detail information
- */
- public final void mouseUp(MouseEvent event) {
- if (event.button != 1) return;
- if (! dragInProgress) return; // spurious event
- abortRetrigger();
- mouseSegmentFinished(event);
- dragInProgress = false;
- }
-
- /**
- * Handles a mouseMove event.
- *
- * @param event the mouse event detail information
- */
- public final void mouseMove(MouseEvent event) {
- final PaintSurface ps = getPaintSurface();
- ps.setStatusCoord(ps.getCurrentPosition());
- if (! dragInProgress) return;
- mouseSegmentFinished(event);
- prepareRetrigger();
- }
-
- /**
- * Handle a rendering segment
- *
- * @param event the mouse event detail information
- */
- private final void mouseSegmentFinished(MouseEvent event) {
- if (points[0].x == -1) return; // spurious event
- if (points[0].x != event.x || points[0].y != event.y) {
- // draw new segment
- points[1].x = event.x;
- points[1].y = event.y;
- renderContinuousSegment();
- }
- }
-
- /**
- * Draws a continuous segment from points[0] to points[1].
- * Assumes points[0] has been drawn already.
- *
- * @post points[0] will refer to the same point as points[1]
- */
- protected void renderContinuousSegment() {
- /* A lazy but effective line drawing algorithm */
- final int dX = points[1].x - points[0].x;
- final int dY = points[1].y - points[0].y;
- int absdX = Math.abs(dX);
- int absdY = Math.abs(dY);
-
- if ((dX == 0) && (dY == 0)) return;
-
- if (absdY > absdX) {
- final int incfpX = (dX << 16) / absdY;
- final int incY = (dY > 0) ? 1 : -1;
- int fpX = points[0].x << 16; // X in fixedpoint format
-
- while (--absdY >= 0) {
- points[0].y += incY;
- points[0].x = (fpX += incfpX) >> 16;
- render(points[0]);
- }
- if (points[0].x == points[1].x) return;
- points[0].x = points[1].x;
- } else {
- final int incfpY = (dY << 16) / absdX;
- final int incX = (dX > 0) ? 1 : -1;
- int fpY = points[0].y << 16; // Y in fixedpoint format
-
- while (--absdX >= 0) {
- points[0].x += incX;
- points[0].y = (fpY += incfpY) >> 16;
- render(points[0]);
- }
- if (points[0].y == points[1].y) return;
- points[0].y = points[1].y;
- }
- render(points[0]);
- }
-
- /**
- * Prepare the retrigger timer
- */
- private final void prepareRetrigger() {
- if (retriggerInterval > 0) {
- /*
- * timerExec() provides a lightweight mechanism for running code at intervals from within
- * the event loop when timing accuracy is not important.
- *
- * Since it is not possible to cancel a timerExec(), we remember the Runnable that is
- * active in order to distinguish the valid one from the stale ones. In practice,
- * if the interval is 1/100th of a second, then creating a few hundred new RetriggerHandlers
- * each second will not cause a significant performance hit.
- */
- Display display = getPaintSurface().getDisplay();
- retriggerHandler = new Runnable() {
- public void run() {
- if (retriggerHandler == this) {
- render(points[0]);
- prepareRetrigger();
- }
- }
- };
- display.timerExec(retriggerInterval, retriggerHandler);
- }
- }
-
- /**
- * Aborts the retrigger timer
- */
- private final void abortRetrigger() {
- retriggerHandler = null;
- }
-
- /**
- * Template method: Renders a point.
- * @param point, the point to render
- */
- protected abstract void render(Point point);
-}
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/DragPaintSession.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/DragPaintSession.java
deleted file mode 100755
index 78b9fe6bd7..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/DragPaintSession.java
+++ /dev/null
@@ -1,129 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.graphics.*;
-
-/**
- * The superclass for paint tools that use click-drag-release motions to
- * draw objects.
- */
-public abstract class DragPaintSession extends BasicPaintSession {
- /**
- * True if a click-drag is in progress
- */
- private boolean dragInProgress = false;
-
- /**
- * The position of the first click in a click-drag
- */
- private Point anchorPosition = new Point(-1, -1);
-
- /**
- * A temporary point
- */
- private Point tempPosition = new Point(-1, -1);
-
- /**
- * Constructs a PaintSession.
- *
- * @param getPaintSurface() the drawing surface to use
- */
- protected DragPaintSession(PaintSurface paintSurface) {
- super(paintSurface);
- }
-
- /**
- * Activates the tool.
- */
- public void beginSession() {
- getPaintSurface().
- setStatusMessage(PaintPlugin.getResourceString("session.DragInteractivePaint.message"));
- anchorPosition.x = -1;
- dragInProgress = false;
- }
-
- /**
- * Deactivates the tool.
- */
- public void endSession() {
- }
-
- /**
- * Resets the tool.
- * Aborts any operation in progress.
- */
- public void resetSession() {
- getPaintSurface().clearRubberbandSelection();
- anchorPosition.x = -1;
- dragInProgress = false;
- }
-
- /**
- * Handles a mouseDown event.
- *
- * @param event the mouse event detail information
- */
- public void mouseDown(MouseEvent event) {
- if (event.button != 1) return;
- if (dragInProgress) return; // spurious event
- dragInProgress = true;
-
- anchorPosition.x = event.x;
- anchorPosition.y = event.y;
- }
-
- /**
- * Handles a mouseDoubleClick event.
- *
- * @param event the mouse event detail information
- */
- public void mouseDoubleClick(MouseEvent event) {
- }
-
- /**
- * Handles a mouseUp event.
- *
- * @param event the mouse event detail information
- */
- public void mouseUp(MouseEvent event) {
- if (event.button != 1) {
- resetSession(); // abort if right or middle mouse button pressed
- return;
- }
- if (! dragInProgress) return; // spurious event
- dragInProgress = false;
- if (anchorPosition.x == -1) return; // spurious event
-
- getPaintSurface().commitRubberbandSelection();
- }
-
- /**
- * Handles a mouseMove event.
- *
- * @param event the mouse event detail information
- */
- public void mouseMove(MouseEvent event) {
- final PaintSurface ps = getPaintSurface();
- if (! dragInProgress) {
- ps.setStatusCoord(ps.getCurrentPosition());
- return;
- }
- ps.setStatusCoordRange(anchorPosition, ps.getCurrentPosition());
- ps.clearRubberbandSelection();
- tempPosition.x = event.x;
- tempPosition.y = event.y;
- ps.addRubberbandSelection(createFigure(anchorPosition, tempPosition));
- }
-
- /**
- * Template Method: Creates a Figure for drawing rubberband entities and the final product
- *
- * @param anchor the anchor point
- * @param cursor the point marking the current pointer location
- */
- protected abstract Figure createFigure(Point anchor, Point cursor);
-}
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/EllipseFigure.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/EllipseFigure.java
deleted file mode 100755
index 0fcd6ae284..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/EllipseFigure.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-
-/**
- * 2D Ellipse object
- */
-public class EllipseFigure extends Figure {
- private Color foregroundColor, backgroundColor;
- private int lineStyle, x1, y1, x2, y2;
- /**
- * Constructs an Ellipse
- * These objects are defined by any two diametrically opposing corners of a box
- * bounding the ellipse.
- *
- * @param color the color for this object
- * @param lineStyle the line style for this object
- * @param x1 the virtual X coordinate of the first corner
- * @param y1 the virtual Y coordinate of the first corner
- * @param x2 the virtual X coordinate of the second corner
- * @param y2 the virtual Y coordinate of the second corner
- */
- public EllipseFigure(Color foregroundColor, Color backgroundColor, int lineStyle, int x1, int y1, int x2, int y2) {
- this.foregroundColor = foregroundColor;
- this.backgroundColor = backgroundColor;
- this.lineStyle = lineStyle;
- this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2;
- }
- public void draw(FigureDrawContext fdc) {
- Rectangle r = fdc.toClientRectangle(x1, y1, x2, y2);
- fdc.gc.setForeground(foregroundColor);
- fdc.gc.setBackground(backgroundColor);
- fdc.gc.setLineStyle(lineStyle);
- fdc.gc.drawOval(r.x, r.y, r.width - 1, r.height - 1);
- fdc.gc.setLineStyle(SWT.LINE_SOLID);
- }
- public void addDamagedRegion(FigureDrawContext fdc, Region region) {
- region.add(fdc.toClientRectangle(x1, y1, x2, y2));
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/EllipseTool.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/EllipseTool.java
deleted file mode 100755
index ced0b873b8..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/EllipseTool.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.graphics.*;
-
-/**
- * A drawing tool.
- */
-public class EllipseTool extends DragPaintSession implements PaintTool {
- private ToolSettings settings;
-
- /**
- * Constructs a EllipseTool.
- *
- * @param toolSettings the new tool settings
- * @param paintSurface the PaintSurface we will render on.
- */
- public EllipseTool(ToolSettings toolSettings, PaintSurface paintSurface) {
- super(paintSurface);
- set(toolSettings);
- }
-
- /**
- * Sets the tool's settings.
- *
- * @param toolSettings the new tool settings
- */
- public void set(ToolSettings toolSettings) {
- settings = toolSettings;
- }
-
- /**
- * Returns name associated with this tool.
- *
- * @return the localized name of this tool
- */
- public String getDisplayName() {
- return PaintPlugin.getResourceString("tool.Ellipse.label");
- }
-
- /*
- * Template methods for drawing
- */
- protected Figure createFigure(Point a, Point b) {
- ContainerFigure container = new ContainerFigure();
- if (settings.commonFillType != ToolSettings.ftNone)
- container.add(new SolidEllipseFigure(settings.commonBackgroundColor, a.x, a.y, b.x, b.y));
- if (settings.commonFillType != ToolSettings.ftSolid)
- container.add(new EllipseFigure(settings.commonForegroundColor, settings.commonBackgroundColor, settings.commonLineStyle,
- a.x, a.y, b.x, b.y));
- return container;
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/Figure.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/Figure.java
deleted file mode 100755
index 9a57aa5aa8..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/Figure.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.graphics.*;
-
-/**
- * Superinterface for all drawing objects.
- * All drawing objects know how to render themselved to the screen and can draw a
- * temporary version of themselves for previewing the general appearance of the
- * object onscreen before it gets committed.
- */
-public abstract class Figure {
- /**
- * Draws this object.
- *
- * @param fdc a parameter block specifying drawing-related information
- */
- public abstract void draw(FigureDrawContext fdc);
-
- /**
- * Computes the damaged screen region caused by drawing this object (imprecise), then
- * appends it to the supplied region.
- *
- * @param fdc a parameter block specifying drawing-related information
- * @param region a region to which additional damage areas will be added
- */
- public abstract void addDamagedRegion(FigureDrawContext fdc, Region region);
-}
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/FigureDrawContext.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/FigureDrawContext.java
deleted file mode 100644
index eda60d25b8..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/FigureDrawContext.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.graphics.*;
-
-public class FigureDrawContext {
- /*
- * <p>
- * The GC must be set up as follows
- * (it will be returned to this state upon completion of drawing operations)
- * <ul>
- * <li>setXORMode(false)
- * </ul>
- * </p>
- */
- public GC gc = null;
- public int xOffset = 0, yOffset = 0; // substract to get GC coords
- public int xScale = 1, yScale = 1;
-
- public Rectangle toClientRectangle(int x1, int y1, int x2, int y2) {
- return new Rectangle(
- Math.min(x1, x2) * xScale - xOffset,
- Math.min(y1, y2) * yScale - yOffset,
- (Math.abs(x2 - x1) + 1) * xScale,
- (Math.abs(y2 - y1) + 1) * yScale);
- }
- public Point toClientPoint(int x, int y) {
- return new Point(x * xScale - xOffset, y * yScale - yOffset);
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/LineFigure.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/LineFigure.java
deleted file mode 100755
index de71910f76..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/LineFigure.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-
-/**
- * 2D Line object
- */
-public class LineFigure extends Figure {
- private Color foregroundColor, backgroundColor;
- private int lineStyle, x1, y1, x2, y2;
- /**
- * Constructs a Line
- * These objects are defined by their two end-points.
- *
- * @param color the color for this object
- * @param lineStyle the line style for this object
- * @param x1 the virtual X coordinate of the first end-point
- * @param y1 the virtual Y coordinate of the first end-point
- * @param x2 the virtual X coordinate of the second end-point
- * @param y2 the virtual Y coordinate of the second end-point
- */
- public LineFigure(Color foregroundColor, Color backgroundColor, int lineStyle, int x1, int y1, int x2, int y2) {
- this.foregroundColor = foregroundColor;
- this.backgroundColor = backgroundColor;
- this.lineStyle = lineStyle;
- this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2;
- }
- public void draw(FigureDrawContext fdc) {
- Point p1 = fdc.toClientPoint(x1, y1);
- Point p2 = fdc.toClientPoint(x2, y2);
- fdc.gc.setForeground(foregroundColor);
- fdc.gc.setBackground(backgroundColor);
- fdc.gc.setLineStyle(lineStyle);
- fdc.gc.drawLine(p1.x, p1.y, p2.x, p2.y);
- fdc.gc.setLineStyle(SWT.LINE_SOLID);
- }
- public void addDamagedRegion(FigureDrawContext fdc, Region region) {
- region.add(fdc.toClientRectangle(x1, y1, x2, y2));
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/LineTool.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/LineTool.java
deleted file mode 100755
index f969d24911..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/LineTool.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.graphics.*;
-
-/**
- * A line drawing tool
- */
-public class LineTool extends DragPaintSession implements PaintTool {
- private ToolSettings settings;
-
- /**
- * Constructs a LineTool.
- *
- * @param toolSettings the new tool settings
- * @param paintSurface the PaintSurface we will render on.
- */
- public LineTool(ToolSettings toolSettings, PaintSurface paintSurface) {
- super(paintSurface);
- set(toolSettings);
- }
-
- /**
- * Sets the tool's settings.
- *
- * @param toolSettings the new tool settings
- */
- public void set(ToolSettings toolSettings) {
- settings = toolSettings;
- }
-
- /**
- * Returns name associated with this tool.
- *
- * @return the localized name of this tool
- */
- public String getDisplayName() {
- return PaintPlugin.getResourceString("tool.Line.label");
- }
-
- /*
- * Template methods for drawing
- */
- protected Figure createFigure(Point a, Point b) {
- return new LineFigure(settings.commonForegroundColor, settings.commonBackgroundColor, settings.commonLineStyle,
- a.x, a.y, b.x, b.y);
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PaintPlugin.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PaintPlugin.java
deleted file mode 100755
index 6e17722f39..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PaintPlugin.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.ui.plugin.*;
-
-import java.text.*;
-import java.util.*;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class PaintPlugin extends AbstractUIPlugin {
- //The shared instance.
- private static PaintPlugin plugin;
- private static ResourceBundle resourceBundle;
-
- /**
- * Constructs the Paint plugin.
- */
- public PaintPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- plugin = this;
- resourceBundle = descriptor.getResourceBundle();
- }
-
- /**
- * Returns the shared instance.
- */
- public static PaintPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Log an error to the ILog for this plugin
- *
- * @param message the localized error message text
- * @param exception the associated exception, or null
- */
- public static void logError(String message, Throwable exception) {
- plugin.getLog().log(new Status(IStatus.ERROR, plugin.getDescriptor().getUniqueIdentifier(),
- 0, message, exception));
- }
-
- /**
- * Returns a string from the resource bundle.
- * We don't want to crash because of a missing String.
- * Returns the key if not found.
- */
- public static String getResourceString(String key) {
- try {
- return resourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return key;
- } catch (NullPointerException e) {
- return "!" + key + "!";
- }
- }
-
- /**
- * Returns a string from the resource bundle and binds it
- * with the given arguments. If the key is not found,
- * return the key.
- */
- public static String getResourceString(String key, Object[] args) {
- try {
- return MessageFormat.format(getResourceString(key), args);
- } catch (MissingResourceException e) {
- return key;
- } catch (NullPointerException e) {
- return "!" + key + "!";
- }
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PaintSession.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PaintSession.java
deleted file mode 100755
index a688ed8d94..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PaintSession.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.events.*;
-
-/**
- * Manages an interactive paint session.
- * Note that the coordinates received via the listener interfaces are virtualized to zero-origin
- * relative to the painting surface.
- */
-public interface PaintSession extends MouseListener, MouseMoveListener {
- /**
- * Returns the paint surface associated with this paint session
- *
- * @return the associated PaintSurface
- */
- public PaintSurface getPaintSurface();
-
- /**
- * Activates the session.
- *
- * Note: When overriding this method, call super.beginSession() at method start.
- */
- public abstract void beginSession();
-
- /**
- * Deactivates the session.
- *
- * Note: When overriding this method, call super.endSession() at method exit.
- */
- public abstract void endSession();
-
- /**
- * Resets the session.
- * Aborts any operation in progress.
- *
- * Note: When overriding this method, call super.resetSession() at method exit.
- */
- public abstract void resetSession();
-
-
- /**
- * Returns the name associated with this tool.
- *
- * @return the localized name of this tool
- */
- public String getDisplayName();
-}
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PaintSurface.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PaintSurface.java
deleted file mode 100755
index 5cd1827e42..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PaintSurface.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.eclipse.swt.examples.paint;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
- import org.eclipse.swt.events.*; import org.eclipse.swt.graphics.*; import org.eclipse.swt.widgets.*;
- /** * Manages a simple drawing surface. */
-public class PaintSurface { private Point currentPosition = new Point(0, 0);
- private Canvas paintCanvas; private PaintSession paintSession; private Image image; private Image paintImage; // buffer for refresh blits private int imageWidth, imageHeight; private int visibleWidth, visibleHeight; private FigureDrawContext displayFDC = new FigureDrawContext(); private FigureDrawContext imageFDC = new FigureDrawContext(); private FigureDrawContext paintFDC = new FigureDrawContext(); /* Rubberband */ private ContainerFigure rubberband = new ContainerFigure(); // the active rubberband selection private int rubberbandHiddenNestingCount = 0; // always >= 0, if > 0 rubberband has been hidden /* Status */ private Text statusText; private String statusActionInfo, statusMessageInfo, statusCoordInfo; /** * Constructs a PaintSurface. * <p> * paintCanvas must have SWT.NO_REDRAW_RESIZE and SWT.NO_BACKGROUND styles, * and may have SWT.V_SCROLL and/or SWT.H_SCROLL. * </p> * @param paintCanvas the Canvas object in which to render * @param paintStatus the PaintStatus object to use for providing user feedback * @param fillColor the color to fill the canvas with initially */
- public PaintSurface(Canvas paintCanvas, Text statusText, Color fillColor) { this.paintCanvas = paintCanvas; this.statusText = statusText; clearStatus(); /* Set up the drawing surface */ Rectangle displayRect = paintCanvas.getDisplay().getClientArea(); imageWidth = displayRect.width; imageHeight = displayRect.height; image = new Image(paintCanvas.getDisplay(), imageWidth, imageHeight); imageFDC.gc = new GC(image); imageFDC.gc.setBackground(fillColor); imageFDC.gc.fillRectangle(0, 0, imageWidth, imageHeight); displayFDC.gc = new GC(paintCanvas); /* Initialize the session */ setPaintSession(null); /* Add our listeners */ paintCanvas.addMouseListener(new MouseAdapter() { public void mouseDown(MouseEvent event) { processMouseEventCoordinates(event); if (paintSession != null) paintSession.mouseDown(event); } public void mouseUp(MouseEvent event) { processMouseEventCoordinates(event); if (paintSession != null) paintSession.mouseUp(event); } public void mouseDoubleClick(MouseEvent event) { processMouseEventCoordinates(event); if (paintSession != null) paintSession.mouseDoubleClick(event); } }); paintCanvas.addMouseMoveListener(new MouseMoveListener() { public void mouseMove(MouseEvent event) { processMouseEventCoordinates(event); if (paintSession != null) paintSession.mouseMove(event); } }); paintCanvas.addPaintListener(new PaintListener() { public void paintControl(PaintEvent event) { if (rubberband.isEmpty()) { // Nothing to merge, so we just refresh event.gc.drawImage(image, displayFDC.xOffset + event.x, displayFDC.yOffset + event.y, event.width, event.height, event.x, event.y, event.width, event.height); } else { /* * Avoid flicker when merging overlayed objects by constructing the image on * a backbuffer first, then blitting it to the screen. */ // Check that the backbuffer is large enough if (paintImage != null) { Rectangle rect = paintImage.getBounds(); if ((event.width + event.x > rect.width) || (event.height + event.y > rect.height)) { paintFDC.gc.dispose(); paintImage.dispose(); paintImage = null; } } if (paintImage == null) { Display display = getDisplay(); Rectangle rect = display.getClientArea(); paintImage = new Image(display, Math.max(rect.width, event.width + event.x), Math.max(rect.height, event.height + event.y)); paintFDC.gc = new GC(paintImage); } // Setup clipping and the FDC Region clipRegion = new Region(); event.gc.getClipping(clipRegion); paintFDC.gc.setClipping(clipRegion); clipRegion.dispose(); paintFDC.xOffset = displayFDC.xOffset; paintFDC.yOffset = displayFDC.yOffset; paintFDC.xScale = displayFDC.xScale; paintFDC.yScale = displayFDC.yScale; // Merge the overlayed objects into the image, then blit paintFDC.gc.drawImage(image, displayFDC.xOffset + event.x, displayFDC.yOffset + event.y, event.width, event.height, event.x, event.y, event.width, event.height); rubberband.draw(paintFDC); event.gc.drawImage(paintImage, event.x, event.y, event.width, event.height, event.x, event.y, event.width, event.height); } } }); paintCanvas.addControlListener(new ControlAdapter() { public void controlResized(ControlEvent event) { handleResize(); } }); /* Set up the paint canvas scroll bars */ ScrollBar horizontal = paintCanvas.getHorizontalBar(); horizontal.setVisible(true); horizontal.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent event) { scrollHorizontally((ScrollBar)event.widget); } }); ScrollBar vertical = paintCanvas.getVerticalBar(); vertical.setVisible(true); vertical.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent event) { scrollVertically((ScrollBar)event.widget); } }); handleResize(); } /** * Disposes of the PaintSurface's resources. */ public void dispose() { imageFDC.gc.dispose(); displayFDC.gc.dispose(); image.dispose(); if (paintImage != null) { paintImage.dispose(); paintFDC.gc.dispose(); } currentPosition = null; paintCanvas = null; paintSession = null; image = null; paintImage = null; displayFDC = null; imageFDC = null; paintFDC = null; rubberband = null; statusText = null; statusActionInfo = null; statusMessageInfo = null; statusCoordInfo = null; } /** * Called when we must grab focus. */ public void setFocus() { paintCanvas.setFocus(); } /** * Returns the Display on which the PaintSurface resides. * @return the Display */ public Display getDisplay() { return paintCanvas.getDisplay(); } /** * Returns the Shell in which the PaintSurface resides. * @return the Shell */ public Shell getShell() { return paintCanvas.getShell(); } /**
- * Sets the current paint session. * <p>
- * If oldPaintSession != paintSession calls oldPaintSession.end() * and paintSession.begin() * </p> *
- * @param paintSession the paint session to activate; null to disable all sessions
- */
- public void setPaintSession(PaintSession paintSession) {
- if (this.paintSession != null) { if (this.paintSession == paintSession) return;
- this.paintSession.endSession(); }
- this.paintSession = paintSession;
- clearStatus(); if (paintSession != null) { setStatusAction(paintSession.getDisplayName()); paintSession.beginSession(); } else { setStatusAction(PaintPlugin.getResourceString("tool.Null.label")); setStatusMessage(PaintPlugin.getResourceString("session.Null.message")); } }
-
- /**
- * Returns the current paint session.
- *
- * @return the current paint session, null if none is active
- */
- public PaintSession getPaintSession() {
- return paintSession;
- }
- /** * Returns the current paint tool. * * @return the current paint tool, null if none is active (though some other session * might be) */ public PaintTool getPaintTool() { return (paintSession != null && paintSession instanceof PaintTool) ? (PaintTool)paintSession : null; } /** * Returns the current position in an interactive operation. * * @return the last known position of the pointer */ public Point getCurrentPosition() { return currentPosition; } /** * Draws a Figure object to the screen and to the backing store permanently. * * @param object the object to draw onscreen */ public void drawFigure(Figure object) { object.draw(imageFDC); object.draw(displayFDC); } /** * Adds a Figure object to the active rubberband selection. * <p> * This object will be drawn to the screen as a preview and refreshed appropriately * until the selection is either cleared or committed. * </p> * * @param object the object to add to the selection */ public void addRubberbandSelection(Figure object) { rubberband.add(object); if (! isRubberbandHidden()) object.draw(displayFDC); } /** * Clears the active rubberband selection. * <p> * Erases any rubberband objects on the screen then clears the selection. * </p> */ public void clearRubberbandSelection() { if (! isRubberbandHidden()) { Region region = new Region(); rubberband.addDamagedRegion(displayFDC, region); Rectangle r = region.getBounds(); paintCanvas.redraw(r.x, r.y, r.width, r.height, true); region.dispose(); } rubberband.clear(); } /** * Commits the active rubberband selection. * <p> * Redraws any rubberband objects on the screen as permanent objects then clears the selection. * </p> */ public void commitRubberbandSelection() { rubberband.draw(imageFDC); if (isRubberbandHidden()) rubberband.draw(displayFDC); rubberband.clear(); } /** * Hides the rubberband (but does not eliminate it). * <p> * Increments by one the rubberband "hide" nesting count. The rubberband * is hidden from view (but remains active) if it wasn't already hidden. * </p> */ public void hideRubberband() { if (rubberbandHiddenNestingCount++ <= 0) { Region region = new Region(); rubberband.addDamagedRegion(displayFDC, region); Rectangle r = region.getBounds(); paintCanvas.redraw(r.x, r.y, r.width, r.height, true); region.dispose(); } } /** * Shows (un-hides) the rubberband. * <p> * Decrements by one the rubberband "hide" nesting count. The rubberband * is only made visible when showRubberband() has been called once for each * previous hideRubberband(). It is not permitted to call showRubberband() if * the rubber band is not presently hidden. * </p> */ public void showRubberband() { if (rubberbandHiddenNestingCount <= 0) throw new IllegalStateException("rubberbandHiddenNestingCount > 0"); if (--rubberbandHiddenNestingCount == 0) { rubberband.draw(displayFDC); } } /** * Determines if the rubberband is hidden. * * @return true iff the rubber is hidden */ public boolean isRubberbandHidden() { return rubberbandHiddenNestingCount > 0; } /** * Handles a horizontal scroll event * * @param scrollbar the horizontal scroll bar that posted this event */ public void scrollHorizontally(ScrollBar scrollBar) { if (image == null) return; if (imageWidth > visibleWidth) { final int oldOffset = displayFDC.xOffset; final int newOffset = Math.min(scrollBar.getSelection(), imageWidth - visibleWidth); if (oldOffset != newOffset) { paintCanvas.update(); displayFDC.xOffset = newOffset; paintCanvas.scroll(Math.max(oldOffset - newOffset, 0), 0, Math.max(newOffset - oldOffset, 0), 0, visibleWidth, visibleHeight, false); } } } /** * Handles a vertical scroll event * * @param scrollbar the vertical scroll bar that posted this event */ public void scrollVertically(ScrollBar scrollBar) { if (image == null) return; if (imageHeight > visibleHeight) { final int oldOffset = displayFDC.yOffset; final int newOffset = Math.min(scrollBar.getSelection(), imageHeight - visibleHeight); if (oldOffset != newOffset) { paintCanvas.update(); displayFDC.yOffset = newOffset; paintCanvas.scroll(0, Math.max(oldOffset - newOffset, 0), 0, Math.max(newOffset - oldOffset, 0), visibleWidth, visibleHeight, false); } } } /** * Handles resize events */ private void handleResize() { paintCanvas.update(); Rectangle visibleRect = paintCanvas.getClientArea(); visibleWidth = visibleRect.width; visibleHeight = visibleRect.height; ScrollBar horizontal = paintCanvas.getHorizontalBar(); if (horizontal != null) { displayFDC.xOffset = Math.min(horizontal.getSelection(), imageWidth - visibleWidth); if (imageWidth <= visibleWidth) { horizontal.setEnabled(false); horizontal.setSelection(0); } else { final int max = imageWidth - visibleWidth; horizontal.setEnabled(true); horizontal.setValues(displayFDC.xOffset, 0, imageWidth, visibleWidth, 8, visibleWidth); } } ScrollBar vertical = paintCanvas.getVerticalBar(); if (vertical != null) { displayFDC.yOffset = Math.min(vertical.getSelection(), imageHeight - visibleHeight); if (imageHeight <= visibleHeight) { vertical.setEnabled(false); vertical.setSelection(0); } else { final int max = imageHeight - visibleHeight; vertical.setEnabled(true); vertical.setValues(displayFDC.yOffset, 0, imageHeight, visibleHeight, 8, visibleHeight); } } } /** * Virtualizes MouseEvent coordinates and stores the current position. */ private void processMouseEventCoordinates(MouseEvent event) { currentPosition.x = event.x = Math.min(Math.max(event.x, 0), visibleWidth - 1) + displayFDC.xOffset; currentPosition.y = event.y = Math.min(Math.max(event.y, 0), visibleHeight - 1) + displayFDC.yOffset; } /** * Clears the status bar. */ public void clearStatus() { statusActionInfo = ""; statusMessageInfo = ""; statusCoordInfo = ""; updateStatus(); } /** * Sets the status bar action text. * * @param action the action in progress, null to clear */ public void setStatusAction(String action) { statusActionInfo = (action != null) ? action : ""; updateStatus(); } /** * Sets the status bar message text. * * @param message the message to display, null to clear */ public void setStatusMessage(String message) { statusMessageInfo = (message != null) ? message : ""; updateStatus(); } /** * Sets the coordinates in the status bar. * * @param coord the coordinates to display, null to clear */ public void setStatusCoord(Point coord) { statusCoordInfo = (coord != null) ? PaintPlugin.getResourceString("status.Coord.format", new Object[] { new Integer(coord.x), new Integer(coord.y)}) : ""; updateStatus(); } /** * Sets the coordinate range in the status bar. * * @param a the "from" coordinate, must not be null * @param b the "to" coordinate, must not be null */ public void setStatusCoordRange(Point a, Point b) { statusCoordInfo = PaintPlugin.getResourceString("status.CoordRange.format", new Object[] { new Integer(a.x), new Integer(a.y), new Integer(b.x), new Integer(b.y)}); updateStatus(); } /** * Updates the display. */ private void updateStatus() { statusText.setText( PaintPlugin.getResourceString("status.Bar.format", new Object[] { statusActionInfo, statusMessageInfo, statusCoordInfo })); } }
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PaintTool.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PaintTool.java
deleted file mode 100755
index f699b868b7..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PaintTool.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.eclipse.swt.examples.paint;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
- public interface PaintTool extends PaintSession {
- /**
- * Sets the tool's settings.
- *
- * @param toolSettings the new tool settings
- */
- public void set(ToolSettings toolSettings);
-}
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PaintView.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PaintView.java
deleted file mode 100755
index e8d911cc1b..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PaintView.java
+++ /dev/null
@@ -1,494 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.resource.*;
-import org.eclipse.swt.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.part.*;
-
-import java.net.*;
-import java.util.*;
-
-/**
- * The view for the paint application.
- * All rendering happens inside the area created by createPartControl().
- *
- * @see ViewPart
- */
-public class PaintView extends ViewPart {
- private Display workbenchDisplay;
-
- // current active settings
- private ToolSettings toolSettings;
-
- // paint surface for drawing
- private PaintSurface paintSurface;
-
- // map action ids to useful data
- private HashMap /* of String to PaintTool */ paintToolMap;
- private HashMap /* of String to Integer */ paintFillTypeMap;
- private HashMap /* of String to Integer */ paintLineStyleMap;
-
- /** UI data **/
- // handle of currently active tool IAction on the UI
- private IAction activeToolAction;
- // handle of currently active filltype IAction on the UI
- private IAction activeFillTypeAction;
- // handle of currently active linetype IAction on the UI
- private IAction activeLineStyleAction;
-
- // handle of active foreground color box Canvas widget
- private Canvas activeForegroundColorCanvas;
- // handle of active background color box Canvas widget
- private Canvas activeBackgroundColorCanvas;
-
- private static final int numPaletteRows = 3;
- private static final int numPaletteCols = 50;
-
- // shared data
- private Color paintColorBlack, paintColorWhite; // alias for paintColors[0] and [1]
- private Color[] paintColors;
- private Font paintDefaultFont; // do not free
-
- /**
- * Constructs a Paint view.
- */
- public PaintView() {
- }
-
- /**
- * Cleanup
- */
- public void dispose() {
- if (paintSurface != null) paintSurface.dispose();
- if (paintColors != null) {
- for (int i = 0; i < paintColors.length; ++i) {
- final Color color = paintColors[i];
- if (color != null) color.dispose();
- }
- }
- paintDefaultFont = null;
- paintColors = null;
- paintSurface = null;
- super.dispose();
- }
-
- /**
- * Called when we must grab focus.
- *
- * @see org.eclipse.ui.part.ViewPart#setFocus
- */
- public void setFocus() {
- paintSurface.setFocus();
- }
-
- /**
- * Creates the example.
- *
- * @see ViewPart#createPartControl
- */
- public void createPartControl(Composite parent) {
- /*** Initialize shared data ***/
- workbenchDisplay = parent.getDisplay();
-
- paintColorWhite = new Color(workbenchDisplay, 255, 255, 255);
- paintColorBlack = new Color(workbenchDisplay, 0, 0, 0);
-
- paintDefaultFont = workbenchDisplay.getSystemFont();
-
- paintColors = new Color[numPaletteCols * numPaletteRows];
- paintColors[0] = paintColorBlack;
- paintColors[1] = paintColorWhite;
- for (int i = 2; i < paintColors.length; i++) {
- paintColors[i] = new Color(workbenchDisplay,
- ((i*7)%255),((i*23)%255), ((i*51)%255));
- }
-
- toolSettings = new ToolSettings();
- toolSettings.commonForegroundColor = paintColorBlack;
- toolSettings.commonBackgroundColor = paintColorWhite;
- toolSettings.commonFont = paintDefaultFont;
-
- /*** Add toolbar contributions ***/
- final IActionBars actionBars = getViewSite().getActionBars();
- IToolBarManager toolbarManager = actionBars.getToolBarManager();
-
- toolbarManager.add(new GroupMarker("group.tools"));
- toolbarManager.appendToGroup("group.tools", new SelectPaintToolAction("tool.Pencil"));
- toolbarManager.appendToGroup("group.tools", new SelectPaintToolAction("tool.Airbrush"));
- toolbarManager.appendToGroup("group.tools", new SelectPaintToolAction("tool.Line"));
- toolbarManager.appendToGroup("group.tools", new SelectPaintToolAction("tool.PolyLine"));
- toolbarManager.appendToGroup("group.tools", new SelectPaintToolAction("tool.Rectangle"));
- toolbarManager.appendToGroup("group.tools", new SelectPaintToolAction("tool.RoundedRectangle"));
- toolbarManager.appendToGroup("group.tools", new SelectPaintToolAction("tool.Ellipse"));
- toolbarManager.appendToGroup("group.tools", new SelectPaintToolAction("tool.Text"));
- toolbarManager.add(new Separator());
- toolbarManager.add(new GroupMarker("group.options.fill"));
- toolbarManager.appendToGroup("group.options.fill", new SelectFillTypeAction("fill.None"));
- toolbarManager.appendToGroup("group.options.fill", new SelectFillTypeAction("fill.Outline"));
- toolbarManager.appendToGroup("group.options.fill", new SelectFillTypeAction("fill.Solid"));
- toolbarManager.add(new Separator());
- toolbarManager.add(new GroupMarker("group.options.linestyle"));
- toolbarManager.appendToGroup("group.options.linestyle", new SelectLineStyleAction("linestyle.Solid"));
- toolbarManager.appendToGroup("group.options.linestyle", new SelectLineStyleAction("linestyle.Dash"));
- toolbarManager.appendToGroup("group.options.linestyle", new SelectLineStyleAction("linestyle.Dot"));
- toolbarManager.appendToGroup("group.options.linestyle", new SelectLineStyleAction("linestyle.DashDot"));
- toolbarManager.add(new Separator());
- toolbarManager.add(new GroupMarker("group.options"));
- toolbarManager.appendToGroup("group.options", new SelectFontAction("options.Font"));
- actionBars.updateActionBars();
-
- /*** Build GUI ***/
- createGUI(parent);
-
- /*** Set defaults ***/
- setPaintToolByID("tool.Pencil");
- setFillTypeByID("fill.None");
- setLineStyleByID("linestyle.Solid");
- setForegroundColor(paintColorBlack);
- setBackgroundColor(paintColorWhite);
- }
-
- /**
- * Creates the GUI.
- */
- private void createGUI(Composite parent) {
- GridLayout gridLayout;
- GridData gridData;
-
- /*** Create principal GUI layout elements ***/
- Composite displayArea = new Composite(parent, SWT.NONE);
- gridLayout = new GridLayout();
- gridLayout.numColumns = 1;
- displayArea.setLayout(gridLayout);
-
- // Creating these elements here avoids the need to instantiate the GUI elements
- // in strict layout order. The natural layout ordering is an artifact of using
- // SWT layouts, but unfortunately it is not the same order as that required to
- // instantiate all of the non-GUI application elements to satisfy referential
- // dependencies. It is possible to reorder the initialization to some extent, but
- // this can be very tedious.
-
- // paint canvas
- final Canvas paintCanvas = new Canvas(displayArea, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL |
- SWT.NO_REDRAW_RESIZE | SWT.NO_BACKGROUND);
- gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
- paintCanvas.setLayoutData(gridData);
- paintCanvas.setBackground(paintColorWhite);
-
- // color selector frame
- final Composite colorFrame = new Composite(displayArea, SWT.NONE);
- gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
- colorFrame.setLayoutData(gridData);
-
- // tool settings frame
- final Composite toolSettingsFrame = new Composite(displayArea, SWT.NONE);
- gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
- toolSettingsFrame.setLayoutData(gridData);
-
- // status text
- final Text statusText = new Text(displayArea, SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY);
- gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
- statusText.setLayoutData(gridData);
-
- /*** Create the remaining application elements inside the principal GUI layout elements ***/
- // paintSurface
- paintSurface = new PaintSurface(paintCanvas, statusText, paintColorWhite);
-
- // paintToolMap
- paintToolMap = new HashMap();
- paintToolMap.put("tool.Pencil", new PencilTool(toolSettings, paintSurface));
- paintToolMap.put("tool.Airbrush", new AirbrushTool(toolSettings, paintSurface));
- paintToolMap.put("tool.Line", new LineTool(toolSettings, paintSurface));
- paintToolMap.put("tool.PolyLine", new PolyLineTool(toolSettings, paintSurface));
- paintToolMap.put("tool.Rectangle", new RectangleTool(toolSettings, paintSurface));
- paintToolMap.put("tool.RoundedRectangle", new RoundedRectangleTool(toolSettings, paintSurface));
- paintToolMap.put("tool.Ellipse", new EllipseTool(toolSettings, paintSurface));
- paintToolMap.put("tool.Text", new TextTool(toolSettings, paintSurface));
- paintToolMap.put("tool.Null", null);
-
- // paintFillTypeMap
- paintFillTypeMap = new HashMap();
- paintFillTypeMap.put("fill.None", new Integer(ToolSettings.ftNone));
- paintFillTypeMap.put("fill.Outline", new Integer(ToolSettings.ftOutline));
- paintFillTypeMap.put("fill.Solid", new Integer(ToolSettings.ftSolid));
-
- // paintLineStyleMap
- paintLineStyleMap = new HashMap();
- paintLineStyleMap.put("linestyle.Solid", new Integer(SWT.LINE_SOLID));
- paintLineStyleMap.put("linestyle.Dash", new Integer(SWT.LINE_DASH));
- paintLineStyleMap.put("linestyle.Dot", new Integer(SWT.LINE_DOT));
- paintLineStyleMap.put("linestyle.DashDot", new Integer(SWT.LINE_DASHDOT));
-
- // colorFrame
- gridLayout = new GridLayout();
- gridLayout.numColumns = 3;
- gridLayout.marginHeight = 0;
- gridLayout.marginWidth = 0;
- colorFrame.setLayout(gridLayout);
-
- // activeForegroundColorCanvas, activeBackgroundColorCanvas
- activeForegroundColorCanvas = new Canvas(colorFrame, SWT.BORDER);
- gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gridData.heightHint = 24;
- gridData.widthHint = 24;
- activeForegroundColorCanvas.setLayoutData(gridData);
-
- activeBackgroundColorCanvas = new Canvas(colorFrame, SWT.BORDER);
- gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gridData.heightHint = 24;
- gridData.widthHint = 24;
- activeBackgroundColorCanvas.setLayoutData(gridData);
-
- // paletteCanvas
- final Canvas paletteCanvas = new Canvas(colorFrame, SWT.BORDER | SWT.NO_BACKGROUND);
- gridData = new GridData(GridData.FILL_HORIZONTAL);
- gridData.heightHint = 24;
- paletteCanvas.setLayoutData(gridData);
- paletteCanvas.addListener(SWT.MouseDown, new Listener() {
- public void handleEvent(Event e) {
- Rectangle bounds = paletteCanvas.getClientArea();
- Color color = getColorAt(bounds, e.x, e.y);
-
- if (e.button == 1) setForegroundColor(color);
- else setBackgroundColor(color);
- }
- private Color getColorAt(Rectangle bounds, int x, int y) {
- if (bounds.height <= 1 && bounds.width <= 1) return paintColorWhite;
- final int row = (y - bounds.y) * numPaletteRows / bounds.height;
- final int col = (x - bounds.x) * numPaletteCols / bounds.width;
- return paintColors[Math.min(Math.max(row * numPaletteCols + col, 0), paintColors.length - 1)];
- }
- });
- Listener refreshListener = new Listener() {
- public void handleEvent(Event e) {
- if (e.gc == null) return;
- Rectangle bounds = paletteCanvas.getClientArea();
- for (int row = 0; row < numPaletteRows; ++row) {
- for (int col = 0; col < numPaletteCols; ++col) {
- final int x = bounds.width * col / numPaletteCols;
- final int y = bounds.height * row / numPaletteRows;
- final int width = Math.max(bounds.width * (col + 1) / numPaletteCols - x, 1);
- final int height = Math.max(bounds.height * (row + 1) / numPaletteRows - y, 1);
- e.gc.setBackground(paintColors[row * numPaletteCols + col]);
- e.gc.fillRectangle(bounds.x + x, bounds.y + y, width, height);
- }
- }
- }
- };
- paletteCanvas.addListener(SWT.Resize, refreshListener);
- paletteCanvas.addListener(SWT.Paint, refreshListener);
- //paletteCanvas.redraw();
-
- // toolSettingsFrame
- gridLayout = new GridLayout();
- gridLayout.numColumns = 4;
- gridLayout.marginHeight = 0;
- gridLayout.marginWidth = 0;
- toolSettingsFrame.setLayout(gridLayout);
-
- Label label = new Label(toolSettingsFrame, SWT.NONE);
- label.setText(PaintPlugin.getResourceString("settings.AirbrushRadius.text"));
-
- final Scale airbrushRadiusScale = new Scale(toolSettingsFrame, SWT.HORIZONTAL);
- airbrushRadiusScale.setMinimum(5);
- airbrushRadiusScale.setMaximum(50);
- airbrushRadiusScale.setSelection(toolSettings.airbrushRadius);
- airbrushRadiusScale.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));
- airbrushRadiusScale.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- toolSettings.airbrushRadius = airbrushRadiusScale.getSelection();
- updateToolSettings();
- }
- });
-
- label = new Label(toolSettingsFrame, SWT.NONE);
- label.setText(PaintPlugin.getResourceString("settings.AirbrushIntensity.text"));
-
- final Scale airbrushIntensityScale = new Scale(toolSettingsFrame, SWT.HORIZONTAL);
- airbrushIntensityScale.setMinimum(1);
- airbrushIntensityScale.setMaximum(100);
- airbrushIntensityScale.setSelection(toolSettings.airbrushIntensity);
- airbrushIntensityScale.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));
- airbrushIntensityScale.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- toolSettings.airbrushIntensity = airbrushIntensityScale.getSelection();
- updateToolSettings();
- }
- });
- }
-
- /**
- * Notifies the tool that its settings have changed.
- */
- private void updateToolSettings() {
- final PaintTool activePaintTool = paintSurface.getPaintTool();
- if (activePaintTool == null) return;
-
- activePaintTool.endSession();
- activePaintTool.set(toolSettings);
- activePaintTool.beginSession();
- }
-
- /**
- * Sets the tool foreground color.
- *
- * @param color the new color to use
- */
- public void setForegroundColor(Color color) {
- if (activeForegroundColorCanvas != null)
- activeForegroundColorCanvas.setBackground(color);
- toolSettings.commonForegroundColor = color;
- updateToolSettings();
- }
-
- /**
- * Set the tool background color.
- *
- * @param color the new color to use
- */
- public void setBackgroundColor(Color color) {
- if (activeBackgroundColorCanvas != null)
- activeBackgroundColorCanvas.setBackground(color);
- toolSettings.commonBackgroundColor = color;
- updateToolSettings();
- }
-
- /**
- * Selects a tool given its ID.
- */
- public void setPaintToolByID(String id) {
- activeToolAction = handleRadioAction(activeToolAction, id);
-
- final PaintTool paintTool = (PaintTool) paintToolMap.get(id);
- paintSurface.setPaintSession(paintTool);
- updateToolSettings();
- }
-
- /**
- * Selects a filltype given its ID.
- */
- public void setFillTypeByID(String id) {
- activeFillTypeAction = handleRadioAction(activeFillTypeAction, id);
-
- final Integer fillType = (Integer) paintFillTypeMap.get(id);
- toolSettings.commonFillType = fillType.intValue();
- updateToolSettings();
- }
-
- /**
- * Selects line type given its ID.
- */
- public void setLineStyleByID(String id) {
- activeLineStyleAction = handleRadioAction(activeLineStyleAction, id);
-
- final Integer lineType = (Integer) paintLineStyleMap.get(id);
- toolSettings.commonLineStyle = lineType.intValue();
- updateToolSettings();
- }
-
- /**
- * Gets the IAction for an ID belonging to a set of mutually exclusive actions, and
- * toggles the old action off if necessary.
- */
- private IAction handleRadioAction(IAction oldAction, String id) {
- IAction action = getActionByID(id);
- if (action != null) {
- if (oldAction != null) oldAction.setChecked(false);
- if (! action.isChecked()) action.setChecked(true);
- return action;
- }
- return oldAction;
- }
-
- /**
- * Gets the IAction representing the UI toolbar button with the specified ID.
- */
- private IAction getActionByID(String id) {
- final IActionBars actionBars = getViewSite().getActionBars();
- IToolBarManager toolbarManager = actionBars.getToolBarManager();
- ActionContributionItem contributionItem = (ActionContributionItem) toolbarManager.find(id);
- if (contributionItem == null) return null;
- return contributionItem.getAction();
- }
-
- /**
- * Returns the Display.
- *
- * @return the display we're using
- */
- public Display getDisplay() {
- return workbenchDisplay;
- }
-
- /**
- * Action set glue.
- */
- abstract class PaintAction extends Action {
- public PaintAction(String id) {
- super();
- setId(id);
-
- try {
- final URL installUrl = PaintPlugin.getDefault().getDescriptor().getInstallURL();
- final URL imageUrl = new URL(installUrl, PaintPlugin.getResourceString(id + ".image"));
- setImageDescriptor(ImageDescriptor.createFromURL(imageUrl));
- } catch (MalformedURLException e) {
- PaintPlugin.logError("", e);
- }
-
- setText(PaintPlugin.getResourceString(id + ".label"));
- setToolTipText(PaintPlugin.getResourceString(id + ".tooltip"));
- setDescription(PaintPlugin.getResourceString(id + ".description"));
- }
- }
- class SelectPaintToolAction extends PaintAction {
- public SelectPaintToolAction(String id) { super(id); }
- public int getStyle() { return IAction.AS_CHECK_BOX; }
- public void run() { setPaintToolByID(getId()); }
-
- }
- class SelectFillTypeAction extends PaintAction {
- public SelectFillTypeAction(String id) { super(id); }
- public int getStyle() { return IAction.AS_CHECK_BOX; }
- public void run() { setFillTypeByID(getId()); }
- }
- class SelectLineStyleAction extends PaintAction {
- public SelectLineStyleAction(String id) { super(id); }
- public int getStyle() { return IAction.AS_CHECK_BOX; }
- public void run() { setLineStyleByID(getId()); }
- }
- class SelectFontAction extends PaintAction {
- public SelectFontAction(String id) { super(id); }
- public int getStyle() { return IAction.AS_PUSH_BUTTON; }
- public void run() {
- FontDialog fontDialog = new FontDialog(paintSurface.getShell(), SWT.PRIMARY_MODAL);
- FontData[] fontDatum = toolSettings.commonFont.getFontData();
- if (fontDatum != null && fontDatum.length > 0) {
- fontDialog.setFontData(fontDatum[0]);
- }
- fontDialog.setText(PaintPlugin.getResourceString("options.Font.dialog.title"));
-
- paintSurface.hideRubberband();
- FontData fontData = fontDialog.open();
- paintSurface.showRubberband();
- if (fontData != null) {
- try {
- Font font = new Font(workbenchDisplay, fontData);
- toolSettings.commonFont = font;
- updateToolSettings();
- } catch (SWTException e) {
- }
- }
- }
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PencilTool.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PencilTool.java
deleted file mode 100755
index 69f52d8612..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PencilTool.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import java.util.Random; import org.eclipse.swt.graphics.*;
-
-/**
- * A pencil tool.
- */
-public class PencilTool extends ContinuousPaintSession implements PaintTool {
- private ToolSettings settings;
-
- /**
- * Constructs a pencil tool.
- *
- * @param toolSettings the new tool settings
- * @param getPaintSurface() the PaintSurface we will render on.
- */
- public PencilTool(ToolSettings toolSettings, PaintSurface paintSurface) {
- super(paintSurface);
- set(toolSettings);
- }
-
- /**
- * Sets the tool's settings.
- *
- * @param toolSettings the new tool settings
- */
- public void set(ToolSettings toolSettings) {
- settings = toolSettings;
- }
-
- /**
- * Returns the name associated with this tool.
- *
- * @return the localized name of this tool
- */
- public String getDisplayName() {
- return PaintPlugin.getResourceString("tool.Pencil.label");
- }
-
- /*
- * Template method for drawing
- */
- public void render(final Point point) {
- final PaintSurface ps = getPaintSurface();
- ps.drawFigure(new PointFigure(settings.commonForegroundColor, point.x, point.y));
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PointFigure.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PointFigure.java
deleted file mode 100644
index a93da19f9c..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PointFigure.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.graphics.*;
-
-/**
- * 2D Point object
- */
-public class PointFigure extends Figure {
- private Color color;
- private int x, y;
- /**
- * Constructs a Point
- *
- * @param color the color for this object
- * @param x the virtual X coordinate of the first end-point
- * @param y the virtual Y coordinate of the first end-point
- */
- public PointFigure(Color color, int x, int y) {
- this.color = color; this.x = x; this.y = y;
- }
- public void draw(FigureDrawContext fdc) {
- Point p = fdc.toClientPoint(x, y);
- fdc.gc.setBackground(color);
- fdc.gc.fillRectangle(p.x, p.y, 1, 1);
- }
- public void addDamagedRegion(FigureDrawContext fdc, Region region) {
- region.add(fdc.toClientRectangle(x, y, x, y));
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PolyLineTool.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PolyLineTool.java
deleted file mode 100755
index 973e152695..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/PolyLineTool.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.graphics.*;
-
-/**
- * A polyline drawing tool.
- */
-public class PolyLineTool extends SegmentedPaintSession implements PaintTool {
- private ToolSettings settings;
-
- /**
- * Constructs a PolyLineTool.
- *
- * @param toolSettings the new tool settings
- * @param paintSurface the PaintSurface we will render on.
- */
- public PolyLineTool(ToolSettings toolSettings, PaintSurface paintSurface) {
- super(paintSurface);
- set(toolSettings);
- }
-
- /**
- * Sets the tool's settings.
- *
- * @param toolSettings the new tool settings
- */
- public void set(ToolSettings toolSettings) {
- settings = toolSettings;
- }
-
- /**
- * Returns the name associated with this tool.
- *
- * @return the localized name of this tool
- */
- public String getDisplayName() {
- return PaintPlugin.getResourceString("tool.PolyLine.label");
- }
-
- /*
- * Template methods for drawing
- */
- protected Figure createFigure(Point[] points, int numPoints, boolean closed) {
- ContainerFigure container = new ContainerFigure();
- if (closed && settings.commonFillType != ToolSettings.ftNone && numPoints >= 3) {
- container.add(new SolidPolygonFigure(settings.commonBackgroundColor, points, numPoints));
- }
- if (! closed || settings.commonFillType != ToolSettings.ftSolid || numPoints < 3) {
- for (int i = 0; i < numPoints - 1; ++i) {
- final Point a = points[i];
- final Point b = points[i + 1];
- container.add(new LineFigure(settings.commonForegroundColor, settings.commonBackgroundColor, settings.commonLineStyle,
- a.x, a.y, b.x, b.y));
- }
- if (closed) {
- final Point a = points[points.length - 1];
- final Point b = points[0];
- container.add(new LineFigure(settings.commonForegroundColor, settings.commonBackgroundColor, settings.commonLineStyle,
- a.x, a.y, b.x, b.y));
- }
- }
- return container;
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/RectangleFigure.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/RectangleFigure.java
deleted file mode 100755
index b6bf01462b..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/RectangleFigure.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-
-/**
- * 2D Rectangle object
- */
-public class RectangleFigure extends Figure {
- private Color foregroundColor, backgroundColor;
- private int lineStyle, x1, y1, x2, y2;
- /**
- * Constructs a Rectangle
- * These objects are defined by any two diametrically opposing corners.
- *
- * @param color the color for this object
- * @param lineStyle the line style for this object
- * @param x1 the virtual X coordinate of the first corner
- * @param y1 the virtual Y coordinate of the first corner
- * @param x2 the virtual X coordinate of the second corner
- * @param y2 the virtual Y coordinate of the second corner
- */
- public RectangleFigure(Color foregroundColor, Color backgroundColor, int lineStyle, int x1, int y1, int x2, int y2) {
- this.foregroundColor = foregroundColor;
- this.backgroundColor = backgroundColor;
- this.lineStyle = lineStyle;
- this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2;
- }
- public void draw(FigureDrawContext fdc) {
- Rectangle r = fdc.toClientRectangle(x1, y1, x2, y2);
- fdc.gc.setForeground(foregroundColor);
- fdc.gc.setBackground(backgroundColor);
- fdc.gc.setLineStyle(lineStyle);
- fdc.gc.drawRectangle(r.x, r.y, r.width - 1, r.height - 1);
- fdc.gc.setLineStyle(SWT.LINE_SOLID);
- }
- public void addDamagedRegion(FigureDrawContext fdc, Region region) {
- region.add(fdc.toClientRectangle(x1, y1, x2, y2));
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/RectangleTool.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/RectangleTool.java
deleted file mode 100755
index 555280150c..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/RectangleTool.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.graphics.*;
-
-/**
- * A drawing tool.
- */
-public class RectangleTool extends DragPaintSession implements PaintTool {
- private ToolSettings settings;
-
- /**
- * Constructs a RectangleTool.
- *
- * @param toolSettings the new tool settings
- * @param paintSurface the PaintSurface we will render on.
- */
- public RectangleTool(ToolSettings toolSettings, PaintSurface paintSurface) {
- super(paintSurface);
- set(toolSettings);
- }
-
- /**
- * Sets the tool's settings.
- *
- * @param toolSettings the new tool settings
- */
- public void set(ToolSettings toolSettings) {
- settings = toolSettings;
- }
-
- /**
- * Returns name associated with this tool.
- *
- * @return the localized name of this tool
- */
- public String getDisplayName() {
- return PaintPlugin.getResourceString("tool.Rectangle.label");
- }
-
- /*
- * Template method for drawing
- */
- protected Figure createFigure(Point a, Point b) {
- switch (settings.commonFillType) {
- default:
- case ToolSettings.ftNone:
- return new RectangleFigure(settings.commonForegroundColor, settings.commonBackgroundColor, settings.commonLineStyle,
- a.x, a.y, b.x, b.y);
- case ToolSettings.ftSolid:
- return new SolidRectangleFigure(settings.commonBackgroundColor, a.x, a.y, b.x, b.y);
- case ToolSettings.ftOutline: {
- ContainerFigure container = new ContainerFigure();
- container.add(new SolidRectangleFigure(settings.commonBackgroundColor, a.x, a.y, b.x, b.y));
- container.add(new RectangleFigure(settings.commonForegroundColor, settings.commonBackgroundColor, settings.commonLineStyle,
- a.x, a.y, b.x, b.y));
- return container;
- }
- }
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/RoundedRectangleFigure.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/RoundedRectangleFigure.java
deleted file mode 100755
index ec561dd454..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/RoundedRectangleFigure.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-
-/**
- * 2D Rectangle object
- */
-public class RoundedRectangleFigure extends Figure {
- private Color foregroundColor, backgroundColor;
- private int lineStyle, x1, y1, x2, y2, diameter;
- /**
- * Constructs a Rectangle
- * These objects are defined by any two diametrically opposing corners.
- *
- * @param color the color for this object
- * @param lineStyle the line style for this object
- * @param x1 the virtual X coordinate of the first corner
- * @param y1 the virtual Y coordinate of the first corner
- * @param x2 the virtual X coordinate of the second corner
- * @param y2 the virtual Y coordinate of the second corner
- * @param diameter the diameter of curvature of all four corners
- */
- public RoundedRectangleFigure(Color foregroundColor, Color backgroundColor, int lineStyle, int x1, int y1, int x2, int y2, int diameter) {
- this.foregroundColor = foregroundColor;
- this.backgroundColor = backgroundColor;
- this.lineStyle = lineStyle;
- this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2;
- this.diameter = diameter;
- }
- public void draw(FigureDrawContext fdc) {
- Rectangle r = fdc.toClientRectangle(x1, y1, x2, y2);
- fdc.gc.setForeground(foregroundColor);
- fdc.gc.setBackground(backgroundColor);
- fdc.gc.setLineStyle(lineStyle);
- fdc.gc.drawRoundRectangle(r.x, r.y, r.width - 1, r.height - 1, diameter, diameter);
- fdc.gc.setLineStyle(SWT.LINE_SOLID);
- }
- public void addDamagedRegion(FigureDrawContext fdc, Region region) {
- region.add(fdc.toClientRectangle(x1, y1, x2, y2));
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/RoundedRectangleTool.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/RoundedRectangleTool.java
deleted file mode 100755
index e649b40005..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/RoundedRectangleTool.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.graphics.*;
-
-/**
- * A drawing tool.
- */
-public class RoundedRectangleTool extends DragPaintSession implements PaintTool {
- private ToolSettings settings;
-
- /**
- * Constructs a RoundedRectangleTool.
- *
- * @param toolSettings the new tool settings
- * @param paintSurface the PaintSurface we will render on.
- */
- public RoundedRectangleTool(ToolSettings toolSettings, PaintSurface paintSurface) {
- super(paintSurface);
- set(toolSettings);
- }
-
- /**
- * Sets the tool's settings.
- *
- * @param toolSettings the new tool settings
- */
- public void set(ToolSettings toolSettings) {
- settings = toolSettings;
- }
-
- /**
- * Returns name associated with this tool.
- *
- * @return the localized name of this tool
- */
- public String getDisplayName() {
- return PaintPlugin.getResourceString("tool.RoundedRectangle.label");
- }
-
- /*
- * Template methods for drawing
- */
- protected Figure createFigure(Point a, Point b) {
- ContainerFigure container = new ContainerFigure();
- if (settings.commonFillType != ToolSettings.ftNone)
- container.add(new SolidRoundedRectangleFigure(settings.commonBackgroundColor,
- a.x, a.y, b.x, b.y, settings.roundedRectangleCornerDiameter));
- if (settings.commonFillType != ToolSettings.ftSolid)
- container.add(new RoundedRectangleFigure(settings.commonForegroundColor, settings.commonBackgroundColor,
- settings.commonLineStyle, a.x, a.y, b.x, b.y, settings.roundedRectangleCornerDiameter));
- return container;
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/SegmentedPaintSession.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/SegmentedPaintSession.java
deleted file mode 100755
index 5085ab1bf2..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/SegmentedPaintSession.java
+++ /dev/null
@@ -1,153 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-
-import java.util.*;
-
-/**
- * The superclass for paint tools that contruct objects from individually
- * picked segments.
- */
-public abstract class SegmentedPaintSession extends BasicPaintSession {
- /**
- * The set of control points making up the segmented selection
- */
- private Vector /* of Point */ controlPoints = new Vector();
-
- /**
- * The previous figure (so that we can abort with right-button)
- */
- private Figure previousFigure = null;
-
- /**
- * The current figure (so that we can abort with right-button)
- */
- private Figure currentFigure = null;
-
- /**
- * Constructs a PaintSession.
- *
- * @param paintSurface the drawing surface to use
- */
- protected SegmentedPaintSession(PaintSurface paintSurface) {
- super(paintSurface);
- }
-
- /**
- * Activates the tool.
- */
- public void beginSession() {
- getPaintSurface().setStatusMessage(PaintPlugin.getResourceString(
- "session.SegmentedInteractivePaint.message.anchorMode"));
- previousFigure = null;
- currentFigure = null;
- controlPoints.clear();
- }
-
- /**
- * Deactivates the tool.
- */
- public void endSession() {
- getPaintSurface().clearRubberbandSelection();
- if (previousFigure != null) getPaintSurface().drawFigure(previousFigure);
- }
-
- /**
- * Resets the tool.
- * Aborts any operation in progress.
- */
- public void resetSession() {
- getPaintSurface().clearRubberbandSelection();
- if (previousFigure != null) getPaintSurface().drawFigure(previousFigure);
-
- getPaintSurface().setStatusMessage(PaintPlugin.getResourceString(
- "session.SegmentedInteractivePaint.message.anchorMode"));
- previousFigure = null;
- currentFigure = null;
- controlPoints.clear();
- }
-
- /**
- * Handles a mouseDown event.
- *
- * @param event the mouse event detail information
- */
- public void mouseDown(MouseEvent event) {
- if (event.button != 1) return;
-
- getPaintSurface().setStatusMessage(PaintPlugin.getResourceString(
- "session.SegmentedInteractivePaint.message.interactiveMode"));
- previousFigure = currentFigure;
-
- if (controlPoints.size() > 0) {
- final Point lastPoint = (Point) controlPoints.elementAt(controlPoints.size() - 1);
- if (lastPoint.x == event.x || lastPoint.y == event.y) return; // spurious event
- }
- controlPoints.add(new Point(event.x, event.y));
- }
-
- /**
- * Handles a mouseDoubleClick event.
- *
- * @param event the mouse event detail information
- */
- public void mouseDoubleClick(MouseEvent event) {
- if (event.button != 1) return;
- if (controlPoints.size() >= 2) {
- getPaintSurface().clearRubberbandSelection();
- previousFigure = createFigure(
- (Point[]) controlPoints.toArray(new Point[controlPoints.size()]),
- controlPoints.size(), true);
- }
- resetSession();
- }
-
- /**
- * Handles a mouseUp event.
- *
- * @param event the mouse event detail information
- */
- public void mouseUp(MouseEvent event) {
- if (event.button != 1) {
- resetSession(); // abort if right or middle mouse button pressed
- return;
- }
- }
-
- /**
- * Handles a mouseMove event.
- *
- * @param event the mouse event detail information
- */
- public void mouseMove(MouseEvent event) {
- final PaintSurface ps = getPaintSurface();
- if (controlPoints.size() == 0) {
- ps.setStatusCoord(ps.getCurrentPosition());
- return; // spurious event
- } else {
- ps.setStatusCoordRange((Point) controlPoints.elementAt(controlPoints.size() - 1),
- ps.getCurrentPosition());
- }
-
- ps.clearRubberbandSelection();
- Point[] points = (Point[]) controlPoints.toArray(new Point[controlPoints.size() + 1]);
- points[controlPoints.size()] = ps.getCurrentPosition();
- currentFigure = createFigure(points, points.length, false);
- ps.addRubberbandSelection(currentFigure);
- }
-
- /**
- * Template Method: Creates a Figure for drawing rubberband entities and the final product
- *
- * @param points the array of control points
- * @param numPoints the number of valid points in the array (n >= 2)
- * @param closed true if the user double-clicked on the final control point
- */
- protected abstract Figure createFigure(Point[] points, int numPoints, boolean closed);
-}
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/SolidEllipseFigure.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/SolidEllipseFigure.java
deleted file mode 100755
index 8f481eb474..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/SolidEllipseFigure.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.graphics.*;
-
-/**
- * 2D Solid Ellipse object
- */
-public class SolidEllipseFigure extends Figure {
- private Color color;
- private int x1, y1, x2, y2;
- /**
- * Constructs a SolidEllipse
- * These objects are defined by any two diametrically opposing corners of a box
- * bounding the ellipse.
- *
- * @param color the color for this object
- * @param x1 the virtual X coordinate of the first corner
- * @param y1 the virtual Y coordinate of the first corner
- * @param x2 the virtual X coordinate of the second corner
- * @param y2 the virtual Y coordinate of the second corner
- */
- public SolidEllipseFigure(Color color, int x1, int y1, int x2, int y2) {
- this.color = color; this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2;
- }
- public void draw(FigureDrawContext fdc) {
- Rectangle r = fdc.toClientRectangle(x1, y1, x2, y2);
- fdc.gc.setBackground(color);
- fdc.gc.fillOval(r.x, r.y, r.width, r.height);
- }
- public void addDamagedRegion(FigureDrawContext fdc, Region region) {
- region.add(fdc.toClientRectangle(x1, y1, x2, y2));
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/SolidPolygonFigure.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/SolidPolygonFigure.java
deleted file mode 100755
index 22b06ca958..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/SolidPolygonFigure.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.graphics.*;
-
-/**
- * 2D Line object
- */
-public class SolidPolygonFigure extends Figure {
- private Color color;
- private int[] points;
- /**
- * Constructs a SolidPolygon
- * These objects are defined by a sequence of vertices.
- *
- * @param color the color for this object
- * @param vertices the array of vertices making up the polygon
- * @param numPoint the number of valid points in the array (n >= 3)
- */
- public SolidPolygonFigure(Color color, Point[] vertices, int numPoints) {
- this.color = color;
- this.points = new int[numPoints * 2];
- for (int i = 0; i < numPoints; ++i) {
- points[i * 2] = vertices[i].x;
- points[i * 2 + 1] = vertices[i].y;
- }
- }
- public void draw(FigureDrawContext fdc) {
- int[] drawPoints = new int[points.length];
- for (int i = 0; i < points.length; i += 2) {
- drawPoints[i] = points[i] * fdc.xScale - fdc.xOffset;
- drawPoints[i + 1] = points[i + 1] * fdc.yScale - fdc.yOffset;
- }
- fdc.gc.setBackground(color);
- fdc.gc.fillPolygon(drawPoints);
- }
- public void addDamagedRegion(FigureDrawContext fdc, Region region) {
- int xmin = Integer.MAX_VALUE, ymin = Integer.MAX_VALUE;
- int xmax = Integer.MIN_VALUE, ymax = Integer.MIN_VALUE;
-
- for (int i = 0; i < points.length; i += 2) {
- if (points[i] < xmin) xmin = points[i];
- if (points[i] > xmax) xmax = points[i];
- if (points[i+1] < ymin) ymin = points[i+1];
- if (points[i+1] > ymax) ymax = points[i+1];
- }
- region.add(fdc.toClientRectangle(xmin, ymin, xmax, ymax));
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/SolidRectangleFigure.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/SolidRectangleFigure.java
deleted file mode 100755
index f1146a5736..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/SolidRectangleFigure.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.graphics.*;
-
-/**
- * 2D SolidRectangle object
- */
-public class SolidRectangleFigure extends Figure {
- private Color color;
- private int x1, y1, x2, y2;
- /**
- * Constructs a SolidRectangle
- * These objects are defined by any two diametrically opposing corners.
- *
- * @param color the color for this object
- * @param x1 the virtual X coordinate of the first corner
- * @param y1 the virtual Y coordinate of the first corner
- * @param x2 the virtual X coordinate of the second corner
- * @param y2 the virtual Y coordinate of the second corner
- */
- public SolidRectangleFigure(Color color, int x1, int y1, int x2, int y2) {
- this.color = color; this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2;
- }
- public void draw(FigureDrawContext fdc) {
- Rectangle r = fdc.toClientRectangle(x1, y1, x2, y2);
- fdc.gc.setBackground(color);
- fdc.gc.fillRectangle(r.x, r.y, r.width, r.height);
- }
- public void addDamagedRegion(FigureDrawContext fdc, Region region) {
- region.add(fdc.toClientRectangle(x1, y1, x2, y2));
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/SolidRoundedRectangleFigure.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/SolidRoundedRectangleFigure.java
deleted file mode 100755
index bb57338e75..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/SolidRoundedRectangleFigure.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.graphics.*;
-
-/**
- * 2D SolidRectangle object
- */
-public class SolidRoundedRectangleFigure extends Figure {
- private Color color;
- private int x1, y1, x2, y2, diameter;
- /**
- * Constructs a SolidRectangle
- * These objects are defined by any two diametrically opposing corners.
- *
- * @param color the color for this object
- * @param x1 the virtual X coordinate of the first corner
- * @param y1 the virtual Y coordinate of the first corner
- * @param x2 the virtual X coordinate of the second corner
- * @param y2 the virtual Y coordinate of the second corner
- * @param diameter the diameter of curvature of all four corners
- */
- public SolidRoundedRectangleFigure(Color color, int x1, int y1, int x2, int y2, int diameter) {
- this.color = color; this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2;
- this.diameter = diameter;
- }
- public void draw(FigureDrawContext fdc) {
- Rectangle r = fdc.toClientRectangle(x1, y1, x2, y2);
- fdc.gc.setBackground(color);
- fdc.gc.fillRoundRectangle(r.x, r.y, r.width, r.height, diameter, diameter);
- }
- public void addDamagedRegion(FigureDrawContext fdc, Region region) {
- region.add(fdc.toClientRectangle(x1, y1, x2, y2));
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/TextFigure.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/TextFigure.java
deleted file mode 100755
index a8f1b077ff..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/TextFigure.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.graphics.*;
-
-/**
- * 2D Rectangle object
- */
-public class TextFigure extends Figure {
- private Color color;
- private Font font;
- private String text;
- private int x, y;
- /**
- * Constructs a TextFigure
- *
- * @param color the color for this object
- * @param font the font for this object
- * @param text the text to draw, tab and new-line expansion is performed
- * @param x the virtual X coordinate of the top-left corner of the text bounding box
- * @param y the virtual Y coordinate of the top-left corner of the text bounding box
- */
- public TextFigure(Color color, Font font, String text, int x, int y) {
- this.color = color; this.font = font; this.text = text; this.x = x; this.y = y;
- }
- public void draw(FigureDrawContext fdc) {
- Point p = fdc.toClientPoint(x, y);
- fdc.gc.setFont(font);
- fdc.gc.setForeground(color);
- fdc.gc.drawText(text, p.x, p.y, true);
- }
- public void addDamagedRegion(FigureDrawContext fdc, Region region) {
- Font oldFont = fdc.gc.getFont();
- fdc.gc.setFont(font);
- Point textExtent = fdc.gc.textExtent(text);
- fdc.gc.setFont(oldFont);
- region.add(fdc.toClientRectangle(x, y, x + textExtent.x, y + textExtent.y));
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/TextTool.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/TextTool.java
deleted file mode 100755
index 22831e81bf..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/TextTool.java
+++ /dev/null
@@ -1,122 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.jface.dialogs.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-
-/**
- * A text drawing tool.
- */
-public class TextTool extends BasicPaintSession implements PaintTool {
- private ToolSettings settings;
- private String drawText = PaintPlugin.getResourceString("tool.Text.settings.defaulttext");
-
- /**
- * Constructs a PaintTool.
- *
- * @param toolSettings the new tool settings
- * @param paintSurface the PaintSurface we will render on.
- */
- public TextTool(ToolSettings toolSettings, PaintSurface paintSurface) {
- super(paintSurface);
- set(toolSettings);
- }
-
- /**
- * Sets the tool's settings.
- *
- * @param toolSettings the new tool settings
- */
- public void set(ToolSettings toolSettings) {
- settings = toolSettings;
- }
-
- /**
- * Returns name associated with this tool.
- *
- * @return the localized name of this tool
- */
- public String getDisplayName() {
- return PaintPlugin.getResourceString("tool.Text.label");
- }
-
- /**
- * Activates the tool.
- */
- public void beginSession() {
- getPaintSurface().setStatusMessage(PaintPlugin.getResourceString(
- "session.Text.message"));
- }
-
- /**
- * Deactivates the tool.
- */
- public void endSession() {
- getPaintSurface().clearRubberbandSelection();
- }
-
- /**
- * Aborts the current operation.
- */
- public void resetSession() {
- getPaintSurface().clearRubberbandSelection();
- }
-
- /**
- * Handles a mouseDown event.
- *
- * @param event the mouse event detail information
- */
- public void mouseDown(MouseEvent event) {
- if (event.button == 1) {
- // draw with left mouse button
- getPaintSurface().commitRubberbandSelection();
- } else {
- // set text with right mouse button
- getPaintSurface().clearRubberbandSelection();
- InputDialog inputDialog = new InputDialog(getPaintSurface().getShell(),
- PaintPlugin.getResourceString("tool.Text.dialog.title"),
- PaintPlugin.getResourceString("tool.Text.dialog.message"),
- drawText, null);
- inputDialog.setBlockOnOpen(true);
- inputDialog.open();
- if (inputDialog.getReturnCode() == InputDialog.OK) drawText = inputDialog.getValue();
- inputDialog.close();
- }
- }
-
- /**
- * Handles a mouseDoubleClick event.
- *
- * @param event the mouse event detail information
- */
- public void mouseDoubleClick(MouseEvent event) {
- }
-
- /**
- * Handles a mouseUp event.
- *
- * @param event the mouse event detail information
- */
- public void mouseUp(MouseEvent event) {
- }
-
- /**
- * Handles a mouseMove event.
- *
- * @param event the mouse event detail information
- */
- public void mouseMove(MouseEvent event) {
- final PaintSurface ps = getPaintSurface();
- ps.setStatusCoord(ps.getCurrentPosition());
- ps.clearRubberbandSelection();
- ps.addRubberbandSelection(
- new TextFigure(settings.commonForegroundColor, settings.commonFont,
- drawText, event.x, event.y));
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/ToolSettings.java b/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/ToolSettings.java
deleted file mode 100755
index 6d41a27dd8..0000000000
--- a/examples/org.eclipse.swt.examples.paint/org/eclipse/swt/examples/paint/ToolSettings.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.eclipse.swt.examples.paint;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
- import org.eclipse.swt.*; import org.eclipse.swt.graphics.*;
- /** * Tool Settings objects group tool-related configuration information. */
-public class ToolSettings {
- public static final int ftNone = 0, ftOutline = 1, ftSolid = 2; /**
- * commonForegroundColor: current tool foreground colour
- */
- public Color commonForegroundColor;
-
- /**
- * commonBackgroundColor: current tool background colour
- */
- public Color commonBackgroundColor;
- /** * commonFont: current font */ public Font commonFont; /** * commonFillType: current fill type * <p>One of ftNone, ftOutline, ftSolid.</p> */ public int commonFillType = ftNone; /** * commonLineStyle: current line type */ public int commonLineStyle = SWT.LINE_SOLID;
- /**
- * airbrushRadius: coverage radius in pixels
- */
- public int airbrushRadius = 10;
-
- /**
- * airbrushIntensity: average surface area coverage in region defined by radius per "jot"
- */
- public int airbrushIntensity = 30; /** * roundedRectangleCornerDiameter: the diameter of curvature of corners in a rounded rectangle */ public int roundedRectangleCornerDiameter = 16; }
diff --git a/examples/org.eclipse.swt.examples.paint/plugin.properties b/examples/org.eclipse.swt.examples.paint/plugin.properties
deleted file mode 100755
index 230cd503ea..0000000000
--- a/examples/org.eclipse.swt.examples.paint/plugin.properties
+++ /dev/null
@@ -1,123 +0,0 @@
-plugin.SWTPaintExample.name = SWT Paint Example Plugin
-category.SWTExamples.name = SWT Examples
-view.PaintExample.name = Paint
-
-launchcategory.SWTViewExamples.name = Workbench Views
-launchcategory.SWTViewExamples.description = \
- A collection of Standard Widget Toolkit examples that run as Views inside the Workbench. \
- These examples will create a new View in the current Perspective.
-
-launchitem.PaintExample.name = Paint
-launchitem.PaintExample.description = \
- This example demonstrates the use of SWT graphics operations in the form of a \
- rudimentary bitmap painting program. The Airbrush Tool implementation also
- demonstrates a mechanism for managing timed GUI operations in the background
- that are triggered by user input (see ContinuousPaintSession.java).\n\n\
- Select a tool with which to draw in the drawing area. There are a number of tools \
- to choose from on the toolbar. To change the color selection, click on a color in the \
- palette below the drawing area: left-click for the foreground color, right-click for the \
- background color.\n\n\
- Uses SWT's GC and FontDialog, and JFace's InputDialog and action set support.
-
-menu.Tools.label = Tools
-menu.Options.label = Options
-
-tool.Pencil.label = Pencil
-tool.Pencil.tooltip = Pencil tool
-tool.Pencil.image = icons/tool_pencil.gif
-tool.Pencil.description = Selects the Pencil tool.
-
-tool.Airbrush.label = Airbrush
-tool.Airbrush.tooltip = Airbrush tool
-tool.Airbrush.image = icons/tool_airbrush.gif
-tool.Airbrush.description = Selects the Airbrush tool.
-
-tool.Line.label = Line
-tool.Line.tooltip = Line tool
-tool.Line.image = icons/tool_line.gif
-tool.Line.description = Selects the Line tool.
-
-tool.PolyLine.label = Polygon
-tool.PolyLine.tooltip = Polygon tool
-tool.PolyLine.image = icons/tool_polyline.gif
-tool.PolyLine.description = Selects the PolyLine tool.
-
-tool.Rectangle.label = Rectangle
-tool.Rectangle.tooltip = Rectangle tool
-tool.Rectangle.image = icons/tool_rectangle.gif
-tool.Rectangle.description = Selects the Rectangle tool.
-
-tool.Ellipse.label = Ellipse
-tool.Ellipse.tooltip = Ellipse tool
-tool.Ellipse.image = icons/tool_ellipse.gif
-tool.Ellipse.description = Selects the Ellipse tool.
-
-tool.RoundedRectangle.label = Rounded Rectangle
-tool.RoundedRectangle.tooltip = Rounded Rectangle
-tool.RoundedRectangle.image = icons/tool_roundedrectangle.gif
-tool.RoundedRectangle.description = Selects the Rounded Rectangle tool.
-
-tool.Text.label = Text
-tool.Text.tooltip = Text tool
-tool.Text.image = icons/tool_text.gif
-tool.Text.description = Selects the Text tool.
-tool.Text.settings.defaulttext = Hello!
-tool.Text.dialog.title = Text Tool Settings
-tool.Text.dialog.message = Please enter the new text string to be painted.
-
-tool.Null.label = <none>
-
-fill.None.label = No Fill
-fill.None.tooltip = No fill mode
-fill.None.image = icons/fill_none.gif
-fill.None.description = Selects No Fill mode.
-
-fill.Outline.label = Outline Fill
-fill.Outline.tooltip = Outline fill mode
-fill.Outline.image = icons/fill_outline.gif
-fill.Outline.description = Selects Outline Fill mode.
-
-fill.Solid.label = Solid Fill
-fill.Solid.tooltip = Solid fill mode
-fill.Solid.image = icons/fill_solid.gif
-fill.Solid.description = Selects Solid Fill mode.
-
-linestyle.Solid.label = Solid Line
-linestyle.Solid.tooltip = Solid line style
-linestyle.Solid.image = icons/linestyle_solid.gif
-linestyle.Solid.description = Select Solid Line style.
-
-linestyle.Dot.label = Dotted Line
-linestyle.Dot.tooltip = Dotted line style
-linestyle.Dot.image = icons/linestyle_dot.gif
-linestyle.Dot.description = Select Dotted Line style.
-
-linestyle.Dash.label = Dashed Line
-linestyle.Dash.tooltip = Dashed line style
-linestyle.Dash.image = icons/linestyle_dash.gif
-linestyle.Dash.description = Select Dashed Line style.
-
-linestyle.DashDot.label = Dash-Dot Line
-linestyle.DashDot.tooltip = Dash-Dot line style
-linestyle.DashDot.image = icons/linestyle_dashdot.gif
-linestyle.DashDot.description = Select Dash-Dot Line style.
-
-options.Font.label = Text Tool Font
-options.Font.tooltip = Select Text Tool font
-options.Font.image = icons/options_font.gif
-options.Font.description = Selects Text Tool font.
-options.Font.dialog.title = Text Tool Font
-
-settings.AirbrushRadius.text = Airbrush Radius
-settings.AirbrushIntensity.text = Airbrush Intensity
-
-session.Null.message = Select a tool...
-session.ContinuousPaint.message = Click and drag to draw...
-session.DragInteractivePaint.message = Click and drag to preview, release to draw, right-click to cancel...
-session.SegmentedInteractivePaint.message.anchorMode = Click to set anchor...
-session.SegmentedInteractivePaint.message.interactiveMode = Click to draw, double-click to close figure, right-click to cancel...
-session.Text.message = Click to draw text, right-click to edit text...
-
-status.Coord.format = ({0}, {1})
-status.CoordRange.format = ({0}, {1}) - ({2}, {3})
-status.Bar.format = {0} : {1} {2}
diff --git a/examples/org.eclipse.swt.examples.paint/plugin.xml b/examples/org.eclipse.swt.examples.paint/plugin.xml
deleted file mode 100755
index 5547648dd7..0000000000
--- a/examples/org.eclipse.swt.examples.paint/plugin.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- File written by PDE 1.0 -->
-<plugin
- id="org.eclipse.swt.examples.paint"
- name="%plugin.SWTPaintExample.name"
- version="2.0"
- provider-name="Object Technology International, Inc."
- class="org.eclipse.swt.examples.paint.PaintPlugin">
-<!-- Required plugins -->
-<requires>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.swt"/>
-</requires>
-
-<!-- Runtime -->
-<!-- Runtime -->
-<runtime>
- <library name="paint.jar"/>
-</runtime>
-
-<!-- Extensions -->
-<!-- Extension points -->
-<extension
- point="org.eclipse.ui.views">
- <view
- name="%view.PaintExample.name"
- icon="icons/paint_example.gif"
- category="org.eclipse.swt.examples.category"
- class="org.eclipse.swt.examples.paint.PaintView"
- id="org.eclipse.swt.examples.paint.view">
- </view>
-</extension>
-<extension
- point="org.eclipse.swt.examples.launcher.launchItems">
- <category
- name="%launchcategory.SWTViewExamples.name"
- description="%launchcategory.SWTViewExamples.description"
- id="org.eclipse.swt.examples.launchViewCategory">
- </category>
- <item
- name="%launchitem.PaintExample.name"
- icon="icons/paint_example.gif"
- description="%launchitem.PaintExample.description"
- category="org.eclipse.swt.examples.launchViewCategory"
- id="org.eclipse.swt.examples.paint.viewlauncher">
- <view
- viewId="org.eclipse.swt.examples.paint.view">
- </view>
- <source
- zip="paintsrc.zip">
- </source>
- </item>
-</extension>
-</plugin>
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/AirbrushTool.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/AirbrushTool.java
deleted file mode 100755
index 8eeabb9920..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/AirbrushTool.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import java.util.Random; import org.eclipse.swt.graphics.*;
-
-/**
- * An airbrush tool.
- */
-public class AirbrushTool extends ContinuousPaintSession implements PaintTool {
- private ToolSettings settings;
- private Random random;
- private int cachedRadiusSquared;
- private int cachedNumPoints;
-
- /**
- * Constructs a Tool.
- *
- * @param toolSettings the new tool settings
- * @param paintSurface the PaintSurface we will render on.
- */
- public AirbrushTool(ToolSettings toolSettings, PaintSurface paintSurface) {
- super(paintSurface);
- random = new Random();
- setRetriggerTimer(10);
- set(toolSettings);
- }
-
- /**
- * Sets the tool's settings.
- *
- * @param toolSettings the new tool settings
- */
- public void set(ToolSettings toolSettings) {
- // compute things we need to know for drawing
- settings = toolSettings;
- cachedRadiusSquared = settings.airbrushRadius * settings.airbrushRadius;
- cachedNumPoints = 314 * settings.airbrushIntensity * cachedRadiusSquared / 250000;
- if (cachedNumPoints == 0 && settings.airbrushIntensity != 0)
- cachedNumPoints = 1;
- }
-
- /**
- * Returns the name associated with this tool.
- *
- * @return the localized name of this tool
- */
- public String getDisplayName() {
- return PaintPlugin.getResourceString("tool.Airbrush.label");
- }
-
- /*
- * Template method for drawing
- */
- protected void render(Point point) {
- // Draws a bunch (cachedNumPoints) of random pixels within a specified circle (cachedRadiusSquared).
- ContainerFigure cfig = new ContainerFigure();
-
- for (int i = 0; i < cachedNumPoints; ++i) {
- int randX, randY;
- do {
- randX = (int) ((random.nextDouble() - 0.5) * settings.airbrushRadius * 2.0);
- randY = (int) ((random.nextDouble() - 0.5) * settings.airbrushRadius * 2.0);
- } while (randX * randX + randY * randY > cachedRadiusSquared);
- cfig.add(new PointFigure(settings.commonForegroundColor, point.x + randX, point.y + randY));
- }
- getPaintSurface().drawFigure(cfig);
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/BasicPaintSession.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/BasicPaintSession.java
deleted file mode 100755
index 0af229175a..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/BasicPaintSession.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-public abstract class BasicPaintSession implements PaintSession {
- /** * The paint surface */ private PaintSurface paintSurface; /** * Constructs a PaintSession. * * @param paintSurface the drawing surface to use */ protected BasicPaintSession(PaintSurface paintSurface) { this.paintSurface = paintSurface; } /**
- * Returns the paint surface associated with this paint session. * * @return the associated PaintSurface */ public PaintSurface getPaintSurface() { return paintSurface; } }
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/ContainerFigure.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/ContainerFigure.java
deleted file mode 100755
index 0c2d64996a..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/ContainerFigure.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.graphics.*;
-
-/**
- * Container for Figure objects with stacking preview mechanism.
- */
-public class ContainerFigure extends Figure {
- private static final int INITIAL_ARRAY_SIZE = 16;
-
- Figure[] objectStack = null;
- int nextIndex = 0;
-
- /**
- * Constructs an empty Container
- */
- public ContainerFigure() {
- }
- /**
- * Adds an object to the container for later drawing.
- *
- * @param object the object to add to the drawing list
- */
- public void add(Figure object) {
- if (objectStack == null) {
- objectStack = new Figure[INITIAL_ARRAY_SIZE];
- } else if (objectStack.length <= nextIndex) {
- Figure[] newObjectStack = new Figure[objectStack.length * 2];
- System.arraycopy(objectStack, 0, newObjectStack, 0, objectStack.length);
- objectStack = newObjectStack;
- }
- objectStack[nextIndex] = object;
- ++nextIndex;
- }
- /**
- * Determines if the container is empty.
- * @return true if the container is empty
- */
- public boolean isEmpty() {
- return nextIndex == 0;
- }
- /**
- * Adds an object to the container and draws its preview then updates the supplied preview state.
- *
- * @param object the object to add to the drawing list
- * @param gc the GC to draw on
- * @param offset the offset to add to virtual coordinates to get display coordinates
- * @param rememberedState the state returned by a previous drawPreview() or addAndPreview()
- * using this Container, may be null if there was no such previous call
- * @return object state that must be passed to erasePreview() later to erase this object
- */
-// public Object addAndPreview(Figure object, GC gc, Point offset, Object rememberedState) {
-// Object[] stateStack = (Object[]) rememberedState;
-// if (stateStack == null) {
-// stateStack = new Object[INITIAL_ARRAY_SIZE];
-// } else if (stateStack.length <= nextIndex) {
-// Object[] newStateStack = new Object[stateStack.length * 2];
-// System.arraycopy(stateStack, 0, newStateStack, 0, stateStack.length);
-// stateStack = newStateStack;
-// }
-// add(object);
-// stateStack[nextIndex - 1] = object.drawPreview(gc, offset);
-// return stateStack;
-// }
- /**
- * Clears the container.
- * <p>
- * Note that erasePreview() cannot be called after this point to erase any previous
- * drawPreview()'s.
- * </p>
- */
- public void clear() {
- while (--nextIndex > 0) objectStack[nextIndex] = null;
- nextIndex = 0;
- }
- public void draw(FigureDrawContext fdc) {
- for (int i = 0; i < nextIndex; ++i) objectStack[i].draw(fdc);
- }
- public void addDamagedRegion(FigureDrawContext fdc, Region region) {
- for (int i = 0; i < nextIndex; ++i) objectStack[i].addDamagedRegion(fdc, region);
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/ContinuousPaintSession.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/ContinuousPaintSession.java
deleted file mode 100755
index 22aa5eb1d9..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/ContinuousPaintSession.java
+++ /dev/null
@@ -1,226 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.events.*; import org.eclipse.swt.graphics.*; import org.eclipse.swt.widgets.*;
-
-/**
- * The superclass for paint tools that draw continuously along the path
- * traced by the mouse's movement while the button is depressed
- */
-public abstract class ContinuousPaintSession extends BasicPaintSession {
- /**
- * True if a click-drag is in progress.
- */
- private boolean dragInProgress = false;
-
- /**
- * A cached Point array for drawing.
- */
- private Point[] points = new Point[] { new Point(-1, -1), new Point(-1, -1) };
-
- /**
- * The time to wait between retriggers in milliseconds.
- */
- private int retriggerInterval = 0;
-
- /**
- * The currently valid RetriggerHandler
- */
- protected Runnable retriggerHandler = null;
-
- /**
- * Constructs a ContinuousPaintSession.
- *
- * @param paintSurface the drawing surface to use
- */
- protected ContinuousPaintSession(PaintSurface paintSurface) {
- super(paintSurface);
- }
-
- /**
- * Sets the retrigger timer.
- * <p>
- * After the timer elapses, if the mouse is still hovering over the same point with the
- * drag button pressed, a new render order is issued and the timer is restarted.
- * </p>
- * @param interval the time in milliseconds to wait between retriggers, 0 to disable
- */
- public void setRetriggerTimer(int interval) {
- retriggerInterval = interval;
- }
-
- /**
- * Activates the tool.
- */
- public void beginSession() {
- getPaintSurface().
- setStatusMessage(PaintPlugin.getResourceString("session.ContinuousPaint.message"));
- dragInProgress = false;
- }
-
- /**
- * Deactivates the tool.
- */
- public void endSession() {
- abortRetrigger();
- }
-
- /**
- * Aborts the current operation.
- */
- public void resetSession() {
- abortRetrigger();
- }
-
- /**
- * Handles a mouseDown event.
- *
- * @param event the mouse event detail information
- */
- public final void mouseDown(MouseEvent event) {
- if (event.button != 1) return;
- if (dragInProgress) return; // spurious event
- dragInProgress = true;
-
- points[0].x = event.x;
- points[0].y = event.y;
- render(points[0]);
- prepareRetrigger();
- }
-
- /**
- * Handles a mouseDoubleClick event.
- *
- * @param event the mouse event detail information
- */
- public final void mouseDoubleClick(MouseEvent event) {
- }
-
- /**
- * Handles a mouseUp event.
- *
- * @param event the mouse event detail information
- */
- public final void mouseUp(MouseEvent event) {
- if (event.button != 1) return;
- if (! dragInProgress) return; // spurious event
- abortRetrigger();
- mouseSegmentFinished(event);
- dragInProgress = false;
- }
-
- /**
- * Handles a mouseMove event.
- *
- * @param event the mouse event detail information
- */
- public final void mouseMove(MouseEvent event) {
- final PaintSurface ps = getPaintSurface();
- ps.setStatusCoord(ps.getCurrentPosition());
- if (! dragInProgress) return;
- mouseSegmentFinished(event);
- prepareRetrigger();
- }
-
- /**
- * Handle a rendering segment
- *
- * @param event the mouse event detail information
- */
- private final void mouseSegmentFinished(MouseEvent event) {
- if (points[0].x == -1) return; // spurious event
- if (points[0].x != event.x || points[0].y != event.y) {
- // draw new segment
- points[1].x = event.x;
- points[1].y = event.y;
- renderContinuousSegment();
- }
- }
-
- /**
- * Draws a continuous segment from points[0] to points[1].
- * Assumes points[0] has been drawn already.
- *
- * @post points[0] will refer to the same point as points[1]
- */
- protected void renderContinuousSegment() {
- /* A lazy but effective line drawing algorithm */
- final int dX = points[1].x - points[0].x;
- final int dY = points[1].y - points[0].y;
- int absdX = Math.abs(dX);
- int absdY = Math.abs(dY);
-
- if ((dX == 0) && (dY == 0)) return;
-
- if (absdY > absdX) {
- final int incfpX = (dX << 16) / absdY;
- final int incY = (dY > 0) ? 1 : -1;
- int fpX = points[0].x << 16; // X in fixedpoint format
-
- while (--absdY >= 0) {
- points[0].y += incY;
- points[0].x = (fpX += incfpX) >> 16;
- render(points[0]);
- }
- if (points[0].x == points[1].x) return;
- points[0].x = points[1].x;
- } else {
- final int incfpY = (dY << 16) / absdX;
- final int incX = (dX > 0) ? 1 : -1;
- int fpY = points[0].y << 16; // Y in fixedpoint format
-
- while (--absdX >= 0) {
- points[0].x += incX;
- points[0].y = (fpY += incfpY) >> 16;
- render(points[0]);
- }
- if (points[0].y == points[1].y) return;
- points[0].y = points[1].y;
- }
- render(points[0]);
- }
-
- /**
- * Prepare the retrigger timer
- */
- private final void prepareRetrigger() {
- if (retriggerInterval > 0) {
- /*
- * timerExec() provides a lightweight mechanism for running code at intervals from within
- * the event loop when timing accuracy is not important.
- *
- * Since it is not possible to cancel a timerExec(), we remember the Runnable that is
- * active in order to distinguish the valid one from the stale ones. In practice,
- * if the interval is 1/100th of a second, then creating a few hundred new RetriggerHandlers
- * each second will not cause a significant performance hit.
- */
- Display display = getPaintSurface().getDisplay();
- retriggerHandler = new Runnable() {
- public void run() {
- if (retriggerHandler == this) {
- render(points[0]);
- prepareRetrigger();
- }
- }
- };
- display.timerExec(retriggerInterval, retriggerHandler);
- }
- }
-
- /**
- * Aborts the retrigger timer
- */
- private final void abortRetrigger() {
- retriggerHandler = null;
- }
-
- /**
- * Template method: Renders a point.
- * @param point, the point to render
- */
- protected abstract void render(Point point);
-}
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/DragPaintSession.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/DragPaintSession.java
deleted file mode 100755
index 78b9fe6bd7..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/DragPaintSession.java
+++ /dev/null
@@ -1,129 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.graphics.*;
-
-/**
- * The superclass for paint tools that use click-drag-release motions to
- * draw objects.
- */
-public abstract class DragPaintSession extends BasicPaintSession {
- /**
- * True if a click-drag is in progress
- */
- private boolean dragInProgress = false;
-
- /**
- * The position of the first click in a click-drag
- */
- private Point anchorPosition = new Point(-1, -1);
-
- /**
- * A temporary point
- */
- private Point tempPosition = new Point(-1, -1);
-
- /**
- * Constructs a PaintSession.
- *
- * @param getPaintSurface() the drawing surface to use
- */
- protected DragPaintSession(PaintSurface paintSurface) {
- super(paintSurface);
- }
-
- /**
- * Activates the tool.
- */
- public void beginSession() {
- getPaintSurface().
- setStatusMessage(PaintPlugin.getResourceString("session.DragInteractivePaint.message"));
- anchorPosition.x = -1;
- dragInProgress = false;
- }
-
- /**
- * Deactivates the tool.
- */
- public void endSession() {
- }
-
- /**
- * Resets the tool.
- * Aborts any operation in progress.
- */
- public void resetSession() {
- getPaintSurface().clearRubberbandSelection();
- anchorPosition.x = -1;
- dragInProgress = false;
- }
-
- /**
- * Handles a mouseDown event.
- *
- * @param event the mouse event detail information
- */
- public void mouseDown(MouseEvent event) {
- if (event.button != 1) return;
- if (dragInProgress) return; // spurious event
- dragInProgress = true;
-
- anchorPosition.x = event.x;
- anchorPosition.y = event.y;
- }
-
- /**
- * Handles a mouseDoubleClick event.
- *
- * @param event the mouse event detail information
- */
- public void mouseDoubleClick(MouseEvent event) {
- }
-
- /**
- * Handles a mouseUp event.
- *
- * @param event the mouse event detail information
- */
- public void mouseUp(MouseEvent event) {
- if (event.button != 1) {
- resetSession(); // abort if right or middle mouse button pressed
- return;
- }
- if (! dragInProgress) return; // spurious event
- dragInProgress = false;
- if (anchorPosition.x == -1) return; // spurious event
-
- getPaintSurface().commitRubberbandSelection();
- }
-
- /**
- * Handles a mouseMove event.
- *
- * @param event the mouse event detail information
- */
- public void mouseMove(MouseEvent event) {
- final PaintSurface ps = getPaintSurface();
- if (! dragInProgress) {
- ps.setStatusCoord(ps.getCurrentPosition());
- return;
- }
- ps.setStatusCoordRange(anchorPosition, ps.getCurrentPosition());
- ps.clearRubberbandSelection();
- tempPosition.x = event.x;
- tempPosition.y = event.y;
- ps.addRubberbandSelection(createFigure(anchorPosition, tempPosition));
- }
-
- /**
- * Template Method: Creates a Figure for drawing rubberband entities and the final product
- *
- * @param anchor the anchor point
- * @param cursor the point marking the current pointer location
- */
- protected abstract Figure createFigure(Point anchor, Point cursor);
-}
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/EllipseFigure.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/EllipseFigure.java
deleted file mode 100755
index 0fcd6ae284..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/EllipseFigure.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-
-/**
- * 2D Ellipse object
- */
-public class EllipseFigure extends Figure {
- private Color foregroundColor, backgroundColor;
- private int lineStyle, x1, y1, x2, y2;
- /**
- * Constructs an Ellipse
- * These objects are defined by any two diametrically opposing corners of a box
- * bounding the ellipse.
- *
- * @param color the color for this object
- * @param lineStyle the line style for this object
- * @param x1 the virtual X coordinate of the first corner
- * @param y1 the virtual Y coordinate of the first corner
- * @param x2 the virtual X coordinate of the second corner
- * @param y2 the virtual Y coordinate of the second corner
- */
- public EllipseFigure(Color foregroundColor, Color backgroundColor, int lineStyle, int x1, int y1, int x2, int y2) {
- this.foregroundColor = foregroundColor;
- this.backgroundColor = backgroundColor;
- this.lineStyle = lineStyle;
- this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2;
- }
- public void draw(FigureDrawContext fdc) {
- Rectangle r = fdc.toClientRectangle(x1, y1, x2, y2);
- fdc.gc.setForeground(foregroundColor);
- fdc.gc.setBackground(backgroundColor);
- fdc.gc.setLineStyle(lineStyle);
- fdc.gc.drawOval(r.x, r.y, r.width - 1, r.height - 1);
- fdc.gc.setLineStyle(SWT.LINE_SOLID);
- }
- public void addDamagedRegion(FigureDrawContext fdc, Region region) {
- region.add(fdc.toClientRectangle(x1, y1, x2, y2));
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/EllipseTool.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/EllipseTool.java
deleted file mode 100755
index ced0b873b8..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/EllipseTool.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.graphics.*;
-
-/**
- * A drawing tool.
- */
-public class EllipseTool extends DragPaintSession implements PaintTool {
- private ToolSettings settings;
-
- /**
- * Constructs a EllipseTool.
- *
- * @param toolSettings the new tool settings
- * @param paintSurface the PaintSurface we will render on.
- */
- public EllipseTool(ToolSettings toolSettings, PaintSurface paintSurface) {
- super(paintSurface);
- set(toolSettings);
- }
-
- /**
- * Sets the tool's settings.
- *
- * @param toolSettings the new tool settings
- */
- public void set(ToolSettings toolSettings) {
- settings = toolSettings;
- }
-
- /**
- * Returns name associated with this tool.
- *
- * @return the localized name of this tool
- */
- public String getDisplayName() {
- return PaintPlugin.getResourceString("tool.Ellipse.label");
- }
-
- /*
- * Template methods for drawing
- */
- protected Figure createFigure(Point a, Point b) {
- ContainerFigure container = new ContainerFigure();
- if (settings.commonFillType != ToolSettings.ftNone)
- container.add(new SolidEllipseFigure(settings.commonBackgroundColor, a.x, a.y, b.x, b.y));
- if (settings.commonFillType != ToolSettings.ftSolid)
- container.add(new EllipseFigure(settings.commonForegroundColor, settings.commonBackgroundColor, settings.commonLineStyle,
- a.x, a.y, b.x, b.y));
- return container;
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/Figure.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/Figure.java
deleted file mode 100755
index 9a57aa5aa8..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/Figure.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.graphics.*;
-
-/**
- * Superinterface for all drawing objects.
- * All drawing objects know how to render themselved to the screen and can draw a
- * temporary version of themselves for previewing the general appearance of the
- * object onscreen before it gets committed.
- */
-public abstract class Figure {
- /**
- * Draws this object.
- *
- * @param fdc a parameter block specifying drawing-related information
- */
- public abstract void draw(FigureDrawContext fdc);
-
- /**
- * Computes the damaged screen region caused by drawing this object (imprecise), then
- * appends it to the supplied region.
- *
- * @param fdc a parameter block specifying drawing-related information
- * @param region a region to which additional damage areas will be added
- */
- public abstract void addDamagedRegion(FigureDrawContext fdc, Region region);
-}
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/FigureDrawContext.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/FigureDrawContext.java
deleted file mode 100644
index eda60d25b8..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/FigureDrawContext.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.graphics.*;
-
-public class FigureDrawContext {
- /*
- * <p>
- * The GC must be set up as follows
- * (it will be returned to this state upon completion of drawing operations)
- * <ul>
- * <li>setXORMode(false)
- * </ul>
- * </p>
- */
- public GC gc = null;
- public int xOffset = 0, yOffset = 0; // substract to get GC coords
- public int xScale = 1, yScale = 1;
-
- public Rectangle toClientRectangle(int x1, int y1, int x2, int y2) {
- return new Rectangle(
- Math.min(x1, x2) * xScale - xOffset,
- Math.min(y1, y2) * yScale - yOffset,
- (Math.abs(x2 - x1) + 1) * xScale,
- (Math.abs(y2 - y1) + 1) * yScale);
- }
- public Point toClientPoint(int x, int y) {
- return new Point(x * xScale - xOffset, y * yScale - yOffset);
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/LineFigure.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/LineFigure.java
deleted file mode 100755
index de71910f76..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/LineFigure.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-
-/**
- * 2D Line object
- */
-public class LineFigure extends Figure {
- private Color foregroundColor, backgroundColor;
- private int lineStyle, x1, y1, x2, y2;
- /**
- * Constructs a Line
- * These objects are defined by their two end-points.
- *
- * @param color the color for this object
- * @param lineStyle the line style for this object
- * @param x1 the virtual X coordinate of the first end-point
- * @param y1 the virtual Y coordinate of the first end-point
- * @param x2 the virtual X coordinate of the second end-point
- * @param y2 the virtual Y coordinate of the second end-point
- */
- public LineFigure(Color foregroundColor, Color backgroundColor, int lineStyle, int x1, int y1, int x2, int y2) {
- this.foregroundColor = foregroundColor;
- this.backgroundColor = backgroundColor;
- this.lineStyle = lineStyle;
- this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2;
- }
- public void draw(FigureDrawContext fdc) {
- Point p1 = fdc.toClientPoint(x1, y1);
- Point p2 = fdc.toClientPoint(x2, y2);
- fdc.gc.setForeground(foregroundColor);
- fdc.gc.setBackground(backgroundColor);
- fdc.gc.setLineStyle(lineStyle);
- fdc.gc.drawLine(p1.x, p1.y, p2.x, p2.y);
- fdc.gc.setLineStyle(SWT.LINE_SOLID);
- }
- public void addDamagedRegion(FigureDrawContext fdc, Region region) {
- region.add(fdc.toClientRectangle(x1, y1, x2, y2));
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/LineTool.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/LineTool.java
deleted file mode 100755
index f969d24911..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/LineTool.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.graphics.*;
-
-/**
- * A line drawing tool
- */
-public class LineTool extends DragPaintSession implements PaintTool {
- private ToolSettings settings;
-
- /**
- * Constructs a LineTool.
- *
- * @param toolSettings the new tool settings
- * @param paintSurface the PaintSurface we will render on.
- */
- public LineTool(ToolSettings toolSettings, PaintSurface paintSurface) {
- super(paintSurface);
- set(toolSettings);
- }
-
- /**
- * Sets the tool's settings.
- *
- * @param toolSettings the new tool settings
- */
- public void set(ToolSettings toolSettings) {
- settings = toolSettings;
- }
-
- /**
- * Returns name associated with this tool.
- *
- * @return the localized name of this tool
- */
- public String getDisplayName() {
- return PaintPlugin.getResourceString("tool.Line.label");
- }
-
- /*
- * Template methods for drawing
- */
- protected Figure createFigure(Point a, Point b) {
- return new LineFigure(settings.commonForegroundColor, settings.commonBackgroundColor, settings.commonLineStyle,
- a.x, a.y, b.x, b.y);
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintPlugin.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintPlugin.java
deleted file mode 100755
index 6e17722f39..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintPlugin.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.ui.plugin.*;
-
-import java.text.*;
-import java.util.*;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class PaintPlugin extends AbstractUIPlugin {
- //The shared instance.
- private static PaintPlugin plugin;
- private static ResourceBundle resourceBundle;
-
- /**
- * Constructs the Paint plugin.
- */
- public PaintPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- plugin = this;
- resourceBundle = descriptor.getResourceBundle();
- }
-
- /**
- * Returns the shared instance.
- */
- public static PaintPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Log an error to the ILog for this plugin
- *
- * @param message the localized error message text
- * @param exception the associated exception, or null
- */
- public static void logError(String message, Throwable exception) {
- plugin.getLog().log(new Status(IStatus.ERROR, plugin.getDescriptor().getUniqueIdentifier(),
- 0, message, exception));
- }
-
- /**
- * Returns a string from the resource bundle.
- * We don't want to crash because of a missing String.
- * Returns the key if not found.
- */
- public static String getResourceString(String key) {
- try {
- return resourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return key;
- } catch (NullPointerException e) {
- return "!" + key + "!";
- }
- }
-
- /**
- * Returns a string from the resource bundle and binds it
- * with the given arguments. If the key is not found,
- * return the key.
- */
- public static String getResourceString(String key, Object[] args) {
- try {
- return MessageFormat.format(getResourceString(key), args);
- } catch (MissingResourceException e) {
- return key;
- } catch (NullPointerException e) {
- return "!" + key + "!";
- }
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintSession.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintSession.java
deleted file mode 100755
index a688ed8d94..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintSession.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.events.*;
-
-/**
- * Manages an interactive paint session.
- * Note that the coordinates received via the listener interfaces are virtualized to zero-origin
- * relative to the painting surface.
- */
-public interface PaintSession extends MouseListener, MouseMoveListener {
- /**
- * Returns the paint surface associated with this paint session
- *
- * @return the associated PaintSurface
- */
- public PaintSurface getPaintSurface();
-
- /**
- * Activates the session.
- *
- * Note: When overriding this method, call super.beginSession() at method start.
- */
- public abstract void beginSession();
-
- /**
- * Deactivates the session.
- *
- * Note: When overriding this method, call super.endSession() at method exit.
- */
- public abstract void endSession();
-
- /**
- * Resets the session.
- * Aborts any operation in progress.
- *
- * Note: When overriding this method, call super.resetSession() at method exit.
- */
- public abstract void resetSession();
-
-
- /**
- * Returns the name associated with this tool.
- *
- * @return the localized name of this tool
- */
- public String getDisplayName();
-}
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintSurface.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintSurface.java
deleted file mode 100755
index 5cd1827e42..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintSurface.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.eclipse.swt.examples.paint;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
- import org.eclipse.swt.events.*; import org.eclipse.swt.graphics.*; import org.eclipse.swt.widgets.*;
- /** * Manages a simple drawing surface. */
-public class PaintSurface { private Point currentPosition = new Point(0, 0);
- private Canvas paintCanvas; private PaintSession paintSession; private Image image; private Image paintImage; // buffer for refresh blits private int imageWidth, imageHeight; private int visibleWidth, visibleHeight; private FigureDrawContext displayFDC = new FigureDrawContext(); private FigureDrawContext imageFDC = new FigureDrawContext(); private FigureDrawContext paintFDC = new FigureDrawContext(); /* Rubberband */ private ContainerFigure rubberband = new ContainerFigure(); // the active rubberband selection private int rubberbandHiddenNestingCount = 0; // always >= 0, if > 0 rubberband has been hidden /* Status */ private Text statusText; private String statusActionInfo, statusMessageInfo, statusCoordInfo; /** * Constructs a PaintSurface. * <p> * paintCanvas must have SWT.NO_REDRAW_RESIZE and SWT.NO_BACKGROUND styles, * and may have SWT.V_SCROLL and/or SWT.H_SCROLL. * </p> * @param paintCanvas the Canvas object in which to render * @param paintStatus the PaintStatus object to use for providing user feedback * @param fillColor the color to fill the canvas with initially */
- public PaintSurface(Canvas paintCanvas, Text statusText, Color fillColor) { this.paintCanvas = paintCanvas; this.statusText = statusText; clearStatus(); /* Set up the drawing surface */ Rectangle displayRect = paintCanvas.getDisplay().getClientArea(); imageWidth = displayRect.width; imageHeight = displayRect.height; image = new Image(paintCanvas.getDisplay(), imageWidth, imageHeight); imageFDC.gc = new GC(image); imageFDC.gc.setBackground(fillColor); imageFDC.gc.fillRectangle(0, 0, imageWidth, imageHeight); displayFDC.gc = new GC(paintCanvas); /* Initialize the session */ setPaintSession(null); /* Add our listeners */ paintCanvas.addMouseListener(new MouseAdapter() { public void mouseDown(MouseEvent event) { processMouseEventCoordinates(event); if (paintSession != null) paintSession.mouseDown(event); } public void mouseUp(MouseEvent event) { processMouseEventCoordinates(event); if (paintSession != null) paintSession.mouseUp(event); } public void mouseDoubleClick(MouseEvent event) { processMouseEventCoordinates(event); if (paintSession != null) paintSession.mouseDoubleClick(event); } }); paintCanvas.addMouseMoveListener(new MouseMoveListener() { public void mouseMove(MouseEvent event) { processMouseEventCoordinates(event); if (paintSession != null) paintSession.mouseMove(event); } }); paintCanvas.addPaintListener(new PaintListener() { public void paintControl(PaintEvent event) { if (rubberband.isEmpty()) { // Nothing to merge, so we just refresh event.gc.drawImage(image, displayFDC.xOffset + event.x, displayFDC.yOffset + event.y, event.width, event.height, event.x, event.y, event.width, event.height); } else { /* * Avoid flicker when merging overlayed objects by constructing the image on * a backbuffer first, then blitting it to the screen. */ // Check that the backbuffer is large enough if (paintImage != null) { Rectangle rect = paintImage.getBounds(); if ((event.width + event.x > rect.width) || (event.height + event.y > rect.height)) { paintFDC.gc.dispose(); paintImage.dispose(); paintImage = null; } } if (paintImage == null) { Display display = getDisplay(); Rectangle rect = display.getClientArea(); paintImage = new Image(display, Math.max(rect.width, event.width + event.x), Math.max(rect.height, event.height + event.y)); paintFDC.gc = new GC(paintImage); } // Setup clipping and the FDC Region clipRegion = new Region(); event.gc.getClipping(clipRegion); paintFDC.gc.setClipping(clipRegion); clipRegion.dispose(); paintFDC.xOffset = displayFDC.xOffset; paintFDC.yOffset = displayFDC.yOffset; paintFDC.xScale = displayFDC.xScale; paintFDC.yScale = displayFDC.yScale; // Merge the overlayed objects into the image, then blit paintFDC.gc.drawImage(image, displayFDC.xOffset + event.x, displayFDC.yOffset + event.y, event.width, event.height, event.x, event.y, event.width, event.height); rubberband.draw(paintFDC); event.gc.drawImage(paintImage, event.x, event.y, event.width, event.height, event.x, event.y, event.width, event.height); } } }); paintCanvas.addControlListener(new ControlAdapter() { public void controlResized(ControlEvent event) { handleResize(); } }); /* Set up the paint canvas scroll bars */ ScrollBar horizontal = paintCanvas.getHorizontalBar(); horizontal.setVisible(true); horizontal.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent event) { scrollHorizontally((ScrollBar)event.widget); } }); ScrollBar vertical = paintCanvas.getVerticalBar(); vertical.setVisible(true); vertical.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent event) { scrollVertically((ScrollBar)event.widget); } }); handleResize(); } /** * Disposes of the PaintSurface's resources. */ public void dispose() { imageFDC.gc.dispose(); displayFDC.gc.dispose(); image.dispose(); if (paintImage != null) { paintImage.dispose(); paintFDC.gc.dispose(); } currentPosition = null; paintCanvas = null; paintSession = null; image = null; paintImage = null; displayFDC = null; imageFDC = null; paintFDC = null; rubberband = null; statusText = null; statusActionInfo = null; statusMessageInfo = null; statusCoordInfo = null; } /** * Called when we must grab focus. */ public void setFocus() { paintCanvas.setFocus(); } /** * Returns the Display on which the PaintSurface resides. * @return the Display */ public Display getDisplay() { return paintCanvas.getDisplay(); } /** * Returns the Shell in which the PaintSurface resides. * @return the Shell */ public Shell getShell() { return paintCanvas.getShell(); } /**
- * Sets the current paint session. * <p>
- * If oldPaintSession != paintSession calls oldPaintSession.end() * and paintSession.begin() * </p> *
- * @param paintSession the paint session to activate; null to disable all sessions
- */
- public void setPaintSession(PaintSession paintSession) {
- if (this.paintSession != null) { if (this.paintSession == paintSession) return;
- this.paintSession.endSession(); }
- this.paintSession = paintSession;
- clearStatus(); if (paintSession != null) { setStatusAction(paintSession.getDisplayName()); paintSession.beginSession(); } else { setStatusAction(PaintPlugin.getResourceString("tool.Null.label")); setStatusMessage(PaintPlugin.getResourceString("session.Null.message")); } }
-
- /**
- * Returns the current paint session.
- *
- * @return the current paint session, null if none is active
- */
- public PaintSession getPaintSession() {
- return paintSession;
- }
- /** * Returns the current paint tool. * * @return the current paint tool, null if none is active (though some other session * might be) */ public PaintTool getPaintTool() { return (paintSession != null && paintSession instanceof PaintTool) ? (PaintTool)paintSession : null; } /** * Returns the current position in an interactive operation. * * @return the last known position of the pointer */ public Point getCurrentPosition() { return currentPosition; } /** * Draws a Figure object to the screen and to the backing store permanently. * * @param object the object to draw onscreen */ public void drawFigure(Figure object) { object.draw(imageFDC); object.draw(displayFDC); } /** * Adds a Figure object to the active rubberband selection. * <p> * This object will be drawn to the screen as a preview and refreshed appropriately * until the selection is either cleared or committed. * </p> * * @param object the object to add to the selection */ public void addRubberbandSelection(Figure object) { rubberband.add(object); if (! isRubberbandHidden()) object.draw(displayFDC); } /** * Clears the active rubberband selection. * <p> * Erases any rubberband objects on the screen then clears the selection. * </p> */ public void clearRubberbandSelection() { if (! isRubberbandHidden()) { Region region = new Region(); rubberband.addDamagedRegion(displayFDC, region); Rectangle r = region.getBounds(); paintCanvas.redraw(r.x, r.y, r.width, r.height, true); region.dispose(); } rubberband.clear(); } /** * Commits the active rubberband selection. * <p> * Redraws any rubberband objects on the screen as permanent objects then clears the selection. * </p> */ public void commitRubberbandSelection() { rubberband.draw(imageFDC); if (isRubberbandHidden()) rubberband.draw(displayFDC); rubberband.clear(); } /** * Hides the rubberband (but does not eliminate it). * <p> * Increments by one the rubberband "hide" nesting count. The rubberband * is hidden from view (but remains active) if it wasn't already hidden. * </p> */ public void hideRubberband() { if (rubberbandHiddenNestingCount++ <= 0) { Region region = new Region(); rubberband.addDamagedRegion(displayFDC, region); Rectangle r = region.getBounds(); paintCanvas.redraw(r.x, r.y, r.width, r.height, true); region.dispose(); } } /** * Shows (un-hides) the rubberband. * <p> * Decrements by one the rubberband "hide" nesting count. The rubberband * is only made visible when showRubberband() has been called once for each * previous hideRubberband(). It is not permitted to call showRubberband() if * the rubber band is not presently hidden. * </p> */ public void showRubberband() { if (rubberbandHiddenNestingCount <= 0) throw new IllegalStateException("rubberbandHiddenNestingCount > 0"); if (--rubberbandHiddenNestingCount == 0) { rubberband.draw(displayFDC); } } /** * Determines if the rubberband is hidden. * * @return true iff the rubber is hidden */ public boolean isRubberbandHidden() { return rubberbandHiddenNestingCount > 0; } /** * Handles a horizontal scroll event * * @param scrollbar the horizontal scroll bar that posted this event */ public void scrollHorizontally(ScrollBar scrollBar) { if (image == null) return; if (imageWidth > visibleWidth) { final int oldOffset = displayFDC.xOffset; final int newOffset = Math.min(scrollBar.getSelection(), imageWidth - visibleWidth); if (oldOffset != newOffset) { paintCanvas.update(); displayFDC.xOffset = newOffset; paintCanvas.scroll(Math.max(oldOffset - newOffset, 0), 0, Math.max(newOffset - oldOffset, 0), 0, visibleWidth, visibleHeight, false); } } } /** * Handles a vertical scroll event * * @param scrollbar the vertical scroll bar that posted this event */ public void scrollVertically(ScrollBar scrollBar) { if (image == null) return; if (imageHeight > visibleHeight) { final int oldOffset = displayFDC.yOffset; final int newOffset = Math.min(scrollBar.getSelection(), imageHeight - visibleHeight); if (oldOffset != newOffset) { paintCanvas.update(); displayFDC.yOffset = newOffset; paintCanvas.scroll(0, Math.max(oldOffset - newOffset, 0), 0, Math.max(newOffset - oldOffset, 0), visibleWidth, visibleHeight, false); } } } /** * Handles resize events */ private void handleResize() { paintCanvas.update(); Rectangle visibleRect = paintCanvas.getClientArea(); visibleWidth = visibleRect.width; visibleHeight = visibleRect.height; ScrollBar horizontal = paintCanvas.getHorizontalBar(); if (horizontal != null) { displayFDC.xOffset = Math.min(horizontal.getSelection(), imageWidth - visibleWidth); if (imageWidth <= visibleWidth) { horizontal.setEnabled(false); horizontal.setSelection(0); } else { final int max = imageWidth - visibleWidth; horizontal.setEnabled(true); horizontal.setValues(displayFDC.xOffset, 0, imageWidth, visibleWidth, 8, visibleWidth); } } ScrollBar vertical = paintCanvas.getVerticalBar(); if (vertical != null) { displayFDC.yOffset = Math.min(vertical.getSelection(), imageHeight - visibleHeight); if (imageHeight <= visibleHeight) { vertical.setEnabled(false); vertical.setSelection(0); } else { final int max = imageHeight - visibleHeight; vertical.setEnabled(true); vertical.setValues(displayFDC.yOffset, 0, imageHeight, visibleHeight, 8, visibleHeight); } } } /** * Virtualizes MouseEvent coordinates and stores the current position. */ private void processMouseEventCoordinates(MouseEvent event) { currentPosition.x = event.x = Math.min(Math.max(event.x, 0), visibleWidth - 1) + displayFDC.xOffset; currentPosition.y = event.y = Math.min(Math.max(event.y, 0), visibleHeight - 1) + displayFDC.yOffset; } /** * Clears the status bar. */ public void clearStatus() { statusActionInfo = ""; statusMessageInfo = ""; statusCoordInfo = ""; updateStatus(); } /** * Sets the status bar action text. * * @param action the action in progress, null to clear */ public void setStatusAction(String action) { statusActionInfo = (action != null) ? action : ""; updateStatus(); } /** * Sets the status bar message text. * * @param message the message to display, null to clear */ public void setStatusMessage(String message) { statusMessageInfo = (message != null) ? message : ""; updateStatus(); } /** * Sets the coordinates in the status bar. * * @param coord the coordinates to display, null to clear */ public void setStatusCoord(Point coord) { statusCoordInfo = (coord != null) ? PaintPlugin.getResourceString("status.Coord.format", new Object[] { new Integer(coord.x), new Integer(coord.y)}) : ""; updateStatus(); } /** * Sets the coordinate range in the status bar. * * @param a the "from" coordinate, must not be null * @param b the "to" coordinate, must not be null */ public void setStatusCoordRange(Point a, Point b) { statusCoordInfo = PaintPlugin.getResourceString("status.CoordRange.format", new Object[] { new Integer(a.x), new Integer(a.y), new Integer(b.x), new Integer(b.y)}); updateStatus(); } /** * Updates the display. */ private void updateStatus() { statusText.setText( PaintPlugin.getResourceString("status.Bar.format", new Object[] { statusActionInfo, statusMessageInfo, statusCoordInfo })); } }
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintTool.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintTool.java
deleted file mode 100755
index f699b868b7..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintTool.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.eclipse.swt.examples.paint;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
- public interface PaintTool extends PaintSession {
- /**
- * Sets the tool's settings.
- *
- * @param toolSettings the new tool settings
- */
- public void set(ToolSettings toolSettings);
-}
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintView.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintView.java
deleted file mode 100755
index e8d911cc1b..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintView.java
+++ /dev/null
@@ -1,494 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.resource.*;
-import org.eclipse.swt.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.part.*;
-
-import java.net.*;
-import java.util.*;
-
-/**
- * The view for the paint application.
- * All rendering happens inside the area created by createPartControl().
- *
- * @see ViewPart
- */
-public class PaintView extends ViewPart {
- private Display workbenchDisplay;
-
- // current active settings
- private ToolSettings toolSettings;
-
- // paint surface for drawing
- private PaintSurface paintSurface;
-
- // map action ids to useful data
- private HashMap /* of String to PaintTool */ paintToolMap;
- private HashMap /* of String to Integer */ paintFillTypeMap;
- private HashMap /* of String to Integer */ paintLineStyleMap;
-
- /** UI data **/
- // handle of currently active tool IAction on the UI
- private IAction activeToolAction;
- // handle of currently active filltype IAction on the UI
- private IAction activeFillTypeAction;
- // handle of currently active linetype IAction on the UI
- private IAction activeLineStyleAction;
-
- // handle of active foreground color box Canvas widget
- private Canvas activeForegroundColorCanvas;
- // handle of active background color box Canvas widget
- private Canvas activeBackgroundColorCanvas;
-
- private static final int numPaletteRows = 3;
- private static final int numPaletteCols = 50;
-
- // shared data
- private Color paintColorBlack, paintColorWhite; // alias for paintColors[0] and [1]
- private Color[] paintColors;
- private Font paintDefaultFont; // do not free
-
- /**
- * Constructs a Paint view.
- */
- public PaintView() {
- }
-
- /**
- * Cleanup
- */
- public void dispose() {
- if (paintSurface != null) paintSurface.dispose();
- if (paintColors != null) {
- for (int i = 0; i < paintColors.length; ++i) {
- final Color color = paintColors[i];
- if (color != null) color.dispose();
- }
- }
- paintDefaultFont = null;
- paintColors = null;
- paintSurface = null;
- super.dispose();
- }
-
- /**
- * Called when we must grab focus.
- *
- * @see org.eclipse.ui.part.ViewPart#setFocus
- */
- public void setFocus() {
- paintSurface.setFocus();
- }
-
- /**
- * Creates the example.
- *
- * @see ViewPart#createPartControl
- */
- public void createPartControl(Composite parent) {
- /*** Initialize shared data ***/
- workbenchDisplay = parent.getDisplay();
-
- paintColorWhite = new Color(workbenchDisplay, 255, 255, 255);
- paintColorBlack = new Color(workbenchDisplay, 0, 0, 0);
-
- paintDefaultFont = workbenchDisplay.getSystemFont();
-
- paintColors = new Color[numPaletteCols * numPaletteRows];
- paintColors[0] = paintColorBlack;
- paintColors[1] = paintColorWhite;
- for (int i = 2; i < paintColors.length; i++) {
- paintColors[i] = new Color(workbenchDisplay,
- ((i*7)%255),((i*23)%255), ((i*51)%255));
- }
-
- toolSettings = new ToolSettings();
- toolSettings.commonForegroundColor = paintColorBlack;
- toolSettings.commonBackgroundColor = paintColorWhite;
- toolSettings.commonFont = paintDefaultFont;
-
- /*** Add toolbar contributions ***/
- final IActionBars actionBars = getViewSite().getActionBars();
- IToolBarManager toolbarManager = actionBars.getToolBarManager();
-
- toolbarManager.add(new GroupMarker("group.tools"));
- toolbarManager.appendToGroup("group.tools", new SelectPaintToolAction("tool.Pencil"));
- toolbarManager.appendToGroup("group.tools", new SelectPaintToolAction("tool.Airbrush"));
- toolbarManager.appendToGroup("group.tools", new SelectPaintToolAction("tool.Line"));
- toolbarManager.appendToGroup("group.tools", new SelectPaintToolAction("tool.PolyLine"));
- toolbarManager.appendToGroup("group.tools", new SelectPaintToolAction("tool.Rectangle"));
- toolbarManager.appendToGroup("group.tools", new SelectPaintToolAction("tool.RoundedRectangle"));
- toolbarManager.appendToGroup("group.tools", new SelectPaintToolAction("tool.Ellipse"));
- toolbarManager.appendToGroup("group.tools", new SelectPaintToolAction("tool.Text"));
- toolbarManager.add(new Separator());
- toolbarManager.add(new GroupMarker("group.options.fill"));
- toolbarManager.appendToGroup("group.options.fill", new SelectFillTypeAction("fill.None"));
- toolbarManager.appendToGroup("group.options.fill", new SelectFillTypeAction("fill.Outline"));
- toolbarManager.appendToGroup("group.options.fill", new SelectFillTypeAction("fill.Solid"));
- toolbarManager.add(new Separator());
- toolbarManager.add(new GroupMarker("group.options.linestyle"));
- toolbarManager.appendToGroup("group.options.linestyle", new SelectLineStyleAction("linestyle.Solid"));
- toolbarManager.appendToGroup("group.options.linestyle", new SelectLineStyleAction("linestyle.Dash"));
- toolbarManager.appendToGroup("group.options.linestyle", new SelectLineStyleAction("linestyle.Dot"));
- toolbarManager.appendToGroup("group.options.linestyle", new SelectLineStyleAction("linestyle.DashDot"));
- toolbarManager.add(new Separator());
- toolbarManager.add(new GroupMarker("group.options"));
- toolbarManager.appendToGroup("group.options", new SelectFontAction("options.Font"));
- actionBars.updateActionBars();
-
- /*** Build GUI ***/
- createGUI(parent);
-
- /*** Set defaults ***/
- setPaintToolByID("tool.Pencil");
- setFillTypeByID("fill.None");
- setLineStyleByID("linestyle.Solid");
- setForegroundColor(paintColorBlack);
- setBackgroundColor(paintColorWhite);
- }
-
- /**
- * Creates the GUI.
- */
- private void createGUI(Composite parent) {
- GridLayout gridLayout;
- GridData gridData;
-
- /*** Create principal GUI layout elements ***/
- Composite displayArea = new Composite(parent, SWT.NONE);
- gridLayout = new GridLayout();
- gridLayout.numColumns = 1;
- displayArea.setLayout(gridLayout);
-
- // Creating these elements here avoids the need to instantiate the GUI elements
- // in strict layout order. The natural layout ordering is an artifact of using
- // SWT layouts, but unfortunately it is not the same order as that required to
- // instantiate all of the non-GUI application elements to satisfy referential
- // dependencies. It is possible to reorder the initialization to some extent, but
- // this can be very tedious.
-
- // paint canvas
- final Canvas paintCanvas = new Canvas(displayArea, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL |
- SWT.NO_REDRAW_RESIZE | SWT.NO_BACKGROUND);
- gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
- paintCanvas.setLayoutData(gridData);
- paintCanvas.setBackground(paintColorWhite);
-
- // color selector frame
- final Composite colorFrame = new Composite(displayArea, SWT.NONE);
- gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
- colorFrame.setLayoutData(gridData);
-
- // tool settings frame
- final Composite toolSettingsFrame = new Composite(displayArea, SWT.NONE);
- gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
- toolSettingsFrame.setLayoutData(gridData);
-
- // status text
- final Text statusText = new Text(displayArea, SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY);
- gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
- statusText.setLayoutData(gridData);
-
- /*** Create the remaining application elements inside the principal GUI layout elements ***/
- // paintSurface
- paintSurface = new PaintSurface(paintCanvas, statusText, paintColorWhite);
-
- // paintToolMap
- paintToolMap = new HashMap();
- paintToolMap.put("tool.Pencil", new PencilTool(toolSettings, paintSurface));
- paintToolMap.put("tool.Airbrush", new AirbrushTool(toolSettings, paintSurface));
- paintToolMap.put("tool.Line", new LineTool(toolSettings, paintSurface));
- paintToolMap.put("tool.PolyLine", new PolyLineTool(toolSettings, paintSurface));
- paintToolMap.put("tool.Rectangle", new RectangleTool(toolSettings, paintSurface));
- paintToolMap.put("tool.RoundedRectangle", new RoundedRectangleTool(toolSettings, paintSurface));
- paintToolMap.put("tool.Ellipse", new EllipseTool(toolSettings, paintSurface));
- paintToolMap.put("tool.Text", new TextTool(toolSettings, paintSurface));
- paintToolMap.put("tool.Null", null);
-
- // paintFillTypeMap
- paintFillTypeMap = new HashMap();
- paintFillTypeMap.put("fill.None", new Integer(ToolSettings.ftNone));
- paintFillTypeMap.put("fill.Outline", new Integer(ToolSettings.ftOutline));
- paintFillTypeMap.put("fill.Solid", new Integer(ToolSettings.ftSolid));
-
- // paintLineStyleMap
- paintLineStyleMap = new HashMap();
- paintLineStyleMap.put("linestyle.Solid", new Integer(SWT.LINE_SOLID));
- paintLineStyleMap.put("linestyle.Dash", new Integer(SWT.LINE_DASH));
- paintLineStyleMap.put("linestyle.Dot", new Integer(SWT.LINE_DOT));
- paintLineStyleMap.put("linestyle.DashDot", new Integer(SWT.LINE_DASHDOT));
-
- // colorFrame
- gridLayout = new GridLayout();
- gridLayout.numColumns = 3;
- gridLayout.marginHeight = 0;
- gridLayout.marginWidth = 0;
- colorFrame.setLayout(gridLayout);
-
- // activeForegroundColorCanvas, activeBackgroundColorCanvas
- activeForegroundColorCanvas = new Canvas(colorFrame, SWT.BORDER);
- gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gridData.heightHint = 24;
- gridData.widthHint = 24;
- activeForegroundColorCanvas.setLayoutData(gridData);
-
- activeBackgroundColorCanvas = new Canvas(colorFrame, SWT.BORDER);
- gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gridData.heightHint = 24;
- gridData.widthHint = 24;
- activeBackgroundColorCanvas.setLayoutData(gridData);
-
- // paletteCanvas
- final Canvas paletteCanvas = new Canvas(colorFrame, SWT.BORDER | SWT.NO_BACKGROUND);
- gridData = new GridData(GridData.FILL_HORIZONTAL);
- gridData.heightHint = 24;
- paletteCanvas.setLayoutData(gridData);
- paletteCanvas.addListener(SWT.MouseDown, new Listener() {
- public void handleEvent(Event e) {
- Rectangle bounds = paletteCanvas.getClientArea();
- Color color = getColorAt(bounds, e.x, e.y);
-
- if (e.button == 1) setForegroundColor(color);
- else setBackgroundColor(color);
- }
- private Color getColorAt(Rectangle bounds, int x, int y) {
- if (bounds.height <= 1 && bounds.width <= 1) return paintColorWhite;
- final int row = (y - bounds.y) * numPaletteRows / bounds.height;
- final int col = (x - bounds.x) * numPaletteCols / bounds.width;
- return paintColors[Math.min(Math.max(row * numPaletteCols + col, 0), paintColors.length - 1)];
- }
- });
- Listener refreshListener = new Listener() {
- public void handleEvent(Event e) {
- if (e.gc == null) return;
- Rectangle bounds = paletteCanvas.getClientArea();
- for (int row = 0; row < numPaletteRows; ++row) {
- for (int col = 0; col < numPaletteCols; ++col) {
- final int x = bounds.width * col / numPaletteCols;
- final int y = bounds.height * row / numPaletteRows;
- final int width = Math.max(bounds.width * (col + 1) / numPaletteCols - x, 1);
- final int height = Math.max(bounds.height * (row + 1) / numPaletteRows - y, 1);
- e.gc.setBackground(paintColors[row * numPaletteCols + col]);
- e.gc.fillRectangle(bounds.x + x, bounds.y + y, width, height);
- }
- }
- }
- };
- paletteCanvas.addListener(SWT.Resize, refreshListener);
- paletteCanvas.addListener(SWT.Paint, refreshListener);
- //paletteCanvas.redraw();
-
- // toolSettingsFrame
- gridLayout = new GridLayout();
- gridLayout.numColumns = 4;
- gridLayout.marginHeight = 0;
- gridLayout.marginWidth = 0;
- toolSettingsFrame.setLayout(gridLayout);
-
- Label label = new Label(toolSettingsFrame, SWT.NONE);
- label.setText(PaintPlugin.getResourceString("settings.AirbrushRadius.text"));
-
- final Scale airbrushRadiusScale = new Scale(toolSettingsFrame, SWT.HORIZONTAL);
- airbrushRadiusScale.setMinimum(5);
- airbrushRadiusScale.setMaximum(50);
- airbrushRadiusScale.setSelection(toolSettings.airbrushRadius);
- airbrushRadiusScale.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));
- airbrushRadiusScale.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- toolSettings.airbrushRadius = airbrushRadiusScale.getSelection();
- updateToolSettings();
- }
- });
-
- label = new Label(toolSettingsFrame, SWT.NONE);
- label.setText(PaintPlugin.getResourceString("settings.AirbrushIntensity.text"));
-
- final Scale airbrushIntensityScale = new Scale(toolSettingsFrame, SWT.HORIZONTAL);
- airbrushIntensityScale.setMinimum(1);
- airbrushIntensityScale.setMaximum(100);
- airbrushIntensityScale.setSelection(toolSettings.airbrushIntensity);
- airbrushIntensityScale.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));
- airbrushIntensityScale.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- toolSettings.airbrushIntensity = airbrushIntensityScale.getSelection();
- updateToolSettings();
- }
- });
- }
-
- /**
- * Notifies the tool that its settings have changed.
- */
- private void updateToolSettings() {
- final PaintTool activePaintTool = paintSurface.getPaintTool();
- if (activePaintTool == null) return;
-
- activePaintTool.endSession();
- activePaintTool.set(toolSettings);
- activePaintTool.beginSession();
- }
-
- /**
- * Sets the tool foreground color.
- *
- * @param color the new color to use
- */
- public void setForegroundColor(Color color) {
- if (activeForegroundColorCanvas != null)
- activeForegroundColorCanvas.setBackground(color);
- toolSettings.commonForegroundColor = color;
- updateToolSettings();
- }
-
- /**
- * Set the tool background color.
- *
- * @param color the new color to use
- */
- public void setBackgroundColor(Color color) {
- if (activeBackgroundColorCanvas != null)
- activeBackgroundColorCanvas.setBackground(color);
- toolSettings.commonBackgroundColor = color;
- updateToolSettings();
- }
-
- /**
- * Selects a tool given its ID.
- */
- public void setPaintToolByID(String id) {
- activeToolAction = handleRadioAction(activeToolAction, id);
-
- final PaintTool paintTool = (PaintTool) paintToolMap.get(id);
- paintSurface.setPaintSession(paintTool);
- updateToolSettings();
- }
-
- /**
- * Selects a filltype given its ID.
- */
- public void setFillTypeByID(String id) {
- activeFillTypeAction = handleRadioAction(activeFillTypeAction, id);
-
- final Integer fillType = (Integer) paintFillTypeMap.get(id);
- toolSettings.commonFillType = fillType.intValue();
- updateToolSettings();
- }
-
- /**
- * Selects line type given its ID.
- */
- public void setLineStyleByID(String id) {
- activeLineStyleAction = handleRadioAction(activeLineStyleAction, id);
-
- final Integer lineType = (Integer) paintLineStyleMap.get(id);
- toolSettings.commonLineStyle = lineType.intValue();
- updateToolSettings();
- }
-
- /**
- * Gets the IAction for an ID belonging to a set of mutually exclusive actions, and
- * toggles the old action off if necessary.
- */
- private IAction handleRadioAction(IAction oldAction, String id) {
- IAction action = getActionByID(id);
- if (action != null) {
- if (oldAction != null) oldAction.setChecked(false);
- if (! action.isChecked()) action.setChecked(true);
- return action;
- }
- return oldAction;
- }
-
- /**
- * Gets the IAction representing the UI toolbar button with the specified ID.
- */
- private IAction getActionByID(String id) {
- final IActionBars actionBars = getViewSite().getActionBars();
- IToolBarManager toolbarManager = actionBars.getToolBarManager();
- ActionContributionItem contributionItem = (ActionContributionItem) toolbarManager.find(id);
- if (contributionItem == null) return null;
- return contributionItem.getAction();
- }
-
- /**
- * Returns the Display.
- *
- * @return the display we're using
- */
- public Display getDisplay() {
- return workbenchDisplay;
- }
-
- /**
- * Action set glue.
- */
- abstract class PaintAction extends Action {
- public PaintAction(String id) {
- super();
- setId(id);
-
- try {
- final URL installUrl = PaintPlugin.getDefault().getDescriptor().getInstallURL();
- final URL imageUrl = new URL(installUrl, PaintPlugin.getResourceString(id + ".image"));
- setImageDescriptor(ImageDescriptor.createFromURL(imageUrl));
- } catch (MalformedURLException e) {
- PaintPlugin.logError("", e);
- }
-
- setText(PaintPlugin.getResourceString(id + ".label"));
- setToolTipText(PaintPlugin.getResourceString(id + ".tooltip"));
- setDescription(PaintPlugin.getResourceString(id + ".description"));
- }
- }
- class SelectPaintToolAction extends PaintAction {
- public SelectPaintToolAction(String id) { super(id); }
- public int getStyle() { return IAction.AS_CHECK_BOX; }
- public void run() { setPaintToolByID(getId()); }
-
- }
- class SelectFillTypeAction extends PaintAction {
- public SelectFillTypeAction(String id) { super(id); }
- public int getStyle() { return IAction.AS_CHECK_BOX; }
- public void run() { setFillTypeByID(getId()); }
- }
- class SelectLineStyleAction extends PaintAction {
- public SelectLineStyleAction(String id) { super(id); }
- public int getStyle() { return IAction.AS_CHECK_BOX; }
- public void run() { setLineStyleByID(getId()); }
- }
- class SelectFontAction extends PaintAction {
- public SelectFontAction(String id) { super(id); }
- public int getStyle() { return IAction.AS_PUSH_BUTTON; }
- public void run() {
- FontDialog fontDialog = new FontDialog(paintSurface.getShell(), SWT.PRIMARY_MODAL);
- FontData[] fontDatum = toolSettings.commonFont.getFontData();
- if (fontDatum != null && fontDatum.length > 0) {
- fontDialog.setFontData(fontDatum[0]);
- }
- fontDialog.setText(PaintPlugin.getResourceString("options.Font.dialog.title"));
-
- paintSurface.hideRubberband();
- FontData fontData = fontDialog.open();
- paintSurface.showRubberband();
- if (fontData != null) {
- try {
- Font font = new Font(workbenchDisplay, fontData);
- toolSettings.commonFont = font;
- updateToolSettings();
- } catch (SWTException e) {
- }
- }
- }
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PencilTool.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PencilTool.java
deleted file mode 100755
index 69f52d8612..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PencilTool.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import java.util.Random; import org.eclipse.swt.graphics.*;
-
-/**
- * A pencil tool.
- */
-public class PencilTool extends ContinuousPaintSession implements PaintTool {
- private ToolSettings settings;
-
- /**
- * Constructs a pencil tool.
- *
- * @param toolSettings the new tool settings
- * @param getPaintSurface() the PaintSurface we will render on.
- */
- public PencilTool(ToolSettings toolSettings, PaintSurface paintSurface) {
- super(paintSurface);
- set(toolSettings);
- }
-
- /**
- * Sets the tool's settings.
- *
- * @param toolSettings the new tool settings
- */
- public void set(ToolSettings toolSettings) {
- settings = toolSettings;
- }
-
- /**
- * Returns the name associated with this tool.
- *
- * @return the localized name of this tool
- */
- public String getDisplayName() {
- return PaintPlugin.getResourceString("tool.Pencil.label");
- }
-
- /*
- * Template method for drawing
- */
- public void render(final Point point) {
- final PaintSurface ps = getPaintSurface();
- ps.drawFigure(new PointFigure(settings.commonForegroundColor, point.x, point.y));
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PointFigure.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PointFigure.java
deleted file mode 100644
index a93da19f9c..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PointFigure.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.graphics.*;
-
-/**
- * 2D Point object
- */
-public class PointFigure extends Figure {
- private Color color;
- private int x, y;
- /**
- * Constructs a Point
- *
- * @param color the color for this object
- * @param x the virtual X coordinate of the first end-point
- * @param y the virtual Y coordinate of the first end-point
- */
- public PointFigure(Color color, int x, int y) {
- this.color = color; this.x = x; this.y = y;
- }
- public void draw(FigureDrawContext fdc) {
- Point p = fdc.toClientPoint(x, y);
- fdc.gc.setBackground(color);
- fdc.gc.fillRectangle(p.x, p.y, 1, 1);
- }
- public void addDamagedRegion(FigureDrawContext fdc, Region region) {
- region.add(fdc.toClientRectangle(x, y, x, y));
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PolyLineTool.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PolyLineTool.java
deleted file mode 100755
index 973e152695..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PolyLineTool.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.graphics.*;
-
-/**
- * A polyline drawing tool.
- */
-public class PolyLineTool extends SegmentedPaintSession implements PaintTool {
- private ToolSettings settings;
-
- /**
- * Constructs a PolyLineTool.
- *
- * @param toolSettings the new tool settings
- * @param paintSurface the PaintSurface we will render on.
- */
- public PolyLineTool(ToolSettings toolSettings, PaintSurface paintSurface) {
- super(paintSurface);
- set(toolSettings);
- }
-
- /**
- * Sets the tool's settings.
- *
- * @param toolSettings the new tool settings
- */
- public void set(ToolSettings toolSettings) {
- settings = toolSettings;
- }
-
- /**
- * Returns the name associated with this tool.
- *
- * @return the localized name of this tool
- */
- public String getDisplayName() {
- return PaintPlugin.getResourceString("tool.PolyLine.label");
- }
-
- /*
- * Template methods for drawing
- */
- protected Figure createFigure(Point[] points, int numPoints, boolean closed) {
- ContainerFigure container = new ContainerFigure();
- if (closed && settings.commonFillType != ToolSettings.ftNone && numPoints >= 3) {
- container.add(new SolidPolygonFigure(settings.commonBackgroundColor, points, numPoints));
- }
- if (! closed || settings.commonFillType != ToolSettings.ftSolid || numPoints < 3) {
- for (int i = 0; i < numPoints - 1; ++i) {
- final Point a = points[i];
- final Point b = points[i + 1];
- container.add(new LineFigure(settings.commonForegroundColor, settings.commonBackgroundColor, settings.commonLineStyle,
- a.x, a.y, b.x, b.y));
- }
- if (closed) {
- final Point a = points[points.length - 1];
- final Point b = points[0];
- container.add(new LineFigure(settings.commonForegroundColor, settings.commonBackgroundColor, settings.commonLineStyle,
- a.x, a.y, b.x, b.y));
- }
- }
- return container;
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RectangleFigure.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RectangleFigure.java
deleted file mode 100755
index b6bf01462b..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RectangleFigure.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-
-/**
- * 2D Rectangle object
- */
-public class RectangleFigure extends Figure {
- private Color foregroundColor, backgroundColor;
- private int lineStyle, x1, y1, x2, y2;
- /**
- * Constructs a Rectangle
- * These objects are defined by any two diametrically opposing corners.
- *
- * @param color the color for this object
- * @param lineStyle the line style for this object
- * @param x1 the virtual X coordinate of the first corner
- * @param y1 the virtual Y coordinate of the first corner
- * @param x2 the virtual X coordinate of the second corner
- * @param y2 the virtual Y coordinate of the second corner
- */
- public RectangleFigure(Color foregroundColor, Color backgroundColor, int lineStyle, int x1, int y1, int x2, int y2) {
- this.foregroundColor = foregroundColor;
- this.backgroundColor = backgroundColor;
- this.lineStyle = lineStyle;
- this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2;
- }
- public void draw(FigureDrawContext fdc) {
- Rectangle r = fdc.toClientRectangle(x1, y1, x2, y2);
- fdc.gc.setForeground(foregroundColor);
- fdc.gc.setBackground(backgroundColor);
- fdc.gc.setLineStyle(lineStyle);
- fdc.gc.drawRectangle(r.x, r.y, r.width - 1, r.height - 1);
- fdc.gc.setLineStyle(SWT.LINE_SOLID);
- }
- public void addDamagedRegion(FigureDrawContext fdc, Region region) {
- region.add(fdc.toClientRectangle(x1, y1, x2, y2));
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RectangleTool.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RectangleTool.java
deleted file mode 100755
index 555280150c..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RectangleTool.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.graphics.*;
-
-/**
- * A drawing tool.
- */
-public class RectangleTool extends DragPaintSession implements PaintTool {
- private ToolSettings settings;
-
- /**
- * Constructs a RectangleTool.
- *
- * @param toolSettings the new tool settings
- * @param paintSurface the PaintSurface we will render on.
- */
- public RectangleTool(ToolSettings toolSettings, PaintSurface paintSurface) {
- super(paintSurface);
- set(toolSettings);
- }
-
- /**
- * Sets the tool's settings.
- *
- * @param toolSettings the new tool settings
- */
- public void set(ToolSettings toolSettings) {
- settings = toolSettings;
- }
-
- /**
- * Returns name associated with this tool.
- *
- * @return the localized name of this tool
- */
- public String getDisplayName() {
- return PaintPlugin.getResourceString("tool.Rectangle.label");
- }
-
- /*
- * Template method for drawing
- */
- protected Figure createFigure(Point a, Point b) {
- switch (settings.commonFillType) {
- default:
- case ToolSettings.ftNone:
- return new RectangleFigure(settings.commonForegroundColor, settings.commonBackgroundColor, settings.commonLineStyle,
- a.x, a.y, b.x, b.y);
- case ToolSettings.ftSolid:
- return new SolidRectangleFigure(settings.commonBackgroundColor, a.x, a.y, b.x, b.y);
- case ToolSettings.ftOutline: {
- ContainerFigure container = new ContainerFigure();
- container.add(new SolidRectangleFigure(settings.commonBackgroundColor, a.x, a.y, b.x, b.y));
- container.add(new RectangleFigure(settings.commonForegroundColor, settings.commonBackgroundColor, settings.commonLineStyle,
- a.x, a.y, b.x, b.y));
- return container;
- }
- }
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RoundedRectangleFigure.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RoundedRectangleFigure.java
deleted file mode 100755
index ec561dd454..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RoundedRectangleFigure.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-
-/**
- * 2D Rectangle object
- */
-public class RoundedRectangleFigure extends Figure {
- private Color foregroundColor, backgroundColor;
- private int lineStyle, x1, y1, x2, y2, diameter;
- /**
- * Constructs a Rectangle
- * These objects are defined by any two diametrically opposing corners.
- *
- * @param color the color for this object
- * @param lineStyle the line style for this object
- * @param x1 the virtual X coordinate of the first corner
- * @param y1 the virtual Y coordinate of the first corner
- * @param x2 the virtual X coordinate of the second corner
- * @param y2 the virtual Y coordinate of the second corner
- * @param diameter the diameter of curvature of all four corners
- */
- public RoundedRectangleFigure(Color foregroundColor, Color backgroundColor, int lineStyle, int x1, int y1, int x2, int y2, int diameter) {
- this.foregroundColor = foregroundColor;
- this.backgroundColor = backgroundColor;
- this.lineStyle = lineStyle;
- this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2;
- this.diameter = diameter;
- }
- public void draw(FigureDrawContext fdc) {
- Rectangle r = fdc.toClientRectangle(x1, y1, x2, y2);
- fdc.gc.setForeground(foregroundColor);
- fdc.gc.setBackground(backgroundColor);
- fdc.gc.setLineStyle(lineStyle);
- fdc.gc.drawRoundRectangle(r.x, r.y, r.width - 1, r.height - 1, diameter, diameter);
- fdc.gc.setLineStyle(SWT.LINE_SOLID);
- }
- public void addDamagedRegion(FigureDrawContext fdc, Region region) {
- region.add(fdc.toClientRectangle(x1, y1, x2, y2));
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RoundedRectangleTool.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RoundedRectangleTool.java
deleted file mode 100755
index e649b40005..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RoundedRectangleTool.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.graphics.*;
-
-/**
- * A drawing tool.
- */
-public class RoundedRectangleTool extends DragPaintSession implements PaintTool {
- private ToolSettings settings;
-
- /**
- * Constructs a RoundedRectangleTool.
- *
- * @param toolSettings the new tool settings
- * @param paintSurface the PaintSurface we will render on.
- */
- public RoundedRectangleTool(ToolSettings toolSettings, PaintSurface paintSurface) {
- super(paintSurface);
- set(toolSettings);
- }
-
- /**
- * Sets the tool's settings.
- *
- * @param toolSettings the new tool settings
- */
- public void set(ToolSettings toolSettings) {
- settings = toolSettings;
- }
-
- /**
- * Returns name associated with this tool.
- *
- * @return the localized name of this tool
- */
- public String getDisplayName() {
- return PaintPlugin.getResourceString("tool.RoundedRectangle.label");
- }
-
- /*
- * Template methods for drawing
- */
- protected Figure createFigure(Point a, Point b) {
- ContainerFigure container = new ContainerFigure();
- if (settings.commonFillType != ToolSettings.ftNone)
- container.add(new SolidRoundedRectangleFigure(settings.commonBackgroundColor,
- a.x, a.y, b.x, b.y, settings.roundedRectangleCornerDiameter));
- if (settings.commonFillType != ToolSettings.ftSolid)
- container.add(new RoundedRectangleFigure(settings.commonForegroundColor, settings.commonBackgroundColor,
- settings.commonLineStyle, a.x, a.y, b.x, b.y, settings.roundedRectangleCornerDiameter));
- return container;
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SegmentedPaintSession.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SegmentedPaintSession.java
deleted file mode 100755
index 5085ab1bf2..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SegmentedPaintSession.java
+++ /dev/null
@@ -1,153 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-
-import java.util.*;
-
-/**
- * The superclass for paint tools that contruct objects from individually
- * picked segments.
- */
-public abstract class SegmentedPaintSession extends BasicPaintSession {
- /**
- * The set of control points making up the segmented selection
- */
- private Vector /* of Point */ controlPoints = new Vector();
-
- /**
- * The previous figure (so that we can abort with right-button)
- */
- private Figure previousFigure = null;
-
- /**
- * The current figure (so that we can abort with right-button)
- */
- private Figure currentFigure = null;
-
- /**
- * Constructs a PaintSession.
- *
- * @param paintSurface the drawing surface to use
- */
- protected SegmentedPaintSession(PaintSurface paintSurface) {
- super(paintSurface);
- }
-
- /**
- * Activates the tool.
- */
- public void beginSession() {
- getPaintSurface().setStatusMessage(PaintPlugin.getResourceString(
- "session.SegmentedInteractivePaint.message.anchorMode"));
- previousFigure = null;
- currentFigure = null;
- controlPoints.clear();
- }
-
- /**
- * Deactivates the tool.
- */
- public void endSession() {
- getPaintSurface().clearRubberbandSelection();
- if (previousFigure != null) getPaintSurface().drawFigure(previousFigure);
- }
-
- /**
- * Resets the tool.
- * Aborts any operation in progress.
- */
- public void resetSession() {
- getPaintSurface().clearRubberbandSelection();
- if (previousFigure != null) getPaintSurface().drawFigure(previousFigure);
-
- getPaintSurface().setStatusMessage(PaintPlugin.getResourceString(
- "session.SegmentedInteractivePaint.message.anchorMode"));
- previousFigure = null;
- currentFigure = null;
- controlPoints.clear();
- }
-
- /**
- * Handles a mouseDown event.
- *
- * @param event the mouse event detail information
- */
- public void mouseDown(MouseEvent event) {
- if (event.button != 1) return;
-
- getPaintSurface().setStatusMessage(PaintPlugin.getResourceString(
- "session.SegmentedInteractivePaint.message.interactiveMode"));
- previousFigure = currentFigure;
-
- if (controlPoints.size() > 0) {
- final Point lastPoint = (Point) controlPoints.elementAt(controlPoints.size() - 1);
- if (lastPoint.x == event.x || lastPoint.y == event.y) return; // spurious event
- }
- controlPoints.add(new Point(event.x, event.y));
- }
-
- /**
- * Handles a mouseDoubleClick event.
- *
- * @param event the mouse event detail information
- */
- public void mouseDoubleClick(MouseEvent event) {
- if (event.button != 1) return;
- if (controlPoints.size() >= 2) {
- getPaintSurface().clearRubberbandSelection();
- previousFigure = createFigure(
- (Point[]) controlPoints.toArray(new Point[controlPoints.size()]),
- controlPoints.size(), true);
- }
- resetSession();
- }
-
- /**
- * Handles a mouseUp event.
- *
- * @param event the mouse event detail information
- */
- public void mouseUp(MouseEvent event) {
- if (event.button != 1) {
- resetSession(); // abort if right or middle mouse button pressed
- return;
- }
- }
-
- /**
- * Handles a mouseMove event.
- *
- * @param event the mouse event detail information
- */
- public void mouseMove(MouseEvent event) {
- final PaintSurface ps = getPaintSurface();
- if (controlPoints.size() == 0) {
- ps.setStatusCoord(ps.getCurrentPosition());
- return; // spurious event
- } else {
- ps.setStatusCoordRange((Point) controlPoints.elementAt(controlPoints.size() - 1),
- ps.getCurrentPosition());
- }
-
- ps.clearRubberbandSelection();
- Point[] points = (Point[]) controlPoints.toArray(new Point[controlPoints.size() + 1]);
- points[controlPoints.size()] = ps.getCurrentPosition();
- currentFigure = createFigure(points, points.length, false);
- ps.addRubberbandSelection(currentFigure);
- }
-
- /**
- * Template Method: Creates a Figure for drawing rubberband entities and the final product
- *
- * @param points the array of control points
- * @param numPoints the number of valid points in the array (n >= 2)
- * @param closed true if the user double-clicked on the final control point
- */
- protected abstract Figure createFigure(Point[] points, int numPoints, boolean closed);
-}
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidEllipseFigure.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidEllipseFigure.java
deleted file mode 100755
index 8f481eb474..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidEllipseFigure.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.graphics.*;
-
-/**
- * 2D Solid Ellipse object
- */
-public class SolidEllipseFigure extends Figure {
- private Color color;
- private int x1, y1, x2, y2;
- /**
- * Constructs a SolidEllipse
- * These objects are defined by any two diametrically opposing corners of a box
- * bounding the ellipse.
- *
- * @param color the color for this object
- * @param x1 the virtual X coordinate of the first corner
- * @param y1 the virtual Y coordinate of the first corner
- * @param x2 the virtual X coordinate of the second corner
- * @param y2 the virtual Y coordinate of the second corner
- */
- public SolidEllipseFigure(Color color, int x1, int y1, int x2, int y2) {
- this.color = color; this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2;
- }
- public void draw(FigureDrawContext fdc) {
- Rectangle r = fdc.toClientRectangle(x1, y1, x2, y2);
- fdc.gc.setBackground(color);
- fdc.gc.fillOval(r.x, r.y, r.width, r.height);
- }
- public void addDamagedRegion(FigureDrawContext fdc, Region region) {
- region.add(fdc.toClientRectangle(x1, y1, x2, y2));
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidPolygonFigure.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidPolygonFigure.java
deleted file mode 100755
index 22b06ca958..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidPolygonFigure.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.graphics.*;
-
-/**
- * 2D Line object
- */
-public class SolidPolygonFigure extends Figure {
- private Color color;
- private int[] points;
- /**
- * Constructs a SolidPolygon
- * These objects are defined by a sequence of vertices.
- *
- * @param color the color for this object
- * @param vertices the array of vertices making up the polygon
- * @param numPoint the number of valid points in the array (n >= 3)
- */
- public SolidPolygonFigure(Color color, Point[] vertices, int numPoints) {
- this.color = color;
- this.points = new int[numPoints * 2];
- for (int i = 0; i < numPoints; ++i) {
- points[i * 2] = vertices[i].x;
- points[i * 2 + 1] = vertices[i].y;
- }
- }
- public void draw(FigureDrawContext fdc) {
- int[] drawPoints = new int[points.length];
- for (int i = 0; i < points.length; i += 2) {
- drawPoints[i] = points[i] * fdc.xScale - fdc.xOffset;
- drawPoints[i + 1] = points[i + 1] * fdc.yScale - fdc.yOffset;
- }
- fdc.gc.setBackground(color);
- fdc.gc.fillPolygon(drawPoints);
- }
- public void addDamagedRegion(FigureDrawContext fdc, Region region) {
- int xmin = Integer.MAX_VALUE, ymin = Integer.MAX_VALUE;
- int xmax = Integer.MIN_VALUE, ymax = Integer.MIN_VALUE;
-
- for (int i = 0; i < points.length; i += 2) {
- if (points[i] < xmin) xmin = points[i];
- if (points[i] > xmax) xmax = points[i];
- if (points[i+1] < ymin) ymin = points[i+1];
- if (points[i+1] > ymax) ymax = points[i+1];
- }
- region.add(fdc.toClientRectangle(xmin, ymin, xmax, ymax));
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidRectangleFigure.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidRectangleFigure.java
deleted file mode 100755
index f1146a5736..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidRectangleFigure.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.graphics.*;
-
-/**
- * 2D SolidRectangle object
- */
-public class SolidRectangleFigure extends Figure {
- private Color color;
- private int x1, y1, x2, y2;
- /**
- * Constructs a SolidRectangle
- * These objects are defined by any two diametrically opposing corners.
- *
- * @param color the color for this object
- * @param x1 the virtual X coordinate of the first corner
- * @param y1 the virtual Y coordinate of the first corner
- * @param x2 the virtual X coordinate of the second corner
- * @param y2 the virtual Y coordinate of the second corner
- */
- public SolidRectangleFigure(Color color, int x1, int y1, int x2, int y2) {
- this.color = color; this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2;
- }
- public void draw(FigureDrawContext fdc) {
- Rectangle r = fdc.toClientRectangle(x1, y1, x2, y2);
- fdc.gc.setBackground(color);
- fdc.gc.fillRectangle(r.x, r.y, r.width, r.height);
- }
- public void addDamagedRegion(FigureDrawContext fdc, Region region) {
- region.add(fdc.toClientRectangle(x1, y1, x2, y2));
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidRoundedRectangleFigure.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidRoundedRectangleFigure.java
deleted file mode 100755
index bb57338e75..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidRoundedRectangleFigure.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.graphics.*;
-
-/**
- * 2D SolidRectangle object
- */
-public class SolidRoundedRectangleFigure extends Figure {
- private Color color;
- private int x1, y1, x2, y2, diameter;
- /**
- * Constructs a SolidRectangle
- * These objects are defined by any two diametrically opposing corners.
- *
- * @param color the color for this object
- * @param x1 the virtual X coordinate of the first corner
- * @param y1 the virtual Y coordinate of the first corner
- * @param x2 the virtual X coordinate of the second corner
- * @param y2 the virtual Y coordinate of the second corner
- * @param diameter the diameter of curvature of all four corners
- */
- public SolidRoundedRectangleFigure(Color color, int x1, int y1, int x2, int y2, int diameter) {
- this.color = color; this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2;
- this.diameter = diameter;
- }
- public void draw(FigureDrawContext fdc) {
- Rectangle r = fdc.toClientRectangle(x1, y1, x2, y2);
- fdc.gc.setBackground(color);
- fdc.gc.fillRoundRectangle(r.x, r.y, r.width, r.height, diameter, diameter);
- }
- public void addDamagedRegion(FigureDrawContext fdc, Region region) {
- region.add(fdc.toClientRectangle(x1, y1, x2, y2));
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/TextFigure.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/TextFigure.java
deleted file mode 100755
index a8f1b077ff..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/TextFigure.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.graphics.*;
-
-/**
- * 2D Rectangle object
- */
-public class TextFigure extends Figure {
- private Color color;
- private Font font;
- private String text;
- private int x, y;
- /**
- * Constructs a TextFigure
- *
- * @param color the color for this object
- * @param font the font for this object
- * @param text the text to draw, tab and new-line expansion is performed
- * @param x the virtual X coordinate of the top-left corner of the text bounding box
- * @param y the virtual Y coordinate of the top-left corner of the text bounding box
- */
- public TextFigure(Color color, Font font, String text, int x, int y) {
- this.color = color; this.font = font; this.text = text; this.x = x; this.y = y;
- }
- public void draw(FigureDrawContext fdc) {
- Point p = fdc.toClientPoint(x, y);
- fdc.gc.setFont(font);
- fdc.gc.setForeground(color);
- fdc.gc.drawText(text, p.x, p.y, true);
- }
- public void addDamagedRegion(FigureDrawContext fdc, Region region) {
- Font oldFont = fdc.gc.getFont();
- fdc.gc.setFont(font);
- Point textExtent = fdc.gc.textExtent(text);
- fdc.gc.setFont(oldFont);
- region.add(fdc.toClientRectangle(x, y, x + textExtent.x, y + textExtent.y));
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/TextTool.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/TextTool.java
deleted file mode 100755
index 22831e81bf..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/TextTool.java
+++ /dev/null
@@ -1,122 +0,0 @@
-package org.eclipse.swt.examples.paint;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.jface.dialogs.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-
-/**
- * A text drawing tool.
- */
-public class TextTool extends BasicPaintSession implements PaintTool {
- private ToolSettings settings;
- private String drawText = PaintPlugin.getResourceString("tool.Text.settings.defaulttext");
-
- /**
- * Constructs a PaintTool.
- *
- * @param toolSettings the new tool settings
- * @param paintSurface the PaintSurface we will render on.
- */
- public TextTool(ToolSettings toolSettings, PaintSurface paintSurface) {
- super(paintSurface);
- set(toolSettings);
- }
-
- /**
- * Sets the tool's settings.
- *
- * @param toolSettings the new tool settings
- */
- public void set(ToolSettings toolSettings) {
- settings = toolSettings;
- }
-
- /**
- * Returns name associated with this tool.
- *
- * @return the localized name of this tool
- */
- public String getDisplayName() {
- return PaintPlugin.getResourceString("tool.Text.label");
- }
-
- /**
- * Activates the tool.
- */
- public void beginSession() {
- getPaintSurface().setStatusMessage(PaintPlugin.getResourceString(
- "session.Text.message"));
- }
-
- /**
- * Deactivates the tool.
- */
- public void endSession() {
- getPaintSurface().clearRubberbandSelection();
- }
-
- /**
- * Aborts the current operation.
- */
- public void resetSession() {
- getPaintSurface().clearRubberbandSelection();
- }
-
- /**
- * Handles a mouseDown event.
- *
- * @param event the mouse event detail information
- */
- public void mouseDown(MouseEvent event) {
- if (event.button == 1) {
- // draw with left mouse button
- getPaintSurface().commitRubberbandSelection();
- } else {
- // set text with right mouse button
- getPaintSurface().clearRubberbandSelection();
- InputDialog inputDialog = new InputDialog(getPaintSurface().getShell(),
- PaintPlugin.getResourceString("tool.Text.dialog.title"),
- PaintPlugin.getResourceString("tool.Text.dialog.message"),
- drawText, null);
- inputDialog.setBlockOnOpen(true);
- inputDialog.open();
- if (inputDialog.getReturnCode() == InputDialog.OK) drawText = inputDialog.getValue();
- inputDialog.close();
- }
- }
-
- /**
- * Handles a mouseDoubleClick event.
- *
- * @param event the mouse event detail information
- */
- public void mouseDoubleClick(MouseEvent event) {
- }
-
- /**
- * Handles a mouseUp event.
- *
- * @param event the mouse event detail information
- */
- public void mouseUp(MouseEvent event) {
- }
-
- /**
- * Handles a mouseMove event.
- *
- * @param event the mouse event detail information
- */
- public void mouseMove(MouseEvent event) {
- final PaintSurface ps = getPaintSurface();
- ps.setStatusCoord(ps.getCurrentPosition());
- ps.clearRubberbandSelection();
- ps.addRubberbandSelection(
- new TextFigure(settings.commonForegroundColor, settings.commonFont,
- drawText, event.x, event.y));
- }
-}
diff --git a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/ToolSettings.java b/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/ToolSettings.java
deleted file mode 100755
index 6d41a27dd8..0000000000
--- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/ToolSettings.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.eclipse.swt.examples.paint;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
- import org.eclipse.swt.*; import org.eclipse.swt.graphics.*;
- /** * Tool Settings objects group tool-related configuration information. */
-public class ToolSettings {
- public static final int ftNone = 0, ftOutline = 1, ftSolid = 2; /**
- * commonForegroundColor: current tool foreground colour
- */
- public Color commonForegroundColor;
-
- /**
- * commonBackgroundColor: current tool background colour
- */
- public Color commonBackgroundColor;
- /** * commonFont: current font */ public Font commonFont; /** * commonFillType: current fill type * <p>One of ftNone, ftOutline, ftSolid.</p> */ public int commonFillType = ftNone; /** * commonLineStyle: current line type */ public int commonLineStyle = SWT.LINE_SOLID;
- /**
- * airbrushRadius: coverage radius in pixels
- */
- public int airbrushRadius = 10;
-
- /**
- * airbrushIntensity: average surface area coverage in region defined by radius per "jot"
- */
- public int airbrushIntensity = 30; /** * roundedRectangleCornerDiameter: the diameter of curvature of corners in a rounded rectangle */ public int roundedRectangleCornerDiameter = 16; }
diff --git a/examples/org.eclipse.swt.examples/.classpath b/examples/org.eclipse.swt.examples/.classpath
deleted file mode 100755
index 14d2d27426..0000000000
--- a/examples/org.eclipse.swt.examples/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path=""/>
- <classpathentry kind="var" path="JRE_LIB"/>
- <classpathentry kind="src" path="/org.eclipse.swt"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/examples/org.eclipse.swt.examples/.cvsignore b/examples/org.eclipse.swt.examples/.cvsignore
deleted file mode 100755
index c5e82d7458..0000000000
--- a/examples/org.eclipse.swt.examples/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin \ No newline at end of file
diff --git a/examples/org.eclipse.swt.examples/.vcm_meta b/examples/org.eclipse.swt.examples/.vcm_meta
deleted file mode 100755
index e9dbb98bc0..0000000000
--- a/examples/org.eclipse.swt.examples/.vcm_meta
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project-description>
- <nature id="org.eclipse.jdt.core.javanature"/>
- <nature id="org.eclipse.pde.PluginNature"/>
- <reference project-name="org.eclipse.swt"/>
- <builder name="org.eclipse.jdt.core.javabuilder">
- </builder>
- <builder name="org.eclipse.pde.ManifestBuilder">
- </builder>
- <builder name="org.eclipse.pde.SchemaBuilder">
- </builder>
-</project-description>
diff --git a/examples/org.eclipse.swt.examples/build.properties b/examples/org.eclipse.swt.examples/build.properties
deleted file mode 100755
index 7ce5ebd2a6..0000000000
--- a/examples/org.eclipse.swt.examples/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-bin.includes = doc-html/,\
- plugin.properties,\
- plugin.xml,\
- swtexamples.jar
-source.swtexamples.jar = org/,examples*.properties,import.properties \ No newline at end of file
diff --git a/examples/org.eclipse.swt.examples/doc-html/hglegal.htm b/examples/org.eclipse.swt.examples/doc-html/hglegal.htm
deleted file mode 100755
index b071dbdf45..0000000000
--- a/examples/org.eclipse.swt.examples/doc-html/hglegal.htm
+++ /dev/null
@@ -1,14 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="GENERATOR" content="Mozilla/4.73 [en] (Win98; U) [Netscape]">
- <title>Legal Notices</title>
-</head>
-<body>
-
-<h3>
-<a NAME="Notices"></a>Notices</h3>
-(c) Copyright IBM Corp. 2000, 2001. All Rights Reserved.
-</body>
-</html>
diff --git a/examples/org.eclipse.swt.examples/doc-html/ngibmcpy.gif b/examples/org.eclipse.swt.examples/doc-html/ngibmcpy.gif
deleted file mode 100755
index 360f8e9989..0000000000
--- a/examples/org.eclipse.swt.examples/doc-html/ngibmcpy.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.swt.examples/doc-html/swt_addressbook_ex.html b/examples/org.eclipse.swt.examples/doc-html/swt_addressbook_ex.html
deleted file mode 100755
index c73a47cc44..0000000000
--- a/examples/org.eclipse.swt.examples/doc-html/swt_addressbook_ex.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>SWT - Address Book Example</title>
-</head>
-<body>
-
-<h2>Standard Widget Toolkit (SWT) Standalone Example - Address Book</h2>
-
-<h3>Introduction</h3>
-<p>
-The AddressBook example shows how the org.eclipse.swt.Table class can be
-used to present tabular information.
-</p>
-
-<h3>Running the example</h3>
-<p>
-If the Example Launcher is installed, select the Address Book item from the Standalone category and click Run.&nbsp;
-Otherwise, install and run the example manually as per the
-<a href="swt_manual_setup.html">Standalone Examples Manual Setup</a> instructions.&nbsp; The executable class is
-<code>org.eclipse.swt.examples.addressbook.AddressBook</code>.
-</p>
-
-<h3>Details</h3>
-<p>
-The application can save and load address books, sort the entries, search for strings within the fields and
-perform other operations that would typically be found in this kind of application.
-</p>
-
-<p><a href="hglegal.htm"><img SRC="ngibmcpy.gif" ALT="Copyright IBM Corporation 2000, 2001. All Rights Reserved." BORDER=0 height=12 width=195></a></p>
-</body>
-</html>
diff --git a/examples/org.eclipse.swt.examples/doc-html/swt_control_ex.html b/examples/org.eclipse.swt.examples/doc-html/swt_control_ex.html
deleted file mode 100755
index 2d3da944b3..0000000000
--- a/examples/org.eclipse.swt.examples/doc-html/swt_control_ex.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>SWT - Controls Example</title>
-</head>
-<body>
-
-<h2>Standard Widget Toolkit (SWT) Standalone Example - Controls</h2>
-
-<h3>Introduction</h3>
-<p>This example is a simple demonstration of common Standard Widget Toolkit
-(SWT) UI controls.&nbsp; It consists of a shell and tab folder where each
-tab in the folder allows the user to interact with a control.
-</p><p>
-This is a standalone version of the <a href="../../org.eclipse.swt.examples.controls/doc-html/swt_controls_ex.html">Controls
-Example.</a>
-</p>
-
-<h3>Running the example</h3>
-<p>Install and run the example manually as per the
-<a href="swt_manual_setup.html">Standalone Examples Manual Setup</a> instructions.&nbsp; The executable class is
-<code>org.eclipse.swt.examples.controlexample.ControlExample</code>.
-</p>
-
-<h3>Details</h3>
-<p>Each page (tab) of the controls example allows the user to interact with
-a different SWT control.&nbsp; The name of the control being demonstrated
-is on the page tab.
-</p>
-
-<p><a href="hglegal.htm"><img SRC="ngibmcpy.gif" ALT="Copyright IBM Corporation 2000, 2001. All Rights Reserved." BORDER=0 height=12 width=195></a></p>
-</body>
-</html>
diff --git a/examples/org.eclipse.swt.examples/doc-html/swt_fileviewer_ex.html b/examples/org.eclipse.swt.examples/doc-html/swt_fileviewer_ex.html
deleted file mode 100755
index 55d1502232..0000000000
--- a/examples/org.eclipse.swt.examples/doc-html/swt_fileviewer_ex.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>SWT - File Viewer Example</title>
-</head>
-<body>
-
-<h2>Standard Widget Toolkit (SWT) Standalone Example - File Viewer</h2>
-
-<h3>Introduction</h3>
-<p>The File Viewer example shows how a simple application can be implemented
-using SWT.&nbsp; This application provides the ability to browse files
-and folders.&nbsp; It includes the use of alternate threads for long actions
-and demonstrates the use of the Tree, Table, Toolbar and Program.
-</p>
-
-<h3>Running the example</h3>
-<p>If the Example Launcher is installed, select the File Viewer item from the Standalone category and click Run.&nbsp;
-Otherwise, install and run the example manually as per the
-<a href="swt_manual_setup.html">Standalone Examples Manual Setup</a> instructions.&nbsp; The executable class is
-<code>org.eclipse.swt.examples.fileviewer.FileViewer</code>.
-</p>
-
-<h3>Details</h3>
-<p>
-</p>
-
-<p><a href="hglegal.htm"><img SRC="ngibmcpy.gif" ALT="Copyright IBM Corporation 2000, 2001. All Rights Reserved." BORDER=0 height=12 width=195></a></p>
-</body>
-</html>
diff --git a/examples/org.eclipse.swt.examples/doc-html/swt_helloworld_ex.html b/examples/org.eclipse.swt.examples/doc-html/swt_helloworld_ex.html
deleted file mode 100755
index 8e970b20d2..0000000000
--- a/examples/org.eclipse.swt.examples/doc-html/swt_helloworld_ex.html
+++ /dev/null
@@ -1,52 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>SWT - Hello World Examples</title>
-</head>
-<body>
-
-<h2>Standard Widget Toolkit (SWT) Standalone Example - Hello World</h2>
-
-<h3>Introduction</h3>
-<p>The Hello World examples shows how to create a shell, use listeners, process
-events, and use SWT controls.
-</p>
-
-<h3>Running the example</h3>
-<p>If the Example Launcher is installed, select the Hello World [1-5] item from the Standalone category and click Run.&nbsp;
-Otherwise, install and run the example manually as per the
-<a href="swt_manual_setup.html">Standalone Examples Manual Setup</a> instructions.&nbsp; The executable classes are
-<code>org.eclipse.swt.examples.helloworld.HelloWorld[1-5]</code>.
-</p>
-
-<h3>Details</h3>
-
-<h4>Hello World 1</h4>
-<p>This example demonstrates the minimum amount of code required to open an
-SWT Shell and process the events.
-</p>
-
-<h4>Hello World 2</h4>
-<p>This example builds on HelloWorld1 and demonstrates the minimum amount
-of code required to open an SWT Shell with a Label and process the events.
-</p>
-
-<h4>Hello World 3</h4>
-<p>This example builds on HelloWorld2 and demonstrates how to resize the Label
-when the Shell resizes using a Listener mechanism.
-</p>
-
-<h4>Hello World 4</h4>
-<p>This example builds on HelloWorld2 and demonstrates how to resize the Label
-when the Shell resizes using a Layout.
-</p>
-
-<h4>Hello World 5</h4>
-<p>This example builds on HelloWorld1 and demonstrates how to draw directly
-on an SWT Control.
-</p>
-
-<p><a href="hglegal.htm"><img SRC="ngibmcpy.gif" ALT="Copyright IBM Corporation 2000, 2001. All Rights Reserved." BORDER=0 height=12 width=195></a></p>
-</body>
-</html>
diff --git a/examples/org.eclipse.swt.examples/doc-html/swt_hoverhelp_ex.html b/examples/org.eclipse.swt.examples/doc-html/swt_hoverhelp_ex.html
deleted file mode 100755
index 467a18d371..0000000000
--- a/examples/org.eclipse.swt.examples/doc-html/swt_hoverhelp_ex.html
+++ /dev/null
@@ -1,38 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>SWT - Explorer Example</title>
-</head>
-<body>
-
-<h2>Standard Widget Toolkit (SWT) Standalone Example - Hover Help</h2>
-
-<h3>Introduction</h3>
-<p>The Hover Help example shows how to implement custom tooltips and
-hover help support on a number of different SWT controls including
-Buttons, TableItems, ToolItems and TreeItems.
-</p>
-
-<h3>Running the example</h3>
-<p>If the Example Launcher is installed, select the Hover Help item from the Standalone category and click Run.&nbsp;
-Otherwise, install and run the example manually as per the
-<a href="swt_manual_setup.html">Standalone Examples Manual Setup</a> instructions.&nbsp; The executable class is
-<code>org.eclipse.swt.examples.hoverhelp.HoverHelp</code>.
-</p>
-
-<h3>Details</h3>
-<p>The example implements its own tooltip and hover help support.&nbsp; To see
-the custom tooltips in action, hover over an item or button in the UI.&nbsp;
-Notice that images appear in the left-hand corner of the tooltip, unlike
-standard SWT tooltips created using setToolTip() on those widgets
-that natively support them.&nbsp; To see the custom hover help in action,
-hover over an item or button in the UI as before until the tooltip
-is displayed.&nbsp; Without moving the pointer, hit F1.&nbsp; A new Shell will
-pop up with the extended hover help information for the UI element
-in question.
-</p>
-
-<p><a href="hglegal.htm"><img SRC="ngibmcpy.gif" ALT="Copyright IBM Corporation 2000, 2001. All Rights Reserved." BORDER=0 height=12 width=195></a></p>
-</body>
-</html>
diff --git a/examples/org.eclipse.swt.examples/doc-html/swt_imageanalyzer_ex.html b/examples/org.eclipse.swt.examples/doc-html/swt_imageanalyzer_ex.html
deleted file mode 100755
index b1e9af0da4..0000000000
--- a/examples/org.eclipse.swt.examples/doc-html/swt_imageanalyzer_ex.html
+++ /dev/null
@@ -1,56 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>SWT - Image Analyzer Example</title>
-</head>
-<body>
-
-<h2>Standard Widget Toolkit (SWT) Standalone Example - Image Analyzer</h2>
-
-<h3>Introduction</h3>
-<p>The ImageAnalyzer opens image files and displays the visual contents of
-the file along with a summary of the data in the image file.&nbsp; The
-user can make adjustments to various elements of the image such as scaling
-and Alpha blending and can save these changes to a file.
-</p>
-
-<h3>Running the example</h3>
-<p>If the Example Launcher is installed, select the Image Analyzer item from the Standalone category and click Run.&nbsp;
-Otherwise, install and run the example manually as per the
-<a href="swt_manual_setup.html">Standalone Examples Manual Setup</a> instructions.&nbsp; The executable class is
-<code>org.eclipse.swt.examples.imageanalyzer.ImageAnalyzer</code>.
-</p>
-
-<h3>Details</h3>
-<p>
-The ImageAnalyzer will load and display image files of type GIF, JPEG, BMP, ICO, and PNG.&nbsp;
-To open a file, use the File->Open... menu item, and select the image file in the FileDialog.
-</p><p>
-If the file is an interlaced GIF or PNG or a progressive JPEG, and Incremental Display is selected,
-then the ImageAnalyzer displays the image increments as they are being loaded.
-</p><p>
-If the file contains an animated GIF, then the Next, Previous, and Animate buttons become enabled,
-and they can be used to cycle through the images in the file, or animate them.&nbsp; If a GIF defines a background color,
-as many animated GIFs do, selecting Background will use the GIF's background color.
-</p><p>
-If the image has transparency (possible with GIF, PNG, or ICO), then selecting Display Mask will draw the image's transparency
-mask to the right of the image.&nbsp; You can change the background color of the ImageAnalyzer to see the transparency work.&nbsp;
-To turn off the transparency, deselect Display Transparency.
-</p><p>
-After an image is loaded, it can be scaled or have alpha transparency applied, using the Scale and Alpha-K combos,
-and the Alpha menu. File->Reopen restores scaling and Alpha to their default values and reloads the current image file.
-</p><p>
-File->Save As... can be used to save the currently loaded image to another type of image file.&nbsp; If the image has transparency,
-File->Save Mask As... saves the image's transparency mask.
-</p><p>
-When SWT loads an image file, an instance of org.eclipse.swt.graphics.ImageData is created.&nbsp; (In the case of an ICO file or
-multi-image GIF, an array of ImageData instances is created).&nbsp; The ImageAnalyzer displays all of the data stored in the ImageData
-instance(s) for the currently loaded image file, including the pixel data.&nbsp; Hovering over a pixel in the image display will show the RGB
-color data for that pixel.&nbsp; For certain images (particularly animated GIFs) additional data is stored in the org.eclipse.swt.graphics.ImageLoader
-instance used to load the image.&nbsp; The ImageAnalyzer displays this data as well.
-</p>
-
-<p><a href="hglegal.htm"><img SRC="ngibmcpy.gif" ALT="Copyright IBM Corporation 2000, 2001. All Rights Reserved." BORDER=0 height=12 width=195></a></p>
-</body>
-</html>
diff --git a/examples/org.eclipse.swt.examples/doc-html/swt_javaviewer_ex.html b/examples/org.eclipse.swt.examples/doc-html/swt_javaviewer_ex.html
deleted file mode 100755
index fdad5c3b07..0000000000
--- a/examples/org.eclipse.swt.examples/doc-html/swt_javaviewer_ex.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>SWT - Java Syntax Viewer Example</title>
-</head>
-<body>
-
-<h2>Standard Widget Toolkit (SWT) Standalone Example - Java Syntax Viewer</h2>
-
-<h3>Introduction</h3>
-<p>This example demonstrates how to implement a user-defined line styler for
-the StyledText widget.
-</p>
-
-<h3>Running the example</h3>
-<p>If the Example Launcher is installed, select the Java Viewer item from the Standalone category and click Run.&nbsp;
-Otherwise, install and run the example manually as per the
-<a href="swt_manual_setup.html">Standalone Examples Manual Setup</a> instructions.&nbsp; The executable class is
-<code>org.eclipse.swt.examples.javaviewer.JavaViewer</code>.
-</p>
-
-<h3>Details</h3>
-<p>The example provides a typical editor interface.&nbsp; To see the effect of the line
-styler, open a *.java file.&nbsp; When the contents of the file are displayed in the
-editor area, notice that the keywords have been highlighted.
-</p>
-
-<p><a href="hglegal.htm"><img SRC="ngibmcpy.gif" ALT="Copyright IBM Corporation 2000, 2001. All Rights Reserved." BORDER=0 height=12 width=195></a></p>
-</body>
-</html>
diff --git a/examples/org.eclipse.swt.examples/doc-html/swt_manual_setup.html b/examples/org.eclipse.swt.examples/doc-html/swt_manual_setup.html
deleted file mode 100755
index cb6b54720e..0000000000
--- a/examples/org.eclipse.swt.examples/doc-html/swt_manual_setup.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>SWT Standalone Examples Manual Setup</title>
-</head>
-<body>
-
-<h2>Standard Widget Toolkit (SWT) - Standalone Examples Manual Setup</h2>
-
-<h3>Setup</h3>
-<p>There are several steps required to run the SWT standalone examples manually.
-</p>
-
-<ul>
-<li><p>
-Create a Java Project to contain the examples.&nbsp; Call it <b>SWT Examples</b>.
-</p>
-
-<li><p>
-Make sure the <b>swt.jar</b> file is on the java classpath, by doing the following:<br>
-Select the SWT Examples Project and bring up the Properties dialog.<br>
-On the Java Build Path page, select the Libraries tab, click on the Add External JARs button and select <b>swt.jar</b>.<br>
-Next, click on the Attach Source button, then click on the Browse File System button and select <b>swtsrc.zip</b>.<br>
-The files can be found in the following directory, depending one which Operating System you are using to run Eclipse:
-<ul>
-<li>Windows - &lt;install-dir&gt;\eclipse\plugins\org.eclipse.swt\
-<li>Motif - &lt;install-dir&gt;/eclipse/plugins/org.eclipse.swt/
-</ul>
-Click OK to save the Project properties.<br>
-</p>
-
-<li><p>
-Make sure the <b>swtexamples.jar</b> is on the java classpath, by doing the following:<br>
-Select the SWT Examples Project and bring up the Properties dialog.<br>
-On the Java Build Path page, select the Libraries tab, click on the Add External JARs button and select <b>swtexamples.jar</b>.<br>
-Next, click on the Attach Source button, then click on the Browse File System button and select <b>swtexamplessrc.zip</b>.<br>
-The files can be found in the following directory, depending one which Operating System you are using to run Eclipse:
-<ul>
-<li>Windows - &lt;install-dir&gt;\eclipse\plugins\org.eclipse.swt.examples\
-<li>Motif - &lt;install-dir&gt;/eclipse/plugins/org.eclipse.swt.examples/
-</ul>
-Click OK to save the Project properties.<br>
-</p>
-
-<li><p>
-Make sure that referenced libraries are visible in the Packages view, by doing the following:<br>
-In the Packages view of the Java Perspective, drop down the View menu.<br>
-Ensure that <b>Show Referenced Libraries</b> is checked.
-</p>
-
-<li><p>
-Make sure the <b>SWT runtime library</b> is in the library search path, by doing the following:<br>
-In the Packages view of the Java Perspective, expand <b>swtexamples.jar</b>.<br>
-You will see all of the packages and other resource files present in the jar file, including the executable class for each example.<br>
-Select the executable class (the one containing the main() method) for the particular example that you wish to run and bring up the Properties dialog.<br>
-On the Execution Arguments page, select the VM arguments field and enter <b>-Djava.library.path=&lt;runtime-library-path&gt;</b>.<br>
-The runtime library path is the following directory, depending one which Operating System you are using to run Eclipse:
-<ul>
-<li>Windows - &lt;install-dir&gt;\eclipse\plugins\org.eclipse.swt\ws\win32
-<li>Motif - &lt;install-dir&gt;/eclipse/plugins/org.eclipse.swt/ws/motif
-</ul>
-Click OK to save the Java Resource properties.<br>
-</p>
-
-</ul>
-
-<h3><a NAME="Run"></a>Running the Examples</h3>
-<p>In the Packages view of the Java Perspective, expand <b>swtexamples.jar</b>.&nbsp;
-You will see all of the packages and other resource files present in the jar file,
-including the executable class for each example.
-</p>
-<p>All of the standalone SWT examples are intended to be run as Java
-Applications.&nbsp; No parameters need be passed to any of these examples,
-other than any required VM arguments.&nbsp; To run an example, simply
-select the executable class for the particular example, then click the Run button on the toolbar.
-</p>
-
-<h3><a NAME="Package"></a>Examples Manifest</h3>
-<p>Consult the documentation of each individual example for the names of
-its executable class(es) and additional details.
-</p>
-<p>
-<code>swtexamples.jar</code> contains the following examples:
-<ul>
-<li><a href="swt_addressbook_ex.html">Address Book</a>
-<li><a href="swt_fileviewer_ex.html">File Viewer</a>
-<li><a href="swt_helloworld_ex.html">Hello World [1-5]</a>
-<li><a href="swt_hoverhelp_ex.html">Hover Help</a>
-<li><a href="swt_imageanalyzer_ex.html">Image Analyzer</a>
-<li><a href="swt_javaviewer_ex.html">Java Viewer</a>
-<li><a href="swt_texteditor_ex.html">Text Editor</a>
-</ul>
-</p>
-
-<p><br><a href="hglegal.htm"><img SRC="ngibmcpy.gif" ALT="Copyright IBM Corporation 2000, 2001. All Rights Reserved." BORDER=0 height=12 width=195></a>
-</body>
-</html>
diff --git a/examples/org.eclipse.swt.examples/doc-html/swt_texteditor_ex.html b/examples/org.eclipse.swt.examples/doc-html/swt_texteditor_ex.html
deleted file mode 100755
index fba54b490b..0000000000
--- a/examples/org.eclipse.swt.examples/doc-html/swt_texteditor_ex.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>SWT - Text Editor Example</title>
-</head>
-<body>
-
-<h2>Standard Widget Toolkit (SWT) Standalone Example - Text Editor</h2>
-
-<h3>Introduction</h3>
-<p>This example demonstrates how to use the StyledText widget to implement
-a text editor with formatting support.
-</p>
-
-<h3>Running the example</h3>
-<p>If the Example Launcher is installed, select the Text Editor item from the Standalone category and click Run.&nbsp;
-Otherwise, install and run the example manually as per the
-<a href="swt_manual_setup.html">Standalone Examples Manual Setup</a> instructions.&nbsp; The executable class is
-<code>org.eclipse.swt.examples.texteditor.TextEditor</code>.
-</p>
-
-<h3>Details</h3>
-<p>The example has a typical text editor interface.&nbsp; The File menu contains Cut, Copy, Paste and Set Font
-items and the toolbar provides a bold text toggle, three colour tools that operate on the current selection,
-and a reset to defaults button that also operates on the current selection.
-</p>
-
-<p><a href="hglegal.htm"><img SRC="ngibmcpy.gif" ALT="Copyright IBM Corporation 2000, 2001. All Rights Reserved." BORDER=0 height=12 width=195></a></p>
-</body>
-</html>
diff --git a/examples/org.eclipse.swt.examples/examples_addressbook.properties b/examples/org.eclipse.swt.examples/examples_addressbook.properties
deleted file mode 100755
index b416bed826..0000000000
--- a/examples/org.eclipse.swt.examples/examples_addressbook.properties
+++ /dev/null
@@ -1,59 +0,0 @@
-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
-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/examples_control.properties b/examples/org.eclipse.swt.examples/examples_control.properties
deleted file mode 100755
index 973bae141d..0000000000
--- a/examples/org.eclipse.swt.examples/examples_control.properties
+++ /dev/null
@@ -1,181 +0,0 @@
-error.CouldNotLoadResources = Unable to load resources
-window.title = SWT 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
-State = State
-Enabled = Enabled
-Visible = Visible
-Preferred = Preferred
-Styles = Styles
-Text_Labels = Text Labels
-Image_Labels = Image Labels
-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
-Dialog_Result = Dialog Result
-ColorDialog = ColorDialog
-DirectoryDialog = DirectoryDialog
-FileDialog = FileDialog
-FontDialog = FontDialog
-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
-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:
-Result = Result:
-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 = <empty>
-TableLine0_1 = classes
-TableLine0_2 = 0
-TableLine0_3 = today
-TableLine1_0 = <empty>
-TableLine1_1 = databases
-TableLine1_2 = 2556
-TableLine1_3 = <empty>
-TableLine2_0 = <empty>
-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
-Button = Button
-Combo = Combo
-Dialog = Dialog
-Label = Label
-List = List
-ProgressBar = ProgressBar
-Sash = Sash
-Shell = Shell
-Slider_and_Scale = Slider and Scale
-Table = Table
-Text = Text
-ToolBar = ToolBar
-Tree = Tree
-StyledText = StyledText
-Slider = Slider
-Scale = Scale
-SWT_PUSH = SWT.PUSH
-SWT_CHECK = SWT.CHECK
-SWT_RADIO = SWT.RADIO
-SWT_TOGGLE = SWT.TOGGLE
-SWT_ARROW = SWT.ARROW
-SWT_BORDER = SWT.BORDER
-SWT_DROP_DOWN = SWT.DROP_DOWN
-SWT_READ_ONLY = SWT.READ_ONLY
-SWT_SIMPLE = SWT.SIMPLE
-SWT_SEPARATOR = SWT.SEPARATOR
-SWT_HORIZONTAL = SWT.HORIZONTAL
-SWT_VERTICAL = SWT.VERTICAL
-SWT_SHADOW_IN = SWT.SHADOW_IN
-SWT_SHADOW_OUT = SWT.SHADOW_OUT
-SWT_SINGLE = SWT.SINGLE
-SWT_MULTI = SWT.MULTI
-SWT_H_SCROLL = SWT.H_SCROLL
-SWT_V_SCROLL = SWT.V_SCROLL
-SWT_FLAT = SWT.FLAT
-SWT_WRAP = SWT.WRAP
-SWT_SAVE = SWT.SAVE
-SWT_OPEN = SWT.OPEN
-SWT_PRIMARY_MODAL = SWT.PRIMARY_MODAL
-SWT_APPLICATION_MODAL = SWT.APPLICATION_MODAL
-SWT_SYSTEM_MODAL = SWT.SYSTEM_MODAL
-SWT_MODELESS = SWT.MODELESS
-SWT_ICON_ERROR = SWT.ICON_ERROR
-SWT_ICON_INFORMATION = SWT.ICON_INFORMATION
-SWT_ICON_QUESTION = SWT.ICON_QUESTION
-SWT_ICON_WARNING = SWT.ICON_WARNING
-SWT_ICON_WORKING = SWT.ICON_WORKING
-SWT_OK = SWT.OK
-SWT_CANCEL = SWT.CANCEL
-SWT_YES = SWT.YES
-SWT_NO = SWT.NO
-SWT_RETRY = SWT.RETRY
-SWT_ABORT = SWT.ABORT
-SWT_IGNORE = SWT.IGNORE
-SWT_NO_TRIM = SWT.NO_TRIM
-SWT_CLOSE = SWT.CLOSE
-SWT_TITLE = SWT.TITLE
-SWT_MIN = SWT.MIN
-SWT_MAX = SWT.MAX
-SWT_RESIZE = SWT.RESIZE
-SWT_FULL_SELECTION = SWT.FULL_SELECTION
-SWT_SMOOTH = SWT.SMOOTH \ No newline at end of file
diff --git a/examples/org.eclipse.swt.examples/examples_fileviewer.properties b/examples/org.eclipse.swt.examples/examples_fileviewer.properties
deleted file mode 100755
index 3fc373efdf..0000000000
--- a/examples/org.eclipse.swt.examples/examples_fileviewer.properties
+++ /dev/null
@@ -1,59 +0,0 @@
-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/examples_helloworld.properties b/examples/org.eclipse.swt.examples/examples_helloworld.properties
deleted file mode 100755
index 2db6671c37..0000000000
--- a/examples/org.eclipse.swt.examples/examples_helloworld.properties
+++ /dev/null
@@ -1 +0,0 @@
-Hello_world = Hello World \ No newline at end of file
diff --git a/examples/org.eclipse.swt.examples/examples_hoverhelp.properties b/examples/org.eclipse.swt.examples/examples_hoverhelp.properties
deleted file mode 100755
index b1e118e3fa..0000000000
--- a/examples/org.eclipse.swt.examples/examples_hoverhelp.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-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/examples_images.properties b/examples/org.eclipse.swt.examples/examples_images.properties
deleted file mode 100755
index 2e3cd555aa..0000000000
--- a/examples/org.eclipse.swt.examples/examples_images.properties
+++ /dev/null
@@ -1,94 +0,0 @@
-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}
-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
-Open = &Open...\tCtrl+O
-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
-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
-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/examples_javaviewer.properties b/examples/org.eclipse.swt.examples/examples_javaviewer.properties
deleted file mode 100755
index 8c589d1470..0000000000
--- a/examples/org.eclipse.swt.examples/examples_javaviewer.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-Open_menuitem=&Open
-Close_menuitem=&Close
-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/examples_texteditor.properties b/examples/org.eclipse.swt.examples/examples_texteditor.properties
deleted file mode 100755
index e53ce09e38..0000000000
--- a/examples/org.eclipse.swt.examples/examples_texteditor.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-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 \ No newline at end of file
diff --git a/examples/org.eclipse.swt.examples/import.properties b/examples/org.eclipse.swt.examples/import.properties
deleted file mode 100755
index 53f7dd67c7..0000000000
--- a/examples/org.eclipse.swt.examples/import.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-# 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 = <<ECLIPSE_PLUGINS>>
-vmargs.org/eclipse/swt/examples/addressbook/AddressBook.java%AddressBook = "-Djava.library.path=<<SWT_LIBRARY_PATH>>"
-vmargs.org/eclipse/swt/examples/controlexample/ControlExample.java%ControlExample = "-Djava.library.path=<<SWT_LIBRARY_PATH>>"
-vmargs.org/eclipse/swt/examples/fileviewer/FileViewer.java%FileViewer = "-Djava.library.path=<<SWT_LIBRARY_PATH>>"
-vmargs.org/eclipse/swt/examples/helloworld/HelloWorld1.java%HelloWorld1 = "-Djava.library.path=<<SWT_LIBRARY_PATH>>"
-vmargs.org/eclipse/swt/examples/helloworld/HelloWorld2.java%HelloWorld2 = "-Djava.library.path=<<SWT_LIBRARY_PATH>>"
-vmargs.org/eclipse/swt/examples/helloworld/HelloWorld3.java%HelloWorld3 = "-Djava.library.path=<<SWT_LIBRARY_PATH>>"
-vmargs.org/eclipse/swt/examples/helloworld/HelloWorld4.java%HelloWorld4 = "-Djava.library.path=<<SWT_LIBRARY_PATH>>"
-vmargs.org/eclipse/swt/examples/helloworld/HelloWorld5.java%HelloWorld5 = "-Djava.library.path=<<SWT_LIBRARY_PATH>>"
-vmargs.org/eclipse/swt/examples/hoverhelp/HoverHelp.java%HoverHelp = "-Djava.library.path=<<SWT_LIBRARY_PATH>>"
-vmargs.org/eclipse/swt/examples/imageanalyzer/ImageAnalyzer.java%ImageAnalyzer = "-Djava.library.path=<<SWT_LIBRARY_PATH>>"
-vmargs.org/eclipse/swt/examples/javaviewer/JavaViewer.java%JavaViewer = "-Djava.library.path=<<SWT_LIBRARY_PATH>>"
-vmargs.org/eclipse/swt/examples/texteditor/TextEditor.java%TextEditor = "-Djava.library.path=<<SWT_LIBRARY_PATH>>"
diff --git a/examples/org.eclipse.swt.examples/org/eclipse/swt/examples/addressbook/AddressBook.java b/examples/org.eclipse.swt.examples/org/eclipse/swt/examples/addressbook/AddressBook.java
deleted file mode 100755
index 5ca6ad0fce..0000000000
--- a/examples/org.eclipse.swt.examples/org/eclipse/swt/examples/addressbook/AddressBook.java
+++ /dev/null
@@ -1,909 +0,0 @@
-package org.eclipse.swt.examples.addressbook;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-/* Imports */
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
-import java.io.*;
-import java.util.zip.*;
-import java.util.ResourceBundle;
-
-/**
- * AddressBookExample is an example that uses <code>org.eclipse.swt</code>
- * 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 static final String DELIMITER = ",";
- 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) {
- AddressBook application = new AddressBook();
- application.open();
- application.run();
-}
-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 <code>Menu</code> 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 <code>String</code> 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++) {
- String newString = "";
- 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;
-}
-/**
- * Merges two arrays (assumed to be individually sorted) of string arrays into
- * one sorted array by the value stored at the columnIndex parameter. This method
- * is used in <code>mergeSort(String[][] tableItems, int columnIndex)</code>.
- *
- * @param firstHalf String[][]
- * The first array of Strings to be merged.
- * @param secondHalf String[][]
- * The second array of Strings to be merged.
- * @param columnIndex int
- * The column by which the String arrays will be compared.
- * @return String[][]
- * An array of array of String that is the merged (and sorted) combination
- * of the two parameter arrays.
- */
-private String[][] merge(String[][] firstHalf, String[][] secondHalf, int column) {
- int x = firstHalf.length + secondHalf.length;
- int y = Math.max(firstHalf[0].length, secondHalf[0].length);
- String[][] sorted = new String[x][y];
-
- int firstHalfIndex = 0;
- int secondHalfIndex = 0;
- int sortedIndex = 0;
-
- //merge
- while(firstHalfIndex < firstHalf.length && secondHalfIndex < secondHalf.length) {
- if(firstHalf[firstHalfIndex][column].compareToIgnoreCase(secondHalf[secondHalfIndex][column]) <= 0 ) {
- sorted[sortedIndex] = firstHalf[firstHalfIndex];
- sortedIndex++;
- firstHalfIndex++;
- } else {
- sorted[sortedIndex] = secondHalf[secondHalfIndex];
- sortedIndex++;
- secondHalfIndex++;
- }
- }
-
- //copy remaining items into sorted.
- while(firstHalfIndex < firstHalf.length) {
- sorted[sortedIndex] = firstHalf[firstHalfIndex];
- sortedIndex++;
- firstHalfIndex++;
- }
-
- while(secondHalfIndex < secondHalf.length) {
- sorted[sortedIndex] = secondHalf[secondHalfIndex];
- sortedIndex++;
- secondHalfIndex++;
- }
-
- return sorted;
-}
-/**
- * Takes an array of array of Strings and sorts them into ascending order according to the
- * data in the column specified. Note that this sort is recursive.
- *
- * @param tableItems String[][]
- * The array of Strings that will be sorted.
- * @param columnIndex int
- * The column in the String arrays by which the arrays will be compared.
- * @return String[][]
- * The resultant sorted version of the tableItems parameter.
- * @see #merge(String[][] firstHalf, String[][] secondHalf, int columnIndex)
- */
-private String[][] mergeSort(String[][] items, int column) {
- int numItems = items.length;
-
- if(numItems <= 1) return items;
-
- int split = numItems / 2;
- String[][] firstHalf = new String[split][items[0].length];
- String[][] secondHalf = new String[numItems - split][items[0].length];
- for(int i = 0; i < firstHalf.length; i++) {
- firstHalf[i] = items[i];
- }
- for(int i = 0; i < secondHalf.length; i++) {
- secondHalf[i] = items[split + i];
- }
-
- String[][] firstHalfSorted = mergeSort(firstHalf, column);
- String[][] secondHalfSorted = mergeSort(secondHalf, column);
- String[][] sortedItems = merge(firstHalfSorted, secondHalfSorted, column);
-
- return sortedItems;
-}
-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 open() {
- Display display = new 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 widgetDoubleSelected(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();
-}
-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") + " (*.*)"});
- fileDialog.open();
- String name = fileDialog.getFileName();
-
- if(name == null) return;
-
- File file = new File(fileDialog.getFilterPath(), 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]);
- }
- tableInfo = mergeSort(tableInfo, 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 void run() {
- //read and dispatch until termination
- Display display = shell.getDisplay();
- while(!shell.isDisposed()){
- if(!display.readAndDispatch())
- display.sleep();
- }
-}
-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);
- }
- }
-
- data = mergeSort(data, column);
-
- for (int i = 0; i < data.length; i++) {
- items[i].setText(data[i]);
- }
-
-}
-/**
- * Creates all the items located in the File submenu and
- * associate all the menu items with their appropriate
- * functions.
- *
- * @param menuBar Menu
- * the <code>Menu</code> 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.CTRL + '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.CTRL + '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.CTRL + 'B');
- subItem.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- closeAddressBook();
- newAddressBook();
- }
- });
-
- //File -> Open
- subItem = new MenuItem(menu, SWT.NULL);
- subItem.setText(resAddressBook.getString("Open_address_book"));
- subItem.setAccelerator(SWT.CTRL + 'O');
- subItem.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- closeAddressBook();
- openAddressBook();
- }
- });
-
- //File -> Save.
- subItem = new MenuItem(menu, SWT.NULL);
- subItem.setText(resAddressBook.getString("Save_address_book"));
- subItem.setAccelerator(SWT.CTRL + '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.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 <code>Menu</code> 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.CTRL + '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.CTRL + '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.CTRL + '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 <code>Menu</code> 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.CTRL + '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 <code>Menu</code> 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();
- }
- });
-}
-}
diff --git a/examples/org.eclipse.swt.examples/org/eclipse/swt/examples/addressbook/DataEntryDialog.java b/examples/org.eclipse.swt.examples/org/eclipse/swt/examples/addressbook/DataEntryDialog.java
deleted file mode 100755
index 35e0425bff..0000000000
--- a/examples/org.eclipse.swt.examples/org/eclipse/swt/examples/addressbook/DataEntryDialog.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package org.eclipse.swt.examples.addressbook;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-/* 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 <code>org.eclipse.swt</code>
- * libraries to implement a dialog that accepts basic personal information that
- * is added to a <code>Table</code> widget or edits a <code>TableItem</code> 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 <code>Text</code> widgets in the dialog in a
- * <code>String</code> 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 <code>Text</code> 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 <code>Text</code> 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/org/eclipse/swt/examples/addressbook/FindListener.java b/examples/org.eclipse.swt.examples/org/eclipse/swt/examples/addressbook/FindListener.java
deleted file mode 100755
index 88d70e4791..0000000000
--- a/examples/org.eclipse.swt.examples/org/eclipse/swt/examples/addressbook/FindListener.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.eclipse.swt.examples.addressbook;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-public interface FindListener {
-
-public boolean find();
-
-}
diff --git a/examples/org.eclipse.swt.examples/org/eclipse/swt/examples/addressbook/SearchDialog.java b/examples/org.eclipse.swt.examples/org/eclipse/swt/examples/addressbook/SearchDialog.java
deleted file mode 100755
index 6a7d620401..0000000000
--- a/examples/org.eclipse.swt.examples/org/eclipse/swt/examples/addressbook/SearchDialog.java
+++ /dev/null
@@ -1,197 +0,0 @@
-package org.eclipse.swt.examples.addressbook;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-/* Imports */
-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 java.util.ResourceBundle;
-
-/**
- * SearchDialog is a simple class that uses <code>org.eclipse.swt</code>
- * 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 ());
- directio