From 2ce56e593aae79c5d62b76ce3a484a371a5fa554 Mon Sep 17 00:00:00 2001 From: cvs2svn Date: Wed, 18 Dec 2002 16:52:21 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'v2122b'. Sprout from master 2002-12-17 20:32:13 UTC Silenio Quarti '*** empty log message ***' Cherrypick from master 2002-12-18 16:52:20 UTC Silenio Quarti '*** empty log message ***': bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Display.java Delete: examples/org.eclipse.swt.examples.controls/.classpath examples/org.eclipse.swt.examples.controls/.cvsignore examples/org.eclipse.swt.examples.controls/.project examples/org.eclipse.swt.examples.controls/about.html examples/org.eclipse.swt.examples.controls/build.properties examples/org.eclipse.swt.examples.controls/doc-html/hglegal2002.htm examples/org.eclipse.swt.examples.controls/doc-html/ngibmcpy2002.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/plugin.properties examples/org.eclipse.swt.examples.controls/plugin.xml examples/org.eclipse.swt.examples.controls/src/import.properties examples/org.eclipse.swt.examples.controls/src/org/eclipse/swt/examples/controls/ControlPlugin.java examples/org.eclipse.swt.examples.controls/src/org/eclipse/swt/examples/controls/ControlView.java examples/org.eclipse.swt.examples.launcher/.classpath examples/org.eclipse.swt.examples.launcher/.cvsignore examples/org.eclipse.swt.examples.launcher/.project examples/org.eclipse.swt.examples.launcher/about.html examples/org.eclipse.swt.examples.launcher/build.properties examples/org.eclipse.swt.examples.launcher/doc-html/hglegal2002.htm examples/org.eclipse.swt.examples.launcher/doc-html/ngibmcpy2002.gif examples/org.eclipse.swt.examples.launcher/doc-html/swt_launcher_ex.html examples/org.eclipse.swt.examples.launcher/doc/org.eclipse.swt.examples.launcher.launchItems.html examples/org.eclipse.swt.examples.launcher/icons/closedFolder.gif examples/org.eclipse.swt.examples.launcher/icons/generic_example.gif examples/org.eclipse.swt.examples.launcher/icons/launcher_example.gif examples/org.eclipse.swt.examples.launcher/icons/openFolder.gif examples/org.eclipse.swt.examples.launcher/plugin.properties examples/org.eclipse.swt.examples.launcher/plugin.xml examples/org.eclipse.swt.examples.launcher/schema/org.eclipse.swt.examples.launcher.launchItems.exsd examples/org.eclipse.swt.examples.launcher/src/import.properties examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/ItemDescriptor.java examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/ItemTreeNode.java examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/LauncherPlugin.java examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/LauncherView.java examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/SplitLayout.java examples/org.eclipse.swt.examples.layouts/.classpath examples/org.eclipse.swt.examples.layouts/.cvsignore examples/org.eclipse.swt.examples.layouts/.project examples/org.eclipse.swt.examples.layouts/about.html examples/org.eclipse.swt.examples.layouts/build.properties examples/org.eclipse.swt.examples.layouts/doc-html/hglegal2002.htm examples/org.eclipse.swt.examples.layouts/doc-html/ngibmcpy2002.gif examples/org.eclipse.swt.examples.layouts/doc-html/swt_layout_ex.html examples/org.eclipse.swt.examples.layouts/icons/layouts_example.gif examples/org.eclipse.swt.examples.layouts/plugin.properties examples/org.eclipse.swt.examples.layouts/plugin.xml examples/org.eclipse.swt.examples.layouts/src/import.properties examples/org.eclipse.swt.examples.layouts/src/org/eclipse/swt/examples/layouts/LayoutPlugin.java examples/org.eclipse.swt.examples.layouts/src/org/eclipse/swt/examples/layouts/LayoutView.java examples/org.eclipse.swt.examples.ole.win32/.classpath examples/org.eclipse.swt.examples.ole.win32/.cvsignore examples/org.eclipse.swt.examples.ole.win32/.project examples/org.eclipse.swt.examples.ole.win32/about.html examples/org.eclipse.swt.examples.ole.win32/build.properties examples/org.eclipse.swt.examples.ole.win32/doc-html/hglegal2002.htm examples/org.eclipse.swt.examples.ole.win32/doc-html/ngibmcpy2002.gif examples/org.eclipse.swt.examples.ole.win32/doc-html/swt_ole_ex.html examples/org.eclipse.swt.examples.ole.win32/icons/backward_nav.gif examples/org.eclipse.swt.examples.ole.win32/icons/forward_nav.gif examples/org.eclipse.swt.examples.ole.win32/icons/home_nav.gif examples/org.eclipse.swt.examples.ole.win32/icons/refresh_nav.gif examples/org.eclipse.swt.examples.ole.win32/icons/search_nav.gif examples/org.eclipse.swt.examples.ole.win32/icons/stop_nav.gif examples/org.eclipse.swt.examples.ole.win32/icons/webbrowser_example.gif examples/org.eclipse.swt.examples.ole.win32/plugin.properties examples/org.eclipse.swt.examples.ole.win32/plugin.xml examples/org.eclipse.swt.examples.ole.win32/src/import.properties examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OleBrowserView.java examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OlePlugin.java examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OleWebBrowser.java examples/org.eclipse.swt.examples.paint/.classpath examples/org.eclipse.swt.examples.paint/.cvsignore examples/org.eclipse.swt.examples.paint/.project examples/org.eclipse.swt.examples.paint/about.html examples/org.eclipse.swt.examples.paint/build.properties examples/org.eclipse.swt.examples.paint/doc-html/hglegal2002.htm examples/org.eclipse.swt.examples.paint/doc-html/ngibmcpy2002.gif examples/org.eclipse.swt.examples.paint/doc-html/swt_paint_ex.html examples/org.eclipse.swt.examples.paint/icons/fill_none.gif examples/org.eclipse.swt.examples.paint/icons/fill_outline.gif examples/org.eclipse.swt.examples.paint/icons/fill_solid.gif examples/org.eclipse.swt.examples.paint/icons/linestyle_dash.gif examples/org.eclipse.swt.examples.paint/icons/linestyle_dashdot.gif examples/org.eclipse.swt.examples.paint/icons/linestyle_dot.gif examples/org.eclipse.swt.examples.paint/icons/linestyle_solid.gif examples/org.eclipse.swt.examples.paint/icons/options_font.gif examples/org.eclipse.swt.examples.paint/icons/paint_example.gif examples/org.eclipse.swt.examples.paint/icons/tool_airbrush.gif examples/org.eclipse.swt.examples.paint/icons/tool_ellipse.gif examples/org.eclipse.swt.examples.paint/icons/tool_line.gif examples/org.eclipse.swt.examples.paint/icons/tool_pencil.gif examples/org.eclipse.swt.examples.paint/icons/tool_polyline.gif examples/org.eclipse.swt.examples.paint/icons/tool_rectangle.gif examples/org.eclipse.swt.examples.paint/icons/tool_roundedrectangle.gif examples/org.eclipse.swt.examples.paint/icons/tool_text.gif examples/org.eclipse.swt.examples.paint/plugin.properties examples/org.eclipse.swt.examples.paint/plugin.xml examples/org.eclipse.swt.examples.paint/src/import.properties examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/AirbrushTool.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/BasicPaintSession.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/ContainerFigure.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/ContinuousPaintSession.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/DragPaintSession.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/EllipseFigure.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/EllipseTool.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/Figure.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/FigureDrawContext.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/LineFigure.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/LineTool.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintPlugin.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintSession.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintSurface.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintTool.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintView.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PencilTool.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PointFigure.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PolyLineTool.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RectangleFigure.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RectangleTool.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RoundedRectangleFigure.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RoundedRectangleTool.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SegmentedPaintSession.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidEllipseFigure.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidPolygonFigure.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidRectangleFigure.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidRoundedRectangleFigure.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/TextFigure.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/TextTool.java examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/ToolSettings.java examples/org.eclipse.swt.examples/.classpath examples/org.eclipse.swt.examples/.cvsignore examples/org.eclipse.swt.examples/.project examples/org.eclipse.swt.examples/about.html examples/org.eclipse.swt.examples/build.properties examples/org.eclipse.swt.examples/doc-html/hglegal2002.htm examples/org.eclipse.swt.examples/doc-html/ngibmcpy2002.gif examples/org.eclipse.swt.examples/doc-html/swt_addressbook_ex.html examples/org.eclipse.swt.examples/doc-html/swt_controls_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_launcher_ex.html examples/org.eclipse.swt.examples/doc-html/swt_layout_ex.html examples/org.eclipse.swt.examples/doc-html/swt_manual_setup.html examples/org.eclipse.swt.examples/doc-html/swt_texteditor_ex.html examples/org.eclipse.swt.examples/plugin.properties examples/org.eclipse.swt.examples/plugin.xml examples/org.eclipse.swt.examples/src/examples_addressbook.properties examples/org.eclipse.swt.examples/src/examples_control.properties examples/org.eclipse.swt.examples/src/examples_fileviewer.properties examples/org.eclipse.swt.examples/src/examples_helloworld.properties examples/org.eclipse.swt.examples/src/examples_hoverhelp.properties examples/org.eclipse.swt.examples/src/examples_images.properties examples/org.eclipse.swt.examples/src/examples_javaviewer.properties examples/org.eclipse.swt.examples/src/examples_layout.properties examples/org.eclipse.swt.examples/src/examples_texteditor.properties examples/org.eclipse.swt.examples/src/import.properties examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/AddressBook.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/DataEntryDialog.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/FindListener.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/SearchDialog.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/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/CoolBarTab.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/bold.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/bold_mask.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/closedFolder.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/openFolder.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/red.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/red_mask.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/target.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/yellow.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/yellow_mask.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/FileViewer.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/IconCache.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Copy.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Cut.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Delete.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Parent.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Paste.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Print.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Refresh.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Rename.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Search.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/generic_example.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/icon_ClosedDrive.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/icon_ClosedFolder.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/icon_File.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/icon_OpenDrive.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/icon_OpenFolder.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld1.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld2.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld3.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld4.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld5.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/hoverhelp/HoverHelp.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/hoverhelp/information.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/hoverhelp/warning.gif examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/imageanalyzer/ImageAnalyzer.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaLineStyler.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaViewer.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/FillLayoutTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/FormLayoutTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/GridLayoutTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/LayoutExample.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/RowLayoutTab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/Tab.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/Images.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/TextEditor.java examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/blue.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/blue_mask.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/bold.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/bold_mask.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/erase.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/erase_mask.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/green.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/green_mask.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/red.bmp examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/red_mask.bmp tests/org.eclipse.swt.tests/.classpath tests/org.eclipse.swt.tests/.cvsignore tests/org.eclipse.swt.tests/.project tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/AllGraphicsTests.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/AllTests.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/AllWidgetTests.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/EmulatedWidgetsTests.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/StyledTextContentSpec.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtJunit.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtTestCase.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_SWT.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_SWTError.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_SWTException.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_AnimatedProgress.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_BidiSegmentEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_BidiSegmentListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_BusyIndicator.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CCombo.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CLabel.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CTabFolder.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CTabFolderAdapter.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CTabFolderEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CTabFolderListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CTabItem.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_ControlEditor.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_ExtendedModifyEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_ExtendedModifyListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_LineBackgroundEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_LineBackgroundListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_LineStyleEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_LineStyleListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_PopupList.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_ST.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_SashForm.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_ScrolledComposite.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StackLayout.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyleRange.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledTextContent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TableEditor.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TableTree.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TableTreeEditor.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TableTreeItem.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TextChangeListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TextChangedEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TextChangingEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TreeEditor.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_VerifyKeyListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_ViewForm.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_ByteArrayTransfer.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_Clipboard.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_DND.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_DragSource.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_DragSourceAdapter.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_DragSourceEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_DragSourceListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_DropTarget.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_DropTargetAdapter.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_DropTargetEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_DropTargetListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_FileTransfer.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_RTFTransfer.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_TextTransfer.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_Transfer.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_TransferData.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_ArmEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_ArmListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_ControlAdapter.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_ControlEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_ControlListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_DisposeEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_DisposeListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_FocusAdapter.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_FocusEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_FocusListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_HelpEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_HelpListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_KeyAdapter.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_KeyEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_KeyListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_MenuAdapter.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_MenuEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_MenuListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_ModifyEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_ModifyListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_MouseAdapter.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_MouseEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_MouseListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_MouseMoveListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_MouseTrackAdapter.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_MouseTrackListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_PaintEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_PaintListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_SelectionAdapter.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_SelectionEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_SelectionListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_ShellAdapter.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_ShellEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_ShellListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_TraverseEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_TraverseListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_TreeAdapter.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_TreeEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_TreeListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_TypedEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_VerifyEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_VerifyListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Color.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Cursor.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Device.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_DeviceData.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Drawable.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Font.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_FontData.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_FontMetrics.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_GC.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_GCData.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Image.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_ImageData.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_ImageLoader.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_ImageLoaderEvent.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_ImageLoaderListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_PaletteData.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Point.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_RGB.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Rectangle.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Region.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_layout_FillLayout.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_layout_GridData.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_layout_GridLayout.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_layout_RowData.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_layout_RowLayout.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_printing_PrintDialog.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_printing_Printer.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_printing_PrinterData.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_program_Program.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Button.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Canvas.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Caret.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ColorDialog.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Combo.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Composite.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Control.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_CoolBar.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_CoolItem.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Decorations.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Dialog.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_DirectoryDialog.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Display.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Event.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_FileDialog.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_FontDialog.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Group.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Item.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Label.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Layout.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_List.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Listener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Menu.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_MenuItem.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_MessageBox.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ProgressBar.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Sash.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Scale.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ScrollBar.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Scrollable.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Shell.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Slider.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Synchronizer.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TabFolder.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TabItem.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Table.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableColumn.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableItem.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Text.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ToolBar.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ToolItem.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Tracker.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Tree.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeItem.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TypedListener.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Widget.java tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/check.bmp tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/dot.gif tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/folder.bmp tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/folderOpen.bmp tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/push.bmp tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/radio.bmp tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/target.bmp tests/org.eclipse.swt.tests/about.html tests/org.eclipse.swt.tests/build.properties tests/org.eclipse.swt.tests/plugin.properties tests/org.eclipse.swt.tests/plugin.xml tests/org.eclipse.swt.tests/test.xml --- .../carbon/org/eclipse/swt/widgets/Display.java | 31 +- .../org.eclipse.swt.examples.controls/.classpath | 11 - .../org.eclipse.swt.examples.controls/.cvsignore | 1 - .../org.eclipse.swt.examples.controls/.project | 30 - .../org.eclipse.swt.examples.controls/about.html | 30 - .../build.properties | 10 - .../doc-html/hglegal2002.htm | 14 - .../doc-html/ngibmcpy2002.gif | Bin 1045 -> 0 bytes .../doc-html/swt_controls_ex.html | 27 - .../icons/controls_example.gif | Bin 111 -> 0 bytes .../plugin.properties | 16 - .../org.eclipse.swt.examples.controls/plugin.xml | 56 - .../src/import.properties | 4 - .../swt/examples/controls/ControlPlugin.java | 30 - .../eclipse/swt/examples/controls/ControlView.java | 51 - .../org.eclipse.swt.examples.launcher/.classpath | 12 - .../org.eclipse.swt.examples.launcher/.cvsignore | 1 - .../org.eclipse.swt.examples.launcher/.project | 30 - .../org.eclipse.swt.examples.launcher/about.html | 30 - .../build.properties | 12 - .../doc-html/hglegal2002.htm | 14 - .../doc-html/ngibmcpy2002.gif | Bin 1045 -> 0 bytes .../doc-html/swt_launcher_ex.html | 45 - ....eclipse.swt.examples.launcher.launchItems.html | 60 - .../icons/closedFolder.gif | Bin 160 -> 0 bytes .../icons/generic_example.gif | Bin 158 -> 0 bytes .../icons/launcher_example.gif | Bin 168 -> 0 bytes .../icons/openFolder.gif | Bin 152 -> 0 bytes .../plugin.properties | 39 - .../org.eclipse.swt.examples.launcher/plugin.xml | 80 - ....eclipse.swt.examples.launcher.launchItems.exsd | 195 - .../src/import.properties | 4 - .../swt/examples/launcher/ItemDescriptor.java | 72 - .../swt/examples/launcher/ItemTreeNode.java | 75 - .../swt/examples/launcher/LauncherPlugin.java | 379 -- .../swt/examples/launcher/LauncherView.java | 229 -- .../eclipse/swt/examples/launcher/SplitLayout.java | 15 - .../org.eclipse.swt.examples.layouts/.classpath | 11 - .../org.eclipse.swt.examples.layouts/.cvsignore | 1 - examples/org.eclipse.swt.examples.layouts/.project | 30 - .../org.eclipse.swt.examples.layouts/about.html | 30 - .../build.properties | 10 - .../doc-html/hglegal2002.htm | 14 - .../doc-html/ngibmcpy2002.gif | Bin 1045 -> 0 bytes .../doc-html/swt_layout_ex.html | 29 - .../icons/layouts_example.gif | Bin 217 -> 0 bytes .../plugin.properties | 18 - .../org.eclipse.swt.examples.layouts/plugin.xml | 56 - .../src/import.properties | 4 - .../eclipse/swt/examples/layouts/LayoutPlugin.java | 30 - .../eclipse/swt/examples/layouts/LayoutView.java | 51 - .../org.eclipse.swt.examples.ole.win32/.classpath | 10 - .../org.eclipse.swt.examples.ole.win32/.cvsignore | 1 - .../org.eclipse.swt.examples.ole.win32/.project | 29 - .../org.eclipse.swt.examples.ole.win32/about.html | 30 - .../build.properties | 10 - .../doc-html/hglegal2002.htm | 14 - .../doc-html/ngibmcpy2002.gif | Bin 1045 -> 0 bytes .../doc-html/swt_ole_ex.html | 34 - .../icons/backward_nav.gif | Bin 881 -> 0 bytes .../icons/forward_nav.gif | Bin 883 -> 0 bytes .../icons/home_nav.gif | Bin 928 -> 0 bytes .../icons/refresh_nav.gif | Bin 160 -> 0 bytes .../icons/search_nav.gif | Bin 245 -> 0 bytes .../icons/stop_nav.gif | Bin 174 -> 0 bytes .../icons/webbrowser_example.gif | Bin 380 -> 0 bytes .../plugin.properties | 50 - .../org.eclipse.swt.examples.ole.win32/plugin.xml | 55 - .../src/import.properties | 4 - .../swt/examples/ole/win32/OleBrowserView.java | 356 -- .../eclipse/swt/examples/ole/win32/OlePlugin.java | 172 - .../swt/examples/ole/win32/OleWebBrowser.java | 224 - examples/org.eclipse.swt.examples.paint/.classpath | 10 - examples/org.eclipse.swt.examples.paint/.cvsignore | 1 - examples/org.eclipse.swt.examples.paint/.project | 29 - examples/org.eclipse.swt.examples.paint/about.html | 30 - .../build.properties | 10 - .../doc-html/hglegal2002.htm | 14 - .../doc-html/ngibmcpy2002.gif | Bin 1045 -> 0 bytes .../doc-html/swt_paint_ex.html | 36 - .../icons/fill_none.gif | Bin 865 -> 0 bytes .../icons/fill_outline.gif | Bin 872 -> 0 bytes .../icons/fill_solid.gif | Bin 861 -> 0 bytes .../icons/linestyle_dash.gif | Bin 880 -> 0 bytes .../icons/linestyle_dashdot.gif | Bin 880 -> 0 bytes .../icons/linestyle_dot.gif | Bin 879 -> 0 bytes .../icons/linestyle_solid.gif | Bin 871 -> 0 bytes .../icons/options_font.gif | Bin 868 -> 0 bytes .../icons/paint_example.gif | Bin 932 -> 0 bytes .../icons/tool_airbrush.gif | Bin 890 -> 0 bytes .../icons/tool_ellipse.gif | Bin 872 -> 0 bytes .../icons/tool_line.gif | Bin 860 -> 0 bytes .../icons/tool_pencil.gif | Bin 874 -> 0 bytes .../icons/tool_polyline.gif | Bin 879 -> 0 bytes .../icons/tool_rectangle.gif | Bin 865 -> 0 bytes .../icons/tool_roundedrectangle.gif | Bin 871 -> 0 bytes .../icons/tool_text.gif | Bin 875 -> 0 bytes .../plugin.properties | 124 - examples/org.eclipse.swt.examples.paint/plugin.xml | 55 - .../src/import.properties | 4 - .../eclipse/swt/examples/paint/AirbrushTool.java | 74 - .../swt/examples/paint/BasicPaintSession.java | 12 - .../swt/examples/paint/ContainerFigure.java | 89 - .../swt/examples/paint/ContinuousPaintSession.java | 228 -- .../swt/examples/paint/DragPaintSession.java | 131 - .../eclipse/swt/examples/paint/EllipseFigure.java | 48 - .../eclipse/swt/examples/paint/EllipseTool.java | 59 - .../src/org/eclipse/swt/examples/paint/Figure.java | 34 - .../swt/examples/paint/FigureDrawContext.java | 36 - .../org/eclipse/swt/examples/paint/LineFigure.java | 48 - .../org/eclipse/swt/examples/paint/LineTool.java | 54 - .../eclipse/swt/examples/paint/PaintPlugin.java | 80 - .../eclipse/swt/examples/paint/PaintSession.java | 54 - .../eclipse/swt/examples/paint/PaintSurface.java | 31 - .../org/eclipse/swt/examples/paint/PaintTool.java | 15 - .../org/eclipse/swt/examples/paint/PaintView.java | 496 --- .../org/eclipse/swt/examples/paint/PencilTool.java | 54 - .../eclipse/swt/examples/paint/PointFigure.java | 36 - .../eclipse/swt/examples/paint/PolyLineTool.java | 71 - .../swt/examples/paint/RectangleFigure.java | 47 - .../eclipse/swt/examples/paint/RectangleTool.java | 67 - .../swt/examples/paint/RoundedRectangleFigure.java | 49 - .../swt/examples/paint/RoundedRectangleTool.java | 60 - .../swt/examples/paint/SegmentedPaintSession.java | 155 - .../swt/examples/paint/SolidEllipseFigure.java | 40 - .../swt/examples/paint/SolidPolygonFigure.java | 55 - .../swt/examples/paint/SolidRectangleFigure.java | 39 - .../paint/SolidRoundedRectangleFigure.java | 41 - .../org/eclipse/swt/examples/paint/TextFigure.java | 45 - .../org/eclipse/swt/examples/paint/TextTool.java | 123 - .../eclipse/swt/examples/paint/ToolSettings.java | 29 - examples/org.eclipse.swt.examples/.classpath | 7 - examples/org.eclipse.swt.examples/.cvsignore | 1 - examples/org.eclipse.swt.examples/.project | 29 - examples/org.eclipse.swt.examples/about.html | 30 - examples/org.eclipse.swt.examples/build.properties | 9 - .../doc-html/hglegal2002.htm | 14 - .../doc-html/ngibmcpy2002.gif | Bin 1045 -> 0 bytes .../doc-html/swt_addressbook_ex.html | 31 - .../doc-html/swt_controls_ex.html | 30 - .../doc-html/swt_fileviewer_ex.html | 33 - .../doc-html/swt_helloworld_ex.html | 61 - .../doc-html/swt_hoverhelp_ex.html | 37 - .../doc-html/swt_imageanalyzer_ex.html | 57 - .../doc-html/swt_javaviewer_ex.html | 33 - .../doc-html/swt_launcher_ex.html | 55 - .../doc-html/swt_layout_ex.html | 31 - .../doc-html/swt_manual_setup.html | 119 - .../doc-html/swt_texteditor_ex.html | 35 - .../org.eclipse.swt.examples/plugin.properties | 113 - examples/org.eclipse.swt.examples/plugin.xml | 142 - .../src/examples_addressbook.properties | 59 - .../src/examples_control.properties | 139 - .../src/examples_fileviewer.properties | 59 - .../src/examples_helloworld.properties | 1 - .../src/examples_hoverhelp.properties | 16 - .../src/examples_images.properties | 101 - .../src/examples_javaviewer.properties | 7 - .../src/examples_layout.properties | 41 - .../src/examples_texteditor.properties | 6 - .../org.eclipse.swt.examples/src/import.properties | 16 - .../swt/examples/addressbook/AddressBook.java | 857 ---- .../swt/examples/addressbook/DataEntryDialog.java | 159 - .../swt/examples/addressbook/FindListener.java | 14 - .../swt/examples/addressbook/SearchDialog.java | 198 - .../swt/examples/controlexample/AlignableTab.java | 85 - .../swt/examples/controlexample/ButtonTab.java | 193 - .../swt/examples/controlexample/ComboTab.java | 114 - .../examples/controlexample/ControlExample.java | 179 - .../swt/examples/controlexample/CoolBarTab.java | 426 -- .../swt/examples/controlexample/DialogTab.java | 442 -- .../swt/examples/controlexample/LabelTab.java | 175 - .../swt/examples/controlexample/ListTab.java | 81 - .../examples/controlexample/ProgressBarTab.java | 141 - .../swt/examples/controlexample/RangeTab.java | 179 - .../swt/examples/controlexample/SashTab.java | 166 - .../swt/examples/controlexample/ScrollableTab.java | 59 - .../swt/examples/controlexample/ShellTab.java | 287 -- .../swt/examples/controlexample/SliderTab.java | 249 -- .../eclipse/swt/examples/controlexample/Tab.java | 521 --- .../swt/examples/controlexample/TableTab.java | 284 -- .../swt/examples/controlexample/TextTab.java | 219 - .../swt/examples/controlexample/ToolBarTab.java | 248 -- .../swt/examples/controlexample/TreeTab.java | 136 - .../eclipse/swt/examples/controlexample/bold.bmp | Bin 134 -> 0 bytes .../swt/examples/controlexample/bold_mask.bmp | Bin 134 -> 0 bytes .../swt/examples/controlexample/closedFolder.gif | Bin 906 -> 0 bytes .../swt/examples/controlexample/openFolder.gif | Bin 184 -> 0 bytes .../eclipse/swt/examples/controlexample/red.bmp | Bin 334 -> 0 bytes .../swt/examples/controlexample/red_mask.bmp | Bin 134 -> 0 bytes .../eclipse/swt/examples/controlexample/target.gif | Bin 917 -> 0 bytes .../eclipse/swt/examples/controlexample/yellow.bmp | Bin 352 -> 0 bytes .../swt/examples/controlexample/yellow_mask.bmp | Bin 134 -> 0 bytes .../swt/examples/fileviewer/FileViewer.java | 1734 -------- .../eclipse/swt/examples/fileviewer/IconCache.java | 149 - .../eclipse/swt/examples/fileviewer/cmd_Copy.gif | Bin 167 -> 0 bytes .../eclipse/swt/examples/fileviewer/cmd_Cut.gif | Bin 152 -> 0 bytes .../eclipse/swt/examples/fileviewer/cmd_Delete.gif | Bin 143 -> 0 bytes .../eclipse/swt/examples/fileviewer/cmd_Parent.gif | Bin 132 -> 0 bytes .../eclipse/swt/examples/fileviewer/cmd_Paste.gif | Bin 245 -> 0 bytes .../eclipse/swt/examples/fileviewer/cmd_Print.gif | Bin 227 -> 0 bytes .../swt/examples/fileviewer/cmd_Refresh.gif | Bin 182 -> 0 bytes .../eclipse/swt/examples/fileviewer/cmd_Rename.gif | Bin 163 -> 0 bytes .../eclipse/swt/examples/fileviewer/cmd_Search.gif | Bin 153 -> 0 bytes .../swt/examples/fileviewer/generic_example.gif | Bin 158 -> 0 bytes .../swt/examples/fileviewer/icon_ClosedDrive.gif | Bin 217 -> 0 bytes .../swt/examples/fileviewer/icon_ClosedFolder.gif | Bin 160 -> 0 bytes .../eclipse/swt/examples/fileviewer/icon_File.gif | Bin 152 -> 0 bytes .../swt/examples/fileviewer/icon_OpenDrive.gif | Bin 231 -> 0 bytes .../swt/examples/fileviewer/icon_OpenFolder.gif | Bin 152 -> 0 bytes .../swt/examples/helloworld/HelloWorld1.java | 32 - .../swt/examples/helloworld/HelloWorld2.java | 38 - .../swt/examples/helloworld/HelloWorld3.java | 45 - .../swt/examples/helloworld/HelloWorld4.java | 41 - .../swt/examples/helloworld/HelloWorld5.java | 52 - .../eclipse/swt/examples/hoverhelp/HoverHelp.java | 338 -- .../eclipse/swt/examples/hoverhelp/information.gif | Bin 92 -> 0 bytes .../org/eclipse/swt/examples/hoverhelp/warning.gif | Bin 152 -> 0 bytes .../swt/examples/imageanalyzer/ImageAnalyzer.java | 2076 ---------- .../swt/examples/javaviewer/JavaLineStyler.java | 374 -- .../swt/examples/javaviewer/JavaViewer.java | 175 - .../swt/examples/layoutexample/FillLayoutTab.java | 175 - .../swt/examples/layoutexample/FormLayoutTab.java | 758 ---- .../swt/examples/layoutexample/GridLayoutTab.java | 586 --- .../swt/examples/layoutexample/LayoutExample.java | 110 - .../swt/examples/layoutexample/RowLayoutTab.java | 409 -- .../eclipse/swt/examples/layoutexample/Tab.java | 641 --- .../eclipse/swt/examples/texteditor/Images.java | 54 - .../swt/examples/texteditor/TextEditor.java | 359 -- .../org/eclipse/swt/examples/texteditor/blue.bmp | Bin 334 -> 0 bytes .../eclipse/swt/examples/texteditor/blue_mask.bmp | Bin 134 -> 0 bytes .../org/eclipse/swt/examples/texteditor/bold.bmp | Bin 134 -> 0 bytes .../eclipse/swt/examples/texteditor/bold_mask.bmp | Bin 134 -> 0 bytes .../org/eclipse/swt/examples/texteditor/erase.bmp | Bin 334 -> 0 bytes .../eclipse/swt/examples/texteditor/erase_mask.bmp | Bin 134 -> 0 bytes .../org/eclipse/swt/examples/texteditor/green.bmp | Bin 334 -> 0 bytes .../eclipse/swt/examples/texteditor/green_mask.bmp | Bin 134 -> 0 bytes .../org/eclipse/swt/examples/texteditor/red.bmp | Bin 334 -> 0 bytes .../eclipse/swt/examples/texteditor/red_mask.bmp | Bin 134 -> 0 bytes tests/org.eclipse.swt.tests/.classpath | 8 - tests/org.eclipse.swt.tests/.cvsignore | 1 - tests/org.eclipse.swt.tests/.project | 28 - .../eclipse/swt/tests/junit/AllGraphicsTests.java | 44 - .../org/eclipse/swt/tests/junit/AllTests.java | 180 - .../eclipse/swt/tests/junit/AllWidgetTests.java | 65 - .../swt/tests/junit/EmulatedWidgetsTests.java | 35 - .../swt/tests/junit/StyledTextContentSpec.java | 1022 ----- .../org/eclipse/swt/tests/junit/SwtJunit.java | 32 - .../org/eclipse/swt/tests/junit/SwtTestCase.java | 104 - .../swt/tests/junit/Test_org_eclipse_swt_SWT.java | 156 - .../tests/junit/Test_org_eclipse_swt_SWTError.java | 104 - .../junit/Test_org_eclipse_swt_SWTException.java | 104 - ...st_org_eclipse_swt_custom_AnimatedProgress.java | 84 - ...st_org_eclipse_swt_custom_BidiSegmentEvent.java | 54 - ...org_eclipse_swt_custom_BidiSegmentListener.java | 186 - .../Test_org_eclipse_swt_custom_BusyIndicator.java | 62 - .../junit/Test_org_eclipse_swt_custom_CCombo.java | 294 -- .../junit/Test_org_eclipse_swt_custom_CLabel.java | 138 - .../Test_org_eclipse_swt_custom_CTabFolder.java | 222 - ...t_org_eclipse_swt_custom_CTabFolderAdapter.java | 62 - ...est_org_eclipse_swt_custom_CTabFolderEvent.java | 54 - ..._org_eclipse_swt_custom_CTabFolderListener.java | 44 - .../Test_org_eclipse_swt_custom_CTabItem.java | 145 - .../Test_org_eclipse_swt_custom_ControlEditor.java | 74 - ...org_eclipse_swt_custom_ExtendedModifyEvent.java | 60 - ..._eclipse_swt_custom_ExtendedModifyListener.java | 317 -- ...org_eclipse_swt_custom_LineBackgroundEvent.java | 60 - ..._eclipse_swt_custom_LineBackgroundListener.java | 71 - ...Test_org_eclipse_swt_custom_LineStyleEvent.java | 60 - ...t_org_eclipse_swt_custom_LineStyleListener.java | 70 - .../Test_org_eclipse_swt_custom_PopupList.java | 104 - .../junit/Test_org_eclipse_swt_custom_ST.java | 56 - .../Test_org_eclipse_swt_custom_SashForm.java | 114 - ...t_org_eclipse_swt_custom_ScrolledComposite.java | 132 - .../Test_org_eclipse_swt_custom_StackLayout.java | 72 - .../Test_org_eclipse_swt_custom_StyleRange.java | 175 - .../Test_org_eclipse_swt_custom_StyledText.java | 4281 -------------------- ...t_org_eclipse_swt_custom_StyledTextContent.java | 169 - .../Test_org_eclipse_swt_custom_TableEditor.java | 102 - .../Test_org_eclipse_swt_custom_TableTree.java | 216 - ...est_org_eclipse_swt_custom_TableTreeEditor.java | 102 - .../Test_org_eclipse_swt_custom_TableTreeItem.java | 204 - ..._org_eclipse_swt_custom_TextChangeListener.java | 560 --- ...st_org_eclipse_swt_custom_TextChangedEvent.java | 60 - ...t_org_eclipse_swt_custom_TextChangingEvent.java | 60 - .../Test_org_eclipse_swt_custom_TreeEditor.java | 90 - ...t_org_eclipse_swt_custom_VerifyKeyListener.java | 80 - .../Test_org_eclipse_swt_custom_ViewForm.java | 150 - ...Test_org_eclipse_swt_dnd_ByteArrayTransfer.java | 72 - .../junit/Test_org_eclipse_swt_dnd_Clipboard.java | 86 - .../tests/junit/Test_org_eclipse_swt_dnd_DND.java | 68 - .../junit/Test_org_eclipse_swt_dnd_DragSource.java | 102 - ...Test_org_eclipse_swt_dnd_DragSourceAdapter.java | 74 - .../Test_org_eclipse_swt_dnd_DragSourceEvent.java | 60 - ...est_org_eclipse_swt_dnd_DragSourceListener.java | 56 - .../junit/Test_org_eclipse_swt_dnd_DropTarget.java | 108 - ...Test_org_eclipse_swt_dnd_DropTargetAdapter.java | 92 - .../Test_org_eclipse_swt_dnd_DropTargetEvent.java | 60 - ...est_org_eclipse_swt_dnd_DropTargetListener.java | 74 - .../Test_org_eclipse_swt_dnd_FileTransfer.java | 84 - .../Test_org_eclipse_swt_dnd_RTFTransfer.java | 84 - .../Test_org_eclipse_swt_dnd_TextTransfer.java | 84 - .../junit/Test_org_eclipse_swt_dnd_Transfer.java | 86 - .../Test_org_eclipse_swt_dnd_TransferData.java | 56 - .../Test_org_eclipse_swt_events_ArmEvent.java | 60 - .../Test_org_eclipse_swt_events_ArmListener.java | 44 - ...Test_org_eclipse_swt_events_ControlAdapter.java | 56 - .../Test_org_eclipse_swt_events_ControlEvent.java | 60 - ...est_org_eclipse_swt_events_ControlListener.java | 50 - .../Test_org_eclipse_swt_events_DisposeEvent.java | 60 - ...est_org_eclipse_swt_events_DisposeListener.java | 44 - .../Test_org_eclipse_swt_events_FocusAdapter.java | 56 - .../Test_org_eclipse_swt_events_FocusEvent.java | 60 - .../Test_org_eclipse_swt_events_FocusListener.java | 50 - .../Test_org_eclipse_swt_events_HelpEvent.java | 60 - .../Test_org_eclipse_swt_events_HelpListener.java | 44 - .../Test_org_eclipse_swt_events_KeyAdapter.java | 56 - .../Test_org_eclipse_swt_events_KeyEvent.java | 60 - .../Test_org_eclipse_swt_events_KeyListener.java | 50 - .../Test_org_eclipse_swt_events_MenuAdapter.java | 56 - .../Test_org_eclipse_swt_events_MenuEvent.java | 60 - .../Test_org_eclipse_swt_events_MenuListener.java | 50 - .../Test_org_eclipse_swt_events_ModifyEvent.java | 60 - ...Test_org_eclipse_swt_events_ModifyListener.java | 44 - .../Test_org_eclipse_swt_events_MouseAdapter.java | 62 - .../Test_org_eclipse_swt_events_MouseEvent.java | 60 - .../Test_org_eclipse_swt_events_MouseListener.java | 56 - ...t_org_eclipse_swt_events_MouseMoveListener.java | 44 - ...t_org_eclipse_swt_events_MouseTrackAdapter.java | 74 - ..._org_eclipse_swt_events_MouseTrackListener.java | 56 - .../Test_org_eclipse_swt_events_PaintEvent.java | 60 - .../Test_org_eclipse_swt_events_PaintListener.java | 44 - ...st_org_eclipse_swt_events_SelectionAdapter.java | 56 - ...Test_org_eclipse_swt_events_SelectionEvent.java | 60 - ...t_org_eclipse_swt_events_SelectionListener.java | 50 - .../Test_org_eclipse_swt_events_ShellAdapter.java | 74 - .../Test_org_eclipse_swt_events_ShellEvent.java | 60 - .../Test_org_eclipse_swt_events_ShellListener.java | 68 - .../Test_org_eclipse_swt_events_TraverseEvent.java | 60 - ...st_org_eclipse_swt_events_TraverseListener.java | 44 - .../Test_org_eclipse_swt_events_TreeAdapter.java | 56 - .../Test_org_eclipse_swt_events_TreeEvent.java | 60 - .../Test_org_eclipse_swt_events_TreeListener.java | 50 - .../Test_org_eclipse_swt_events_TypedEvent.java | 62 - .../Test_org_eclipse_swt_events_VerifyEvent.java | 60 - ...Test_org_eclipse_swt_events_VerifyListener.java | 44 - .../junit/Test_org_eclipse_swt_graphics_Color.java | 282 -- .../Test_org_eclipse_swt_graphics_Cursor.java | 222 - .../Test_org_eclipse_swt_graphics_Device.java | 158 - .../Test_org_eclipse_swt_graphics_DeviceData.java | 58 - .../Test_org_eclipse_swt_graphics_Drawable.java | 50 - .../junit/Test_org_eclipse_swt_graphics_Font.java | 304 -- .../Test_org_eclipse_swt_graphics_FontData.java | 251 -- .../Test_org_eclipse_swt_graphics_FontMetrics.java | 121 - .../junit/Test_org_eclipse_swt_graphics_GC.java | 449 -- .../Test_org_eclipse_swt_graphics_GCData.java | 56 - .../junit/Test_org_eclipse_swt_graphics_Image.java | 177 - .../Test_org_eclipse_swt_graphics_ImageData.java | 170 - .../Test_org_eclipse_swt_graphics_ImageLoader.java | 104 - ..._org_eclipse_swt_graphics_ImageLoaderEvent.java | 62 - ...g_eclipse_swt_graphics_ImageLoaderListener.java | 44 - .../Test_org_eclipse_swt_graphics_PaletteData.java | 80 - .../junit/Test_org_eclipse_swt_graphics_Point.java | 100 - .../junit/Test_org_eclipse_swt_graphics_RGB.java | 161 - .../Test_org_eclipse_swt_graphics_Rectangle.java | 322 -- .../Test_org_eclipse_swt_graphics_Region.java | 530 --- .../Test_org_eclipse_swt_layout_FillLayout.java | 72 - .../Test_org_eclipse_swt_layout_GridData.java | 62 - .../Test_org_eclipse_swt_layout_GridLayout.java | 72 - .../junit/Test_org_eclipse_swt_layout_RowData.java | 68 - .../Test_org_eclipse_swt_layout_RowLayout.java | 72 - .../Test_org_eclipse_swt_printing_PrintDialog.java | 145 - .../Test_org_eclipse_swt_printing_Printer.java | 168 - .../Test_org_eclipse_swt_printing_PrinterData.java | 74 - .../Test_org_eclipse_swt_program_Program.java | 110 - .../junit/Test_org_eclipse_swt_widgets_Button.java | 272 -- .../junit/Test_org_eclipse_swt_widgets_Canvas.java | 113 - .../junit/Test_org_eclipse_swt_widgets_Caret.java | 210 - .../Test_org_eclipse_swt_widgets_ColorDialog.java | 118 - .../junit/Test_org_eclipse_swt_widgets_Combo.java | 681 ---- .../Test_org_eclipse_swt_widgets_Composite.java | 157 - .../Test_org_eclipse_swt_widgets_Control.java | 825 ---- .../Test_org_eclipse_swt_widgets_CoolBar.java | 130 - .../Test_org_eclipse_swt_widgets_CoolItem.java | 336 -- .../Test_org_eclipse_swt_widgets_Decorations.java | 248 -- .../junit/Test_org_eclipse_swt_widgets_Dialog.java | 110 - ...st_org_eclipse_swt_widgets_DirectoryDialog.java | 137 - .../Test_org_eclipse_swt_widgets_Display.java | 365 -- .../junit/Test_org_eclipse_swt_widgets_Event.java | 74 - .../Test_org_eclipse_swt_widgets_FileDialog.java | 155 - .../Test_org_eclipse_swt_widgets_FontDialog.java | 108 - .../junit/Test_org_eclipse_swt_widgets_Group.java | 115 - .../junit/Test_org_eclipse_swt_widgets_Item.java | 119 - .../junit/Test_org_eclipse_swt_widgets_Label.java | 207 - .../junit/Test_org_eclipse_swt_widgets_Layout.java | 56 - .../junit/Test_org_eclipse_swt_widgets_List.java | 2145 ---------- .../Test_org_eclipse_swt_widgets_Listener.java | 44 - .../junit/Test_org_eclipse_swt_widgets_Menu.java | 378 -- .../Test_org_eclipse_swt_widgets_MenuItem.java | 281 -- .../Test_org_eclipse_swt_widgets_MessageBox.java | 135 - .../Test_org_eclipse_swt_widgets_ProgressBar.java | 629 --- .../junit/Test_org_eclipse_swt_widgets_Sash.java | 108 - .../junit/Test_org_eclipse_swt_widgets_Scale.java | 671 --- .../Test_org_eclipse_swt_widgets_ScrollBar.java | 892 ---- .../Test_org_eclipse_swt_widgets_Scrollable.java | 72 - .../junit/Test_org_eclipse_swt_widgets_Shell.java | 426 -- .../junit/Test_org_eclipse_swt_widgets_Slider.java | 843 ---- .../Test_org_eclipse_swt_widgets_Synchronizer.java | 68 - .../Test_org_eclipse_swt_widgets_TabFolder.java | 406 -- .../Test_org_eclipse_swt_widgets_TabItem.java | 187 - .../junit/Test_org_eclipse_swt_widgets_Table.java | 1637 -------- .../Test_org_eclipse_swt_widgets_TableColumn.java | 270 -- .../Test_org_eclipse_swt_widgets_TableItem.java | 519 --- .../junit/Test_org_eclipse_swt_widgets_Text.java | 978 ----- .../Test_org_eclipse_swt_widgets_ToolBar.java | 208 - .../Test_org_eclipse_swt_widgets_ToolItem.java | 225 - .../Test_org_eclipse_swt_widgets_Tracker.java | 124 - .../junit/Test_org_eclipse_swt_widgets_Tree.java | 509 --- .../Test_org_eclipse_swt_widgets_TreeItem.java | 309 -- ...Test_org_eclipse_swt_widgets_TypedListener.java | 68 - .../junit/Test_org_eclipse_swt_widgets_Widget.java | 193 - .../org/eclipse/swt/tests/junit/check.bmp | Bin 1062 -> 0 bytes .../org/eclipse/swt/tests/junit/dot.gif | Bin 70 -> 0 bytes .../org/eclipse/swt/tests/junit/folder.bmp | Bin 1438 -> 0 bytes .../org/eclipse/swt/tests/junit/folderOpen.bmp | Bin 1438 -> 0 bytes .../org/eclipse/swt/tests/junit/push.bmp | Bin 1062 -> 0 bytes .../org/eclipse/swt/tests/junit/radio.bmp | Bin 1062 -> 0 bytes .../org/eclipse/swt/tests/junit/target.bmp | Bin 1654 -> 0 bytes tests/org.eclipse.swt.tests/about.html | 30 - tests/org.eclipse.swt.tests/build.properties | 3 - tests/org.eclipse.swt.tests/plugin.properties | 1 - tests/org.eclipse.swt.tests/plugin.xml | 20 - tests/org.eclipse.swt.tests/test.xml | 49 - 433 files changed, 25 insertions(+), 56195 deletions(-) delete mode 100755 examples/org.eclipse.swt.examples.controls/.classpath delete mode 100755 examples/org.eclipse.swt.examples.controls/.cvsignore delete mode 100644 examples/org.eclipse.swt.examples.controls/.project delete mode 100644 examples/org.eclipse.swt.examples.controls/about.html delete mode 100755 examples/org.eclipse.swt.examples.controls/build.properties delete mode 100644 examples/org.eclipse.swt.examples.controls/doc-html/hglegal2002.htm delete mode 100644 examples/org.eclipse.swt.examples.controls/doc-html/ngibmcpy2002.gif delete mode 100755 examples/org.eclipse.swt.examples.controls/doc-html/swt_controls_ex.html delete mode 100755 examples/org.eclipse.swt.examples.controls/icons/controls_example.gif delete mode 100755 examples/org.eclipse.swt.examples.controls/plugin.properties delete mode 100755 examples/org.eclipse.swt.examples.controls/plugin.xml delete mode 100644 examples/org.eclipse.swt.examples.controls/src/import.properties delete mode 100755 examples/org.eclipse.swt.examples.controls/src/org/eclipse/swt/examples/controls/ControlPlugin.java delete mode 100755 examples/org.eclipse.swt.examples.controls/src/org/eclipse/swt/examples/controls/ControlView.java delete mode 100755 examples/org.eclipse.swt.examples.launcher/.classpath delete mode 100755 examples/org.eclipse.swt.examples.launcher/.cvsignore delete mode 100644 examples/org.eclipse.swt.examples.launcher/.project delete mode 100644 examples/org.eclipse.swt.examples.launcher/about.html delete mode 100755 examples/org.eclipse.swt.examples.launcher/build.properties delete mode 100644 examples/org.eclipse.swt.examples.launcher/doc-html/hglegal2002.htm delete mode 100644 examples/org.eclipse.swt.examples.launcher/doc-html/ngibmcpy2002.gif delete mode 100755 examples/org.eclipse.swt.examples.launcher/doc-html/swt_launcher_ex.html delete mode 100755 examples/org.eclipse.swt.examples.launcher/doc/org.eclipse.swt.examples.launcher.launchItems.html delete mode 100755 examples/org.eclipse.swt.examples.launcher/icons/closedFolder.gif delete mode 100755 examples/org.eclipse.swt.examples.launcher/icons/generic_example.gif delete mode 100755 examples/org.eclipse.swt.examples.launcher/icons/launcher_example.gif delete mode 100755 examples/org.eclipse.swt.examples.launcher/icons/openFolder.gif delete mode 100755 examples/org.eclipse.swt.examples.launcher/plugin.properties delete mode 100755 examples/org.eclipse.swt.examples.launcher/plugin.xml delete mode 100644 examples/org.eclipse.swt.examples.launcher/schema/org.eclipse.swt.examples.launcher.launchItems.exsd delete mode 100644 examples/org.eclipse.swt.examples.launcher/src/import.properties delete mode 100755 examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/ItemDescriptor.java delete mode 100755 examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/ItemTreeNode.java delete mode 100755 examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/LauncherPlugin.java delete mode 100755 examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/LauncherView.java delete mode 100755 examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/SplitLayout.java delete mode 100644 examples/org.eclipse.swt.examples.layouts/.classpath delete mode 100644 examples/org.eclipse.swt.examples.layouts/.cvsignore delete mode 100644 examples/org.eclipse.swt.examples.layouts/.project delete mode 100644 examples/org.eclipse.swt.examples.layouts/about.html delete mode 100644 examples/org.eclipse.swt.examples.layouts/build.properties delete mode 100644 examples/org.eclipse.swt.examples.layouts/doc-html/hglegal2002.htm delete mode 100644 examples/org.eclipse.swt.examples.layouts/doc-html/ngibmcpy2002.gif delete mode 100644 examples/org.eclipse.swt.examples.layouts/doc-html/swt_layout_ex.html delete mode 100644 examples/org.eclipse.swt.examples.layouts/icons/layouts_example.gif delete mode 100644 examples/org.eclipse.swt.examples.layouts/plugin.properties delete mode 100644 examples/org.eclipse.swt.examples.layouts/plugin.xml delete mode 100644 examples/org.eclipse.swt.examples.layouts/src/import.properties delete mode 100644 examples/org.eclipse.swt.examples.layouts/src/org/eclipse/swt/examples/layouts/LayoutPlugin.java delete mode 100644 examples/org.eclipse.swt.examples.layouts/src/org/eclipse/swt/examples/layouts/LayoutView.java delete mode 100755 examples/org.eclipse.swt.examples.ole.win32/.classpath delete mode 100755 examples/org.eclipse.swt.examples.ole.win32/.cvsignore delete mode 100644 examples/org.eclipse.swt.examples.ole.win32/.project delete mode 100644 examples/org.eclipse.swt.examples.ole.win32/about.html delete mode 100755 examples/org.eclipse.swt.examples.ole.win32/build.properties delete mode 100644 examples/org.eclipse.swt.examples.ole.win32/doc-html/hglegal2002.htm delete mode 100644 examples/org.eclipse.swt.examples.ole.win32/doc-html/ngibmcpy2002.gif delete mode 100755 examples/org.eclipse.swt.examples.ole.win32/doc-html/swt_ole_ex.html delete mode 100755 examples/org.eclipse.swt.examples.ole.win32/icons/backward_nav.gif delete mode 100755 examples/org.eclipse.swt.examples.ole.win32/icons/forward_nav.gif delete mode 100755 examples/org.eclipse.swt.examples.ole.win32/icons/home_nav.gif delete mode 100755 examples/org.eclipse.swt.examples.ole.win32/icons/refresh_nav.gif delete mode 100755 examples/org.eclipse.swt.examples.ole.win32/icons/search_nav.gif delete mode 100755 examples/org.eclipse.swt.examples.ole.win32/icons/stop_nav.gif delete mode 100755 examples/org.eclipse.swt.examples.ole.win32/icons/webbrowser_example.gif delete mode 100755 examples/org.eclipse.swt.examples.ole.win32/plugin.properties delete mode 100755 examples/org.eclipse.swt.examples.ole.win32/plugin.xml delete mode 100644 examples/org.eclipse.swt.examples.ole.win32/src/import.properties delete mode 100755 examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OleBrowserView.java delete mode 100755 examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OlePlugin.java delete mode 100755 examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OleWebBrowser.java delete mode 100755 examples/org.eclipse.swt.examples.paint/.classpath delete mode 100755 examples/org.eclipse.swt.examples.paint/.cvsignore delete mode 100644 examples/org.eclipse.swt.examples.paint/.project delete mode 100644 examples/org.eclipse.swt.examples.paint/about.html delete mode 100755 examples/org.eclipse.swt.examples.paint/build.properties delete mode 100644 examples/org.eclipse.swt.examples.paint/doc-html/hglegal2002.htm delete mode 100644 examples/org.eclipse.swt.examples.paint/doc-html/ngibmcpy2002.gif delete mode 100755 examples/org.eclipse.swt.examples.paint/doc-html/swt_paint_ex.html delete mode 100755 examples/org.eclipse.swt.examples.paint/icons/fill_none.gif delete mode 100755 examples/org.eclipse.swt.examples.paint/icons/fill_outline.gif delete mode 100755 examples/org.eclipse.swt.examples.paint/icons/fill_solid.gif delete mode 100644 examples/org.eclipse.swt.examples.paint/icons/linestyle_dash.gif delete mode 100644 examples/org.eclipse.swt.examples.paint/icons/linestyle_dashdot.gif delete mode 100644 examples/org.eclipse.swt.examples.paint/icons/linestyle_dot.gif delete mode 100644 examples/org.eclipse.swt.examples.paint/icons/linestyle_solid.gif delete mode 100755 examples/org.eclipse.swt.examples.paint/icons/options_font.gif delete mode 100755 examples/org.eclipse.swt.examples.paint/icons/paint_example.gif delete mode 100755 examples/org.eclipse.swt.examples.paint/icons/tool_airbrush.gif delete mode 100755 examples/org.eclipse.swt.examples.paint/icons/tool_ellipse.gif delete mode 100755 examples/org.eclipse.swt.examples.paint/icons/tool_line.gif delete mode 100755 examples/org.eclipse.swt.examples.paint/icons/tool_pencil.gif delete mode 100755 examples/org.eclipse.swt.examples.paint/icons/tool_polyline.gif delete mode 100755 examples/org.eclipse.swt.examples.paint/icons/tool_rectangle.gif delete mode 100755 examples/org.eclipse.swt.examples.paint/icons/tool_roundedrectangle.gif delete mode 100755 examples/org.eclipse.swt.examples.paint/icons/tool_text.gif delete mode 100755 examples/org.eclipse.swt.examples.paint/plugin.properties delete mode 100755 examples/org.eclipse.swt.examples.paint/plugin.xml delete mode 100644 examples/org.eclipse.swt.examples.paint/src/import.properties delete mode 100755 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/AirbrushTool.java delete mode 100755 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/BasicPaintSession.java delete mode 100755 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/ContainerFigure.java delete mode 100755 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/ContinuousPaintSession.java delete mode 100755 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/DragPaintSession.java delete mode 100755 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/EllipseFigure.java delete mode 100755 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/EllipseTool.java delete mode 100755 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/Figure.java delete mode 100644 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/FigureDrawContext.java delete mode 100755 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/LineFigure.java delete mode 100755 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/LineTool.java delete mode 100755 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintPlugin.java delete mode 100755 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintSession.java delete mode 100755 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintSurface.java delete mode 100755 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintTool.java delete mode 100755 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintView.java delete mode 100755 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PencilTool.java delete mode 100644 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PointFigure.java delete mode 100755 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PolyLineTool.java delete mode 100755 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RectangleFigure.java delete mode 100755 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RectangleTool.java delete mode 100755 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RoundedRectangleFigure.java delete mode 100755 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RoundedRectangleTool.java delete mode 100755 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SegmentedPaintSession.java delete mode 100755 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidEllipseFigure.java delete mode 100755 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidPolygonFigure.java delete mode 100755 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidRectangleFigure.java delete mode 100755 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidRoundedRectangleFigure.java delete mode 100755 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/TextFigure.java delete mode 100755 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/TextTool.java delete mode 100755 examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/ToolSettings.java delete mode 100755 examples/org.eclipse.swt.examples/.classpath delete mode 100755 examples/org.eclipse.swt.examples/.cvsignore delete mode 100644 examples/org.eclipse.swt.examples/.project delete mode 100644 examples/org.eclipse.swt.examples/about.html delete mode 100755 examples/org.eclipse.swt.examples/build.properties delete mode 100644 examples/org.eclipse.swt.examples/doc-html/hglegal2002.htm delete mode 100644 examples/org.eclipse.swt.examples/doc-html/ngibmcpy2002.gif delete mode 100755 examples/org.eclipse.swt.examples/doc-html/swt_addressbook_ex.html delete mode 100644 examples/org.eclipse.swt.examples/doc-html/swt_controls_ex.html delete mode 100755 examples/org.eclipse.swt.examples/doc-html/swt_fileviewer_ex.html delete mode 100755 examples/org.eclipse.swt.examples/doc-html/swt_helloworld_ex.html delete mode 100755 examples/org.eclipse.swt.examples/doc-html/swt_hoverhelp_ex.html delete mode 100755 examples/org.eclipse.swt.examples/doc-html/swt_imageanalyzer_ex.html delete mode 100755 examples/org.eclipse.swt.examples/doc-html/swt_javaviewer_ex.html delete mode 100644 examples/org.eclipse.swt.examples/doc-html/swt_launcher_ex.html delete mode 100644 examples/org.eclipse.swt.examples/doc-html/swt_layout_ex.html delete mode 100755 examples/org.eclipse.swt.examples/doc-html/swt_manual_setup.html delete mode 100755 examples/org.eclipse.swt.examples/doc-html/swt_texteditor_ex.html delete mode 100755 examples/org.eclipse.swt.examples/plugin.properties delete mode 100755 examples/org.eclipse.swt.examples/plugin.xml delete mode 100644 examples/org.eclipse.swt.examples/src/examples_addressbook.properties delete mode 100644 examples/org.eclipse.swt.examples/src/examples_control.properties delete mode 100644 examples/org.eclipse.swt.examples/src/examples_fileviewer.properties delete mode 100644 examples/org.eclipse.swt.examples/src/examples_helloworld.properties delete mode 100644 examples/org.eclipse.swt.examples/src/examples_hoverhelp.properties delete mode 100644 examples/org.eclipse.swt.examples/src/examples_images.properties delete mode 100644 examples/org.eclipse.swt.examples/src/examples_javaviewer.properties delete mode 100644 examples/org.eclipse.swt.examples/src/examples_layout.properties delete mode 100644 examples/org.eclipse.swt.examples/src/examples_texteditor.properties delete mode 100644 examples/org.eclipse.swt.examples/src/import.properties delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/AddressBook.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/DataEntryDialog.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/FindListener.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/SearchDialog.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/AlignableTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ButtonTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ComboTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CoolBarTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/DialogTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/LabelTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ListTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ProgressBarTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/RangeTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SashTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ScrollableTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ShellTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SliderTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/Tab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TableTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TextTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ToolBarTab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TreeTab.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/bold.bmp delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/bold_mask.bmp delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/closedFolder.gif delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/openFolder.gif delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/red.bmp delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/red_mask.bmp delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/target.gif delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/yellow.bmp delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/yellow_mask.bmp delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/FileViewer.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/IconCache.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Copy.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Cut.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Delete.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Parent.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Paste.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Print.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Refresh.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Rename.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/cmd_Search.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/generic_example.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/icon_ClosedDrive.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/icon_ClosedFolder.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/icon_File.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/icon_OpenDrive.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/icon_OpenFolder.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld1.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld2.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld3.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld4.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld5.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/hoverhelp/HoverHelp.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/hoverhelp/information.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/hoverhelp/warning.gif delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/imageanalyzer/ImageAnalyzer.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaLineStyler.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaViewer.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/FillLayoutTab.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/FormLayoutTab.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/GridLayoutTab.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/LayoutExample.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/RowLayoutTab.java delete mode 100644 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/Tab.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/Images.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/TextEditor.java delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/blue.bmp delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/blue_mask.bmp delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/bold.bmp delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/bold_mask.bmp delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/erase.bmp delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/erase_mask.bmp delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/green.bmp delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/green_mask.bmp delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/red.bmp delete mode 100755 examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/red_mask.bmp delete mode 100644 tests/org.eclipse.swt.tests/.classpath delete mode 100644 tests/org.eclipse.swt.tests/.cvsignore delete mode 100644 tests/org.eclipse.swt.tests/.project delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/AllGraphicsTests.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/AllTests.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/AllWidgetTests.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/EmulatedWidgetsTests.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/StyledTextContentSpec.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtJunit.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtTestCase.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_SWT.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_SWTError.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_SWTException.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_AnimatedProgress.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_BidiSegmentEvent.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_BidiSegmentListener.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_BusyIndicator.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CCombo.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CLabel.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CTabFolder.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CTabFolderAdapter.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CTabFolderEvent.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CTabFolderListener.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CTabItem.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_ControlEditor.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_ExtendedModifyEvent.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_ExtendedModifyListener.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_LineBackgroundEvent.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_LineBackgroundListener.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_LineStyleEvent.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_LineStyleListener.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_PopupList.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_ST.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_SashForm.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_ScrolledComposite.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StackLayout.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyleRange.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledTextContent.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TableEditor.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TableTree.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TableTreeEditor.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TableTreeItem.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TextChangeListener.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TextChangedEvent.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TextChangingEvent.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_TreeEditor.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_VerifyKeyListener.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_ViewForm.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_ByteArrayTransfer.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_Clipboard.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_DND.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_DragSource.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_DragSourceAdapter.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_DragSourceEvent.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_DragSourceListener.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_DropTarget.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_DropTargetAdapter.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_DropTargetEvent.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_DropTargetListener.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_FileTransfer.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_RTFTransfer.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_TextTransfer.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_Transfer.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_dnd_TransferData.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_ArmEvent.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_ArmListener.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_ControlAdapter.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_ControlEvent.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_ControlListener.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_DisposeEvent.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_DisposeListener.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_FocusAdapter.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_FocusEvent.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_FocusListener.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_HelpEvent.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_HelpListener.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_KeyAdapter.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_KeyEvent.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_KeyListener.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_MenuAdapter.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_MenuEvent.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_MenuListener.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_ModifyEvent.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_ModifyListener.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_MouseAdapter.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_MouseEvent.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_MouseListener.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_MouseMoveListener.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_MouseTrackAdapter.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_MouseTrackListener.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_PaintEvent.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_PaintListener.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_SelectionAdapter.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_SelectionEvent.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_SelectionListener.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_ShellAdapter.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_ShellEvent.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_ShellListener.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_TraverseEvent.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_TraverseListener.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_TreeAdapter.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_TreeEvent.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_TreeListener.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_TypedEvent.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_VerifyEvent.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_events_VerifyListener.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Color.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Cursor.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Device.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_DeviceData.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Drawable.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Font.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_FontData.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_FontMetrics.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_GC.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_GCData.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Image.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_ImageData.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_ImageLoader.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_ImageLoaderEvent.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_ImageLoaderListener.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_PaletteData.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Point.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_RGB.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Rectangle.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Region.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_layout_FillLayout.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_layout_GridData.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_layout_GridLayout.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_layout_RowData.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_layout_RowLayout.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_printing_PrintDialog.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_printing_Printer.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_printing_PrinterData.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_program_Program.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Button.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Canvas.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Caret.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ColorDialog.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Combo.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Composite.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Control.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_CoolBar.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_CoolItem.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Decorations.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Dialog.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_DirectoryDialog.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Display.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Event.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_FileDialog.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_FontDialog.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Group.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Item.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Label.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Layout.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_List.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Listener.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Menu.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_MenuItem.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_MessageBox.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ProgressBar.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Sash.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Scale.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ScrollBar.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Scrollable.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Shell.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Slider.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Synchronizer.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TabFolder.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TabItem.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Table.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableColumn.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableItem.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Text.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ToolBar.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ToolItem.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Tracker.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Tree.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeItem.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TypedListener.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Widget.java delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/check.bmp delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/dot.gif delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/folder.bmp delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/folderOpen.bmp delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/push.bmp delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/radio.bmp delete mode 100644 tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/target.bmp delete mode 100644 tests/org.eclipse.swt.tests/about.html delete mode 100644 tests/org.eclipse.swt.tests/build.properties delete mode 100644 tests/org.eclipse.swt.tests/plugin.properties delete mode 100644 tests/org.eclipse.swt.tests/plugin.xml delete mode 100644 tests/org.eclipse.swt.tests/test.xml diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Display.java index a6b65dc7db..9d69b1fdb3 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Display.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Display.java @@ -275,7 +275,8 @@ public void beep () { } int caretProc (int id, int clientData) { - if (!allowTimers) return 0; + //TEMPORARY CODE +// if (!allowTimers) return 0; if (currentCaret == null) return 0; if (currentCaret.blinkCaret ()) { int blinkRate = currentCaret.blinkRate; @@ -996,7 +997,21 @@ public boolean readAndDispatch () { runPopups (); runDeferredEvents (); runGrabs (); - if (eventClass != WAKE_CLASS || eventKind != WAKE_KIND) return true; + /* + * Feature in the Macintosh. When an indeterminate progress + * bar is running, it floods the event queue with messages in + * order to show the animation. This means that async messages + * will never run because there are always messages from the + * operating system. The fix is to run async messages when ever + * there is a wake message. + * + * NOTE: This is not the correct behavior. Operating system + * message are supposed to have priority over async messages. + */ + if (eventClass == WAKE_CLASS && eventKind == WAKE_KIND) { + runAsyncMessages (); + } + return true; } return runAsyncMessages (); } @@ -1427,9 +1442,7 @@ void setMenuBar (Menu menu) { public boolean sleep () { checkDevice (); - //TEMPORARY CODE - return OS.ReceiveNextEvent (0, null, 50 / 1000.0, false, null) == OS.noErr; -// return OS.ReceiveNextEvent (0, null, OS.kEventDurationForever, false, null) == OS.noErr; + return OS.ReceiveNextEvent (0, null, OS.kEventDurationForever, false, null) == OS.noErr; } public void syncExec (Runnable runnable) { @@ -1491,7 +1504,7 @@ int timerProc (int id, int index) { if (runnable != null) runnable.run (); } else { timerIds [index] = -1; - OS.PostEventToQueue (queue, wakeEvent [0], (short) OS.kEventPriorityStandard); + wakeUp (); } } return 0; @@ -1561,6 +1574,12 @@ void updateMenuBar (Shell shell) { public void wake () { if (isDisposed ()) error (SWT.ERROR_DEVICE_DISPOSED); if (thread == Thread.currentThread ()) return; + wakeUp (); +} + +void wakeUp () { + int [] wakeEvent = new int [1]; + OS.CreateEvent (0, WAKE_CLASS, WAKE_KIND, 0.0, OS.kEventAttributeUserEvent, wakeEvent); OS.PostEventToQueue (queue, wakeEvent [0], (short) OS.kEventPriorityStandard); } diff --git a/examples/org.eclipse.swt.examples.controls/.classpath b/examples/org.eclipse.swt.examples.controls/.classpath deleted file mode 100755 index da6f3cc359..0000000000 --- a/examples/org.eclipse.swt.examples.controls/.classpath +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - 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/.project b/examples/org.eclipse.swt.examples.controls/.project deleted file mode 100644 index 8ef8047fe2..0000000000 --- a/examples/org.eclipse.swt.examples.controls/.project +++ /dev/null @@ -1,30 +0,0 @@ - - - org.eclipse.swt.examples.controls - - - org.eclipse.swt - org.eclipse.swt.examples - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/examples/org.eclipse.swt.examples.controls/about.html b/examples/org.eclipse.swt.examples.controls/about.html deleted file mode 100644 index 9db411aab9..0000000000 --- a/examples/org.eclipse.swt.examples.controls/about.html +++ /dev/null @@ -1,30 +0,0 @@ - - - -About - - - -

About This Content

- -

20th June, 2002

-

License

-

Eclipse.org makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the -Common Public License Version 1.0 ("CPL"). A copy of the CPL is available at http://www.eclipse.org/legal/cpl-v10.html. -For purposes of the CPL, "Program" will mean the Content.

- -

Contributions

- -

If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise -made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such -Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.

- -

If this Content is licensed to you under license terms and conditions other than the CPL ("Other License"), any modifications, enhancements and/or -other code and/or documentation ("Modifications") uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the -host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available -to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also -providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of -the CPL.

- - - \ No newline at end of file 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 daf2c0b0be..0000000000 --- a/examples/org.eclipse.swt.examples.controls/build.properties +++ /dev/null @@ -1,10 +0,0 @@ -bin.includes = doc-html/,\ - icons/,\ - plugin.properties,\ - plugin.xml,\ - about.html,\ - *.jar - -src.includes = about.html - -source.controls.jar = src/ diff --git a/examples/org.eclipse.swt.examples.controls/doc-html/hglegal2002.htm b/examples/org.eclipse.swt.examples.controls/doc-html/hglegal2002.htm deleted file mode 100644 index 74393f08f3..0000000000 --- a/examples/org.eclipse.swt.examples.controls/doc-html/hglegal2002.htm +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - Legal Notices - - - -

-Notices

-(c) Copyright IBM Corp. 2000, 2002. All Rights Reserved. - - diff --git a/examples/org.eclipse.swt.examples.controls/doc-html/ngibmcpy2002.gif b/examples/org.eclipse.swt.examples.controls/doc-html/ngibmcpy2002.gif deleted file mode 100644 index 61cef48521..0000000000 Binary files a/examples/org.eclipse.swt.examples.controls/doc-html/ngibmcpy2002.gif and /dev/null 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 d18d828525..0000000000 --- a/examples/org.eclipse.swt.examples.controls/doc-html/swt_controls_ex.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - SWT - Controls Example - - - -

SWT Example - Controls Example

- -

-The Controls example is a simple demonstration of common SWT controls. -It consists of a tab folder where each tab in the folder allows the user -to interact with a different control. -The user can change styles and settings and view how this affects the control. -

- -

Running the example

-

From the Window menu select Show View --> Other. -In the Show View dialog, expand SWT Examples and select the -view named SWT Controls. A view titled SWT Controls will appear in your current perspective. -

- - -

Copyright IBM Corporation and others 2000, 2002.  All Rights Reserved.

- - 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 Binary files a/examples/org.eclipse.swt.examples.controls/icons/controls_example.gif and /dev/null differ 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 418cd71a1e..0000000000 --- a/examples/org.eclipse.swt.examples.controls/plugin.properties +++ /dev/null @@ -1,16 +0,0 @@ -providerName = Eclipse.org -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 SWT controls.\n\n\ - It consists of a tab folder where each tab allows the user \ - to interact with a different SWT control. \ - The user can change styles and settings and view how this affects the control. \ No newline at end of file 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 0bad5bc6de..0000000000 --- a/examples/org.eclipse.swt.examples.controls/plugin.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/org.eclipse.swt.examples.controls/src/import.properties b/examples/org.eclipse.swt.examples.controls/src/import.properties deleted file mode 100644 index 265131a99c..0000000000 --- a/examples/org.eclipse.swt.examples.controls/src/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 = <> 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 25bf20ed1b..0000000000 --- a/examples/org.eclipse.swt.examples.controls/src/org/eclipse/swt/examples/controls/ControlPlugin.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.eclipse.swt.examples.controls; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.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 a55b7545a5..0000000000 --- a/examples/org.eclipse.swt.examples.controls/src/org/eclipse/swt/examples/controls/ControlView.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.eclipse.swt.examples.controls; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.examples.controlexample.*; -import org.eclipse.swt.widgets.*; -import org.eclipse.ui.part.*; - -/** - * Controls 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 eafbb18026..0000000000 --- a/examples/org.eclipse.swt.examples.launcher/.classpath +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - 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/.project b/examples/org.eclipse.swt.examples.launcher/.project deleted file mode 100644 index 3aa0f07860..0000000000 --- a/examples/org.eclipse.swt.examples.launcher/.project +++ /dev/null @@ -1,30 +0,0 @@ - - - org.eclipse.swt.examples.launcher - - - org.eclipse.swt - org.eclipse.swt.examples - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/examples/org.eclipse.swt.examples.launcher/about.html b/examples/org.eclipse.swt.examples.launcher/about.html deleted file mode 100644 index 9db411aab9..0000000000 --- a/examples/org.eclipse.swt.examples.launcher/about.html +++ /dev/null @@ -1,30 +0,0 @@ - - - -About - - - -

About This Content

- -

20th June, 2002

-

License

-

Eclipse.org makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the -Common Public License Version 1.0 ("CPL"). A copy of the CPL is available at http://www.eclipse.org/legal/cpl-v10.html. -For purposes of the CPL, "Program" will mean the Content.

- -

Contributions

- -

If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise -made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such -Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.

- -

If this Content is licensed to you under license terms and conditions other than the CPL ("Other License"), any modifications, enhancements and/or -other code and/or documentation ("Modifications") uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the -host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available -to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also -providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of -the CPL.

- - - \ No newline at end of file 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 8d7ddf74e0..0000000000 --- a/examples/org.eclipse.swt.examples.launcher/build.properties +++ /dev/null @@ -1,12 +0,0 @@ -bin.includes = doc/,\ - doc-html/,\ - icons/,\ - schema/,\ - plugin.properties,\ - plugin.xml,\ - about.html,\ - *.jar - -src.includes = about.html - -source.launcher.jar = src/ diff --git a/examples/org.eclipse.swt.examples.launcher/doc-html/hglegal2002.htm b/examples/org.eclipse.swt.examples.launcher/doc-html/hglegal2002.htm deleted file mode 100644 index 74393f08f3..0000000000 --- a/examples/org.eclipse.swt.examples.launcher/doc-html/hglegal2002.htm +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - Legal Notices - - - -

-Notices

-(c) Copyright IBM Corp. 2000, 2002. All Rights Reserved. - - diff --git a/examples/org.eclipse.swt.examples.launcher/doc-html/ngibmcpy2002.gif b/examples/org.eclipse.swt.examples.launcher/doc-html/ngibmcpy2002.gif deleted file mode 100644 index 61cef48521..0000000000 Binary files a/examples/org.eclipse.swt.examples.launcher/doc-html/ngibmcpy2002.gif and /dev/null 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 6ed28916dc..0000000000 --- a/examples/org.eclipse.swt.examples.launcher/doc-html/swt_launcher_ex.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - SWT - Example Launcher - - - -

SWT Example Launcher

- -

-The Example Launcher is used to launch SWT examples which can either be Workbench Views, -or Standalone applications. -

- -
    -
  • Workbench Views are examples that are integrated into Eclipse. When the Launcher -starts a Workbench View, it is opened in the currently active perspective. -
  • Standalone applications are launched in a separate window. -
- -

Running the Example Launcher

- -

-From the Window menu, select Show View --> Other. -In the Show View dialog, expand SWT Examples and select the SWT Example Launcher view. -A view containing a list of examples will appear in your current perspective. -Select an example from the list. A brief description of the example is displayed. -Click on the Run button to launch the example. -

- - -

Details

-

The example launcher view contains a tree list, a text area, and a button. -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 -displays a short description of the example. The selected example can -be launched by clicking on the Run button. Standalone examples are run in the -same thread as the workbench's UI but they are not integrated into the perspective. -The launcher invokes the open() method of the standalone example. -

- -

Copyright IBM Corporation and others 2000, 2002.  All Rights Reserved.

- - 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 3edf91876a..0000000000 --- a/examples/org.eclipse.swt.examples.launcher/doc/org.eclipse.swt.examples.launcher.launchItems.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - -

Launch Items

-

Identifier

-org.eclipse.swt.examples.launcher.launchItems

Description

-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 using the platform's event loop. -Workbench views are created within the active Workbench Perspective.

Markup

-

   <!ELEMENT extension EMPTY> -
   <!ATTLIST extension -
     point CDATA #REQUIRED -
     id    CDATA #IMPLIED -
     name  CDATA #IMPLIED -
   > -

    -
  • point -
  • id -
  • name -
-

   <!ELEMENT program EMPTY> -
   <!ATTLIST program -
     mainClass CDATA #REQUIRED -
     pluginId  CDATA #REQUIRED -
   > -

    -
  • mainClass - The fully-qualified name of the class whose main() method is to be launched.
  • pluginId - The unique id of the Eclipse Platform plugin containing the program.
-

   <!ELEMENT view EMPTY> -
   <!ATTLIST view -
     viewId CDATA #REQUIRED -
   > -

    -
  • viewId - The unique id of the Workbench View to be activated when the item is launched.
-

   <!ELEMENT category EMPTY> -
   <!ATTLIST category -
     name     CDATA #REQUIRED -
     id       CDATA #REQUIRED -
     category CDATA #IMPLIED -
   > -

    -
  • name - The localized name of this category.
  • id - The unique id of this category. Categories with duplicate id's will be discarded.
  • category - The unique id of the parent category.
-

   <!ELEMENT item EMPTY> -
   <!ATTLIST item -
     name        CDATA #REQUIRED -
     id          CDATA #REQUIRED -
     category    CDATA #IMPLIED -
     icon        CDATA #IMPLIED -
     enabled     (true | false) "false""true" -
     description CDATA #IMPLIED -
   > -

    -
  • name - The localized name of this launch item.
  • id - The unique id of this launch item. Launch items with duplicate id's will be discarded.
  • category - The unique id of the category this launch item belongs to.
  • icon - The declaring plugin relative path of an icon to display with this launch item in the Launcher.
  • enabled - Set to "false" to disable this launch item, or to "true" to enable it (default).
  • description - The localized plain-text description of this launch item.
-

Example

-

API Information

-

Supplied Implementation

- - 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 Binary files a/examples/org.eclipse.swt.examples.launcher/icons/closedFolder.gif and /dev/null 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 Binary files a/examples/org.eclipse.swt.examples.launcher/icons/generic_example.gif and /dev/null 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 Binary files a/examples/org.eclipse.swt.examples.launcher/icons/launcher_example.gif and /dev/null 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 Binary files a/examples/org.eclipse.swt.examples.launcher/icons/openFolder.gif and /dev/null differ 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 05c328a5f7..0000000000 --- a/examples/org.eclipse.swt.examples.launcher/plugin.properties +++ /dev/null @@ -1,39 +0,0 @@ -providerName = Eclipse.org -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 = \ - The Example Launcher is used to launch SWT examples which can either be \ - Workbench Views, or Standalone applications.\n\n\ - Workbench Views are examples that are integrated into Eclipse. When the Launcher \ - starts a Workbench View, it is opened in the currently active perspective.\n\n\ - Standalone applications are launched in a separate window. - -error.CouldNotLoadResources = Unable to load resources -error.CouldNotFindRegisteredExtensions = Could Not Find Registered Extensions -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} - -launchitem.Null.description = <> - -launchitem.Missing.name = <> -launchitem.Missing.description = <> - -view.launchGroup.text = Examples -view.launchButton.text = Run -view.descriptionGroup.text = Description - -run.error.Invocation = A fatal error occurred while launching the program. -run.error.DoesNotImplementMethod = The class does not implement the open() method. -run.error.CouldNotFindClass = Could not find the class to run. -run.error.CouldNotInstantiateClass = Could not instantiate the class to run. 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 5f385382f3..0000000000 --- a/examples/org.eclipse.swt.examples.launcher/plugin.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/org.eclipse.swt.examples.launcher/schema/org.eclipse.swt.examples.launcher.launchItems.exsd b/examples/org.eclipse.swt.examples.launcher/schema/org.eclipse.swt.examples.launcher.launchItems.exsd deleted file mode 100644 index c91ddc5b9c..0000000000 --- a/examples/org.eclipse.swt.examples.launcher/schema/org.eclipse.swt.examples.launcher.launchItems.exsd +++ /dev/null @@ -1,195 +0,0 @@ - - - - - - - - - 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 using the platform's event loop. -Workbench views are created within the active Workbench Perspective. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Specifies a "Standalone Program" for a launch item to run. - - - - - - - The fully-qualified name of the class whose main() method is to be launched. - - - - - - - The unique id of the Eclipse Platform plugin containing the program. - - - - - - - - - - Specifies a "Workbench View" for a launch item to activate. - - - - - - - The unique id of the Workbench View to be activated when the item is launched. - - - - - - - - - - Specifies a launch item category heading. - - - - - - - The localized name of this category. - - - - - - - The unique id of this category. Categories with duplicate id's will be discarded. - - - - - - - The unique id of the parent category. - - - - - - - - - - Specifies a launch item. - - - - - - - The localized name of this launch item. - - - - - - - The unique id of this launch item. Launch items with duplicate id's will be discarded. - - - - - - - The unique id of the category this launch item belongs to. - - - - - - - The declaring plugin relative path of an icon to display with this launch item in the Launcher. - - - - - - - Set to "false" to disable this launch item, or to "true" to enable it (default). - - - - - - - The localized plain-text description of this launch item. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/org.eclipse.swt.examples.launcher/src/import.properties b/examples/org.eclipse.swt.examples.launcher/src/import.properties deleted file mode 100644 index 265131a99c..0000000000 --- a/examples/org.eclipse.swt.examples.launcher/src/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 = <> 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 11ff9372b0..0000000000 --- a/examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/ItemDescriptor.java +++ /dev/null @@ -1,72 +0,0 @@ -package org.eclipse.swt.examples.launcher; /* * Copyright (c) 2000, 2002 IBM Corp. All rights reserved. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html */ import org.eclipse.swt.graphics.*; - /** * ItemDescriptor collects information about a launch item. */ -class ItemDescriptor { - private String id; - private String name; - private String description; private Image icon; private String view; private String mainType; private String pluginId; - - /** - * Constructs an ItemDescriptor. - * - * @param id the id - * @param name the name - * @param description the description * @param icon the icon - * @param view the host view may be null if it is a standalone application * @param mainType the fully qualified class name to run may be null if it is a view * @param pluginId the name of the plugin which contains the main class - */ - public ItemDescriptor(String id, String name, String description, - Image icon, String view, String mainType, String pluginId) { - this.id = id; - this.name = name; - this.description = description; this.icon = icon; - this.view = view; this.mainType = mainType; this.pluginId = pluginId; - } - - /** - * 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 an icon for this descriptor * * @returns an icon, null if the item is a folder */ public Image getIcon() { return icon; } - /** - * Returns the host view for the program. - * - * @return the host view, null if the item is a standalone program. - */ - public String getView () { return view; } /** * Returns the fully qualified class to run * for the program. * * @return the class to run for the program. */ public String getMainType () { return mainType; } /** * Returns the name of the plugin that contains the program. * * @return the name of the plugin that contains the program. */ public String getPluginId () { return pluginId; } /** * Determines if an item is a folder. * * @return true if the item is a folder */ public boolean isFolder() { return (mainType == null && view == 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 9f6717e43c..0000000000 --- a/examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/ItemTreeNode.java +++ /dev/null @@ -1,75 +0,0 @@ -package org.eclipse.swt.examples.launcher; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -/** - * 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 21a680140a..0000000000 --- a/examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/LauncherPlugin.java +++ /dev/null @@ -1,379 +0,0 @@ -package org.eclipse.swt.examples.launcher; - -/* - * Copyright (c) 2000, 2002 IBM Corp. All rights reserved. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import java.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_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("<>", "<>", null, 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(getResourceString("error.CouldNotFindRegisteredExtensions"), 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, 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); - - IConfigurationElement viewCE = getItemElement(ce, LAUNCH_ITEMS_XML_VIEW); - if (viewCE != null) { - //Item is a view - final String attribView = getItemAttribute(viewCE, LAUNCH_ITEMS_XML_VIEW_VIEWID, null); - if (attribView == null) { - logError(getResourceString("error.IncompleteViewLaunchItem", - new Object[] { attribId } ), null); - return null; - } - return new ItemDescriptor(attribId, attribName, attribDescription, - attribIcon, attribView, null, null); - } else { - //Item is a standalone - 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; - } - return new ItemDescriptor(attribId, attribName, attribDescription, - attribIcon, null, attribClass, attribPluginId); - } else { - logError(getResourceString("error.IncompleteLaunchItem", - new Object[] { attribId } ), null); - return null; - } - } - } - - /** - * 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) { - } - } - } -} \ 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 8177538056..0000000000 --- a/examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/LauncherView.java +++ /dev/null @@ -1,229 +0,0 @@ -package org.eclipse.swt.examples.launcher; - -/* - * Copyright (c) 2000, 2002 IBM Corp. All rights reserved. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.*; -import org.eclipse.swt.layout.*; -import org.eclipse.swt.widgets.*; -import org.eclipse.ui.*; -import org.eclipse.ui.part.*; -import java.lang.reflect.*; - -/** - * Launcher uses org.eclipse.swt - * to launch the other registered examples. - * - * @see ViewPart - */ -public class LauncherView extends ViewPart { - private Shell workbenchShell; - - private Tree launchTree; - private Text descriptionText; - 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); - launchItem(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) { - launchItem(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; - 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 launchItem(ItemDescriptor itemDescriptor) { - /* Case 1: The launch item is a view */ - String pluginViewId = itemDescriptor.getView (); - if (pluginViewId != null) { - final IWorkbenchPart workbenchPart = this; - final IWorkbenchPartSite workbenchPartSite = workbenchPart.getSite(); - final IWorkbenchPage workbenchPage = workbenchPartSite.getPage(); - try { - workbenchPage.showView(pluginViewId); - } catch (PartInitException e) { - LauncherPlugin.logError(LauncherPlugin.getResourceString("run.error.Invocation"), e); - } - return; - } - /* Case 2: The launch item is a standalone program */ - if (workbenchShell == null) return; - try { - Class cl = Class.forName(itemDescriptor.getMainType()); - Display display = workbenchShell.getDisplay(); - Object exampleInstance = cl.newInstance(); - Method openMethod = cl.getDeclaredMethod("open", new Class[] {Display.class}); - openMethod.invoke(exampleInstance, new Object[] {display}); - } catch (NoSuchMethodException e) { - LauncherPlugin.logError(LauncherPlugin.getResourceString("run.error.DoesNotImplementMethod"), null); - } catch (ClassNotFoundException e) { - LauncherPlugin.logError(LauncherPlugin.getResourceString("run.error.CouldNotFindClass"), e); - } catch (Exception e) { - LauncherPlugin.logError(LauncherPlugin.getResourceString("run.error.CouldNotInstantiateClass"), e); - } - } - - /** - * 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); - } else { - description = itemDescriptor.getDescription(); - if (description == null) - description = LauncherPlugin.getResourceString("launchitem.Missing.description"); - if (runButton != null) { - runButton.setEnabled(itemDescriptor.getView() != null || itemDescriptor.getMainType() != 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 6eee1cdb9d..0000000000 --- a/examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/SplitLayout.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.eclipse.swt.examples.launcher; /* * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html */ import org.eclipse.swt.*; import org.eclipse.swt.graphics.*; import org.eclipse.swt.widgets.*; /** * 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.layouts/.classpath b/examples/org.eclipse.swt.examples.layouts/.classpath deleted file mode 100644 index da6f3cc359..0000000000 --- a/examples/org.eclipse.swt.examples.layouts/.classpath +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/examples/org.eclipse.swt.examples.layouts/.cvsignore b/examples/org.eclipse.swt.examples.layouts/.cvsignore deleted file mode 100644 index c5e82d7458..0000000000 --- a/examples/org.eclipse.swt.examples.layouts/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin \ No newline at end of file diff --git a/examples/org.eclipse.swt.examples.layouts/.project b/examples/org.eclipse.swt.examples.layouts/.project deleted file mode 100644 index cbc0d66613..0000000000 --- a/examples/org.eclipse.swt.examples.layouts/.project +++ /dev/null @@ -1,30 +0,0 @@ - - - org.eclipse.swt.examples.layouts - - - org.eclipse.swt - org.eclipse.swt.examples - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/examples/org.eclipse.swt.examples.layouts/about.html b/examples/org.eclipse.swt.examples.layouts/about.html deleted file mode 100644 index 9db411aab9..0000000000 --- a/examples/org.eclipse.swt.examples.layouts/about.html +++ /dev/null @@ -1,30 +0,0 @@ - - - -About - - - -

About This Content

- -

20th June, 2002

-

License

-

Eclipse.org makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the -Common Public License Version 1.0 ("CPL"). A copy of the CPL is available at http://www.eclipse.org/legal/cpl-v10.html. -For purposes of the CPL, "Program" will mean the Content.

- -

Contributions

- -

If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise -made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such -Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.

- -

If this Content is licensed to you under license terms and conditions other than the CPL ("Other License"), any modifications, enhancements and/or -other code and/or documentation ("Modifications") uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the -host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available -to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also -providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of -the CPL.

- - - \ No newline at end of file diff --git a/examples/org.eclipse.swt.examples.layouts/build.properties b/examples/org.eclipse.swt.examples.layouts/build.properties deleted file mode 100644 index a6d8f5e768..0000000000 --- a/examples/org.eclipse.swt.examples.layouts/build.properties +++ /dev/null @@ -1,10 +0,0 @@ -bin.includes = doc-html/,\ - icons/,\ - plugin.properties,\ - plugin.xml,\ - about.html,\ - *.jar - -src.includes = about.html - -source.layouts.jar = src/ diff --git a/examples/org.eclipse.swt.examples.layouts/doc-html/hglegal2002.htm b/examples/org.eclipse.swt.examples.layouts/doc-html/hglegal2002.htm deleted file mode 100644 index 74393f08f3..0000000000 --- a/examples/org.eclipse.swt.examples.layouts/doc-html/hglegal2002.htm +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - Legal Notices - - - -

-Notices

-(c) Copyright IBM Corp. 2000, 2002. All Rights Reserved. - - diff --git a/examples/org.eclipse.swt.examples.layouts/doc-html/ngibmcpy2002.gif b/examples/org.eclipse.swt.examples.layouts/doc-html/ngibmcpy2002.gif deleted file mode 100644 index 61cef48521..0000000000 Binary files a/examples/org.eclipse.swt.examples.layouts/doc-html/ngibmcpy2002.gif and /dev/null differ diff --git a/examples/org.eclipse.swt.examples.layouts/doc-html/swt_layout_ex.html b/examples/org.eclipse.swt.examples.layouts/doc-html/swt_layout_ex.html deleted file mode 100644 index d021ab39fa..0000000000 --- a/examples/org.eclipse.swt.examples.layouts/doc-html/swt_layout_ex.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - SWT - Layout Overview - - - -

SWT Example - Layout Overview

- -

-This example is a simple demonstration of common SWT layouts. -It consists of a tab folder where each tab allows the -user to interact with a different SWT layout. -The user can insert widgets into a layout and set the values of the layout data -using a property sheet. When the user has a suitable arrangement, code can be -generated by clicking on the Code button. -

- -

Running the example

- -

From the Window menu select Show View --> Other. -In the Show View dialog, expand SWT Examples and select the -view named SWT Layouts. A view titled SWT Layouts will appear in your current perspective. -

- -

Copyright IBM Corporation and others 2000, 2002.  All Rights Reserved.

- - \ No newline at end of file diff --git a/examples/org.eclipse.swt.examples.layouts/icons/layouts_example.gif b/examples/org.eclipse.swt.examples.layouts/icons/layouts_example.gif deleted file mode 100644 index d945dde53b..0000000000 Binary files a/examples/org.eclipse.swt.examples.layouts/icons/layouts_example.gif and /dev/null differ diff --git a/examples/org.eclipse.swt.examples.layouts/plugin.properties b/examples/org.eclipse.swt.examples.layouts/plugin.properties deleted file mode 100644 index 2e18a431a5..0000000000 --- a/examples/org.eclipse.swt.examples.layouts/plugin.properties +++ /dev/null @@ -1,18 +0,0 @@ -providerName = Eclipse.org -plugin.SWTLayoutExample.name = SWT Layout Example Plugin -category.SWTExamples.name = SWT Examples -view.LayoutExample.name = SWT Layouts - -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.LayoutExample.name = Layouts -launchitem.LayoutExample.description = \ - This example is a simple demonstration of common SWT layouts. \n\n\ - It consists of a tab folder where each tab allows the \ - user to interact with a different SWT layout.\ - The user can insert widgets into a layout and set the values of the layout data \ - using a property sheet. When the user has a suitable arrangement, code can be \ - generated by clicking on the Code button. diff --git a/examples/org.eclipse.swt.examples.layouts/plugin.xml b/examples/org.eclipse.swt.examples.layouts/plugin.xml deleted file mode 100644 index a2428dd59a..0000000000 --- a/examples/org.eclipse.swt.examples.layouts/plugin.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/org.eclipse.swt.examples.layouts/src/import.properties b/examples/org.eclipse.swt.examples.layouts/src/import.properties deleted file mode 100644 index 265131a99c..0000000000 --- a/examples/org.eclipse.swt.examples.layouts/src/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 = <> diff --git a/examples/org.eclipse.swt.examples.layouts/src/org/eclipse/swt/examples/layouts/LayoutPlugin.java b/examples/org.eclipse.swt.examples.layouts/src/org/eclipse/swt/examples/layouts/LayoutPlugin.java deleted file mode 100644 index 2a0312a2d1..0000000000 --- a/examples/org.eclipse.swt.examples.layouts/src/org/eclipse/swt/examples/layouts/LayoutPlugin.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.eclipse.swt.examples.layouts; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.core.runtime.*; -import org.eclipse.ui.plugin.*; - -/** - * The main plugin class to be used in the desktop. - */ -public class LayoutPlugin extends AbstractUIPlugin { - /** - * The constructor. - */ - public LayoutPlugin(IPluginDescriptor descriptor) { - super(descriptor); - } - - /** - * Clean up - */ - public void shutdown() throws CoreException { - super.shutdown(); - } -} diff --git a/examples/org.eclipse.swt.examples.layouts/src/org/eclipse/swt/examples/layouts/LayoutView.java b/examples/org.eclipse.swt.examples.layouts/src/org/eclipse/swt/examples/layouts/LayoutView.java deleted file mode 100644 index 3ab737a279..0000000000 --- a/examples/org.eclipse.swt.examples.layouts/src/org/eclipse/swt/examples/layouts/LayoutView.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.eclipse.swt.examples.layouts; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.examples.layoutexample.*; -import org.eclipse.swt.widgets.*; -import org.eclipse.ui.part.*; - -/** - * Layouts is a simple demonstration - * of the layouts 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 layout. - * - * @see ViewPart - */ -public class LayoutView extends ViewPart { - LayoutExample instance = null; - - /** - * Create the example - * - * @see ViewPart#createPartControl - */ - public void createPartControl(Composite frame) { - instance = new LayoutExample(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.ole.win32/.classpath b/examples/org.eclipse.swt.examples.ole.win32/.classpath deleted file mode 100755 index 34eb16e15f..0000000000 --- a/examples/org.eclipse.swt.examples.ole.win32/.classpath +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - 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/.project b/examples/org.eclipse.swt.examples.ole.win32/.project deleted file mode 100644 index b160136cdd..0000000000 --- a/examples/org.eclipse.swt.examples.ole.win32/.project +++ /dev/null @@ -1,29 +0,0 @@ - - - org.eclipse.swt.examples.ole.win32 - - - org.eclipse.swt - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/examples/org.eclipse.swt.examples.ole.win32/about.html b/examples/org.eclipse.swt.examples.ole.win32/about.html deleted file mode 100644 index 9db411aab9..0000000000 --- a/examples/org.eclipse.swt.examples.ole.win32/about.html +++ /dev/null @@ -1,30 +0,0 @@ - - - -About - - - -

About This Content

- -

20th June, 2002

-

License

-

Eclipse.org makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the -Common Public License Version 1.0 ("CPL"). A copy of the CPL is available at http://www.eclipse.org/legal/cpl-v10.html. -For purposes of the CPL, "Program" will mean the Content.

- -

Contributions

- -

If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise -made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such -Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.

- -

If this Content is licensed to you under license terms and conditions other than the CPL ("Other License"), any modifications, enhancements and/or -other code and/or documentation ("Modifications") uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the -host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available -to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also -providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of -the CPL.

- - - \ No newline at end of file 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 ac90c6ffa3..0000000000 --- a/examples/org.eclipse.swt.examples.ole.win32/build.properties +++ /dev/null @@ -1,10 +0,0 @@ -bin.includes = doc-html/,\ - icons/,\ - plugin.properties,\ - plugin.xml,\ - about.html,\ - *.jar - -src.includes = about.html - -source.olewin32.jar = src/ diff --git a/examples/org.eclipse.swt.examples.ole.win32/doc-html/hglegal2002.htm b/examples/org.eclipse.swt.examples.ole.win32/doc-html/hglegal2002.htm deleted file mode 100644 index 74393f08f3..0000000000 --- a/examples/org.eclipse.swt.examples.ole.win32/doc-html/hglegal2002.htm +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - Legal Notices - - - -

-Notices

-(c) Copyright IBM Corp. 2000, 2002. All Rights Reserved. - - diff --git a/examples/org.eclipse.swt.examples.ole.win32/doc-html/ngibmcpy2002.gif b/examples/org.eclipse.swt.examples.ole.win32/doc-html/ngibmcpy2002.gif deleted file mode 100644 index 61cef48521..0000000000 Binary files a/examples/org.eclipse.swt.examples.ole.win32/doc-html/ngibmcpy2002.gif and /dev/null 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 8191de138f..0000000000 --- a/examples/org.eclipse.swt.examples.ole.win32/doc-html/swt_ole_ex.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - SWT - OLE Web Browser - - - -

Example - OLE Web Browser

- -

-This example demonstrates how to embed an Active X control into an SWT application or an Eclipse view. -

-

-When the view is opened, it will create an instance of the Windows Internet Explorer -control. 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. -

- -

Running the example

- -

-From the Window menu select Show View --> Other. -In the Show View dialog, expand SWT Examples and select -the view named OLE Web Browser (Win32). A view containing a web browser will appear. -

- -

Copyright IBM Corporation and others 2000, 2002.  All Rights Reserved.

- - 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 Binary files a/examples/org.eclipse.swt.examples.ole.win32/icons/backward_nav.gif and /dev/null 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 Binary files a/examples/org.eclipse.swt.examples.ole.win32/icons/forward_nav.gif and /dev/null 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 Binary files a/examples/org.eclipse.swt.examples.ole.win32/icons/home_nav.gif and /dev/null 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 Binary files a/examples/org.eclipse.swt.examples.ole.win32/icons/refresh_nav.gif and /dev/null 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 Binary files a/examples/org.eclipse.swt.examples.ole.win32/icons/search_nav.gif and /dev/null 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 Binary files a/examples/org.eclipse.swt.examples.ole.win32/icons/stop_nav.gif and /dev/null 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 Binary files a/examples/org.eclipse.swt.examples.ole.win32/icons/webbrowser_example.gif and /dev/null differ 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 82d8e49fe5..0000000000 --- a/examples/org.eclipse.swt.examples.ole.win32/plugin.properties +++ /dev/null @@ -1,50 +0,0 @@ -providerName = Eclipse.org -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 an Active X control into an SWT application or an Eclipse view.\n\n\ - When the view is opened, it will create an instance of the Windows Internet Explorer \ - control. 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. - -browser.Back.text = Backward -browser.Back.tooltip = Go to previous Web site in the history list - -browser.Forward.text = Forward -browser.Forward.tooltip = Go to next Web site in the history list - -browser.Home.text = Home -browser.Home.tooltip = Go 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 <> 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 09b30f9c15..0000000000 --- a/examples/org.eclipse.swt.examples.ole.win32/plugin.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/org.eclipse.swt.examples.ole.win32/src/import.properties b/examples/org.eclipse.swt.examples.ole.win32/src/import.properties deleted file mode 100644 index 265131a99c..0000000000 --- a/examples/org.eclipse.swt.examples.ole.win32/src/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 = <> 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 7a2a0066cc..0000000000 --- a/examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OleBrowserView.java +++ /dev/null @@ -1,356 +0,0 @@ -package org.eclipse.swt.examples.ole.win32; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.*; import org.eclipse.swt.events.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.ole.win32.*; import org.eclipse.swt.widgets.*; import org.eclipse.ui.part.*; - -/** - * Ole uses org.eclipse.swt 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 478c97be2f..0000000000 --- a/examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OlePlugin.java +++ /dev/null @@ -1,172 +0,0 @@ -package org.eclipse.swt.examples.ole.win32; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import java.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 b82c9d5cae..0000000000 --- a/examples/org.eclipse.swt.examples.ole.win32/src/org/eclipse/swt/examples/ole/win32/OleWebBrowser.java +++ /dev/null @@ -1,224 +0,0 @@ -package org.eclipse.swt.examples.ole.win32; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.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. - *

- * Typical use:
- * - * OleControlSite oleControlSite = new OleControlSite(oleFrame, style, "Shell.Explorer");
- * OleAutomation oleAutomation = new OleAutomation(oleControlSite);
- * OleWebBrowser webBrowser = new OleWebBrowser(oleControlSite, oleAutomation);
- *
- * - * @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 || pVarResult.getType() != OLE.VT_BSTR) 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 || pVarResult.getType() != OLE.VT_BSTR) 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 || pVarResult.getType() != OLE.VT_I4) return -1; - return pVarResult.getInt(); - } - - /** - * Navigates backwards through previously visited web sites. - */ - public void GoBack() { - - // dispid=100, type=METHOD, name="GoBack" - int[] rgdispid = oleAutomation.getIDsOfNames(new String[]{"GoBack"}); - int dispIdMember = rgdispid[0]; - oleAutomation.invoke(dispIdMember); - } - - /** - * Navigates backwards through previously visited web sites. - */ - public void GoForward() { - - // dispid=101, type=METHOD, name="GoForward" - int[] rgdispid = oleAutomation.getIDsOfNames(new String[]{"GoForward"}); - int dispIdMember = rgdispid[0]; - oleAutomation.invoke(dispIdMember); - } - - /** - * Navigates to home page. - */ - public void GoHome() { - // dispid=102, type=METHOD, name="GoHome" - int[] rgdispid = oleAutomation.getIDsOfNames(new String[]{"GoHome"}); - int dispIdMember = rgdispid[0]; - oleAutomation.invoke(dispIdMember); - } - - /** - * Navigates to user-specified Web search gateway. - */ - public void GoSearch() { - // dispid=103, type=METHOD, name="GoSearch" - int[] rgdispid = oleAutomation.getIDsOfNames(new String[]{"GoSearch"}); - int dispIdMember = rgdispid[0]; - oleAutomation.invoke(dispIdMember); - } - - /** - * Navigates to a particular URL. - */ - public void 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 - oleAutomation.invoke(dispIdMember, rgvarg, rgdispidNamedArgs); - } - - /** - * 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]; - 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 bba8e78c79..0000000000 --- a/examples/org.eclipse.swt.examples.paint/.classpath +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - 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/.project b/examples/org.eclipse.swt.examples.paint/.project deleted file mode 100644 index 3cb7c3ea6d..0000000000 --- a/examples/org.eclipse.swt.examples.paint/.project +++ /dev/null @@ -1,29 +0,0 @@ - - - org.eclipse.swt.examples.paint - - - org.eclipse.swt - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/examples/org.eclipse.swt.examples.paint/about.html b/examples/org.eclipse.swt.examples.paint/about.html deleted file mode 100644 index 9db411aab9..0000000000 --- a/examples/org.eclipse.swt.examples.paint/about.html +++ /dev/null @@ -1,30 +0,0 @@ - - - -About - - - -

About This Content

- -

20th June, 2002

-

License

-

Eclipse.org makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the -Common Public License Version 1.0 ("CPL"). A copy of the CPL is available at http://www.eclipse.org/legal/cpl-v10.html. -For purposes of the CPL, "Program" will mean the Content.

- -

Contributions

- -

If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise -made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such -Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.

- -

If this Content is licensed to you under license terms and conditions other than the CPL ("Other License"), any modifications, enhancements and/or -other code and/or documentation ("Modifications") uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the -host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available -to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also -providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of -the CPL.

- - - \ No newline at end of file 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 db39eb3db8..0000000000 --- a/examples/org.eclipse.swt.examples.paint/build.properties +++ /dev/null @@ -1,10 +0,0 @@ -bin.includes = doc-html/,\ - icons/,\ - plugin.properties,\ - plugin.xml,\ - about.html,\ - *.jar - -src.includes = about.html - -source.paint.jar = src/ diff --git a/examples/org.eclipse.swt.examples.paint/doc-html/hglegal2002.htm b/examples/org.eclipse.swt.examples.paint/doc-html/hglegal2002.htm deleted file mode 100644 index 74393f08f3..0000000000 --- a/examples/org.eclipse.swt.examples.paint/doc-html/hglegal2002.htm +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - Legal Notices - - - -

-Notices

-(c) Copyright IBM Corp. 2000, 2002. All Rights Reserved. - - diff --git a/examples/org.eclipse.swt.examples.paint/doc-html/ngibmcpy2002.gif b/examples/org.eclipse.swt.examples.paint/doc-html/ngibmcpy2002.gif deleted file mode 100644 index 61cef48521..0000000000 Binary files a/examples/org.eclipse.swt.examples.paint/doc-html/ngibmcpy2002.gif and /dev/null 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 8449ba4ebb..0000000000 --- a/examples/org.eclipse.swt.examples.paint/doc-html/swt_paint_ex.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - SWT - Paint Tool - - - -

SWT Example - Paint Tool

- -

-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. -

-

-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. -

-

-Uses SWT's GC and FontDialog, and JFace's InputDialog and action set support. -

- -

Running the example

- -

From the Window menu select Show View --> Other. -In the Show View dialog, expand SWT Examples and select the -view named Paint. A view titled Paint will appear in your current perspective. -

- -

Copyright IBM Corporation and others 2000, 2002.  All Rights Reserved.

- - 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 Binary files a/examples/org.eclipse.swt.examples.paint/icons/fill_none.gif and /dev/null 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 Binary files a/examples/org.eclipse.swt.examples.paint/icons/fill_outline.gif and /dev/null 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 Binary files a/examples/org.eclipse.swt.examples.paint/icons/fill_solid.gif and /dev/null 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 Binary files a/examples/org.eclipse.swt.examples.paint/icons/linestyle_dash.gif and /dev/null 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 Binary files a/examples/org.eclipse.swt.examples.paint/icons/linestyle_dashdot.gif and /dev/null 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 Binary files a/examples/org.eclipse.swt.examples.paint/icons/linestyle_dot.gif and /dev/null 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 Binary files a/examples/org.eclipse.swt.examples.paint/icons/linestyle_solid.gif and /dev/null 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 Binary files a/examples/org.eclipse.swt.examples.paint/icons/options_font.gif and /dev/null 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 Binary files a/examples/org.eclipse.swt.examples.paint/icons/paint_example.gif and /dev/null 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 Binary files a/examples/org.eclipse.swt.examples.paint/icons/tool_airbrush.gif and /dev/null 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 Binary files a/examples/org.eclipse.swt.examples.paint/icons/tool_ellipse.gif and /dev/null 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 Binary files a/examples/org.eclipse.swt.examples.paint/icons/tool_line.gif and /dev/null 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 Binary files a/examples/org.eclipse.swt.examples.paint/icons/tool_pencil.gif and /dev/null 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 Binary files a/examples/org.eclipse.swt.examples.paint/icons/tool_polyline.gif and /dev/null 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 Binary files a/examples/org.eclipse.swt.examples.paint/icons/tool_rectangle.gif and /dev/null 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 Binary files a/examples/org.eclipse.swt.examples.paint/icons/tool_roundedrectangle.gif and /dev/null 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 Binary files a/examples/org.eclipse.swt.examples.paint/icons/tool_text.gif and /dev/null differ 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 7ec46f1cde..0000000000 --- a/examples/org.eclipse.swt.examples.paint/plugin.properties +++ /dev/null @@ -1,124 +0,0 @@ -providerName = Eclipse.org -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.\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 = - -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 33c25bec28..0000000000 --- a/examples/org.eclipse.swt.examples.paint/plugin.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/org.eclipse.swt.examples.paint/src/import.properties b/examples/org.eclipse.swt.examples.paint/src/import.properties deleted file mode 100644 index 265131a99c..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/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 = <> 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 b6884de51a..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/AirbrushTool.java +++ /dev/null @@ -1,74 +0,0 @@ -package org.eclipse.swt.examples.paint; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import java.util.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 1a7e3942b6..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/BasicPaintSession.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.eclipse.swt.examples.paint; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -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 8416429f6a..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/ContainerFigure.java +++ /dev/null @@ -1,89 +0,0 @@ -package org.eclipse.swt.examples.paint; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.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. - *

- * Note that erasePreview() cannot be called after this point to erase any previous - * drawPreview()'s. - *

- */ - 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 f5efcb789d..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/ContinuousPaintSession.java +++ /dev/null @@ -1,228 +0,0 @@ -package org.eclipse.swt.examples.paint; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.events.*; 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. - *

- * 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. - *

- * @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 728f1707a1..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/DragPaintSession.java +++ /dev/null @@ -1,131 +0,0 @@ -package org.eclipse.swt.examples.paint; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.events.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 27eedb39b5..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/EllipseFigure.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.eclipse.swt.examples.paint; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.*; -import org.eclipse.swt.graphics.*; - -/** - * 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 3b3f11f2d9..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/EllipseTool.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.eclipse.swt.examples.paint; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.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 be049d1700..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/Figure.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.eclipse.swt.examples.paint; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.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 4c08aa86cd..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/FigureDrawContext.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.eclipse.swt.examples.paint; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.graphics.*; - -public class FigureDrawContext { - /* - *

- * The GC must be set up as follows - * (it will be returned to this state upon completion of drawing operations) - *

    - *
  • setXORMode(false) - *
- *

- */ - 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 f7b0605cb0..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/LineFigure.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.eclipse.swt.examples.paint; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.*; -import org.eclipse.swt.graphics.*; - -/** - * 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 f919965c86..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/LineTool.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.eclipse.swt.examples.paint; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.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 e4da0cf02f..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintPlugin.java +++ /dev/null @@ -1,80 +0,0 @@ -package org.eclipse.swt.examples.paint; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.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 a5a43d03cc..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintSession.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.eclipse.swt.examples.paint; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.events.*; - -/** - * 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 f9fd2064a2..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintSurface.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.eclipse.swt.examples.paint; -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - import org.eclipse.swt.events.*; 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. *

* paintCanvas must have SWT.NO_REDRAW_RESIZE and SWT.NO_BACKGROUND styles, * and may have SWT.V_SCROLL and/or SWT.H_SCROLL. *

* @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.addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) { displayFDC.gc.dispose(); } }); 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(); 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. *

- * If oldPaintSession != paintSession calls oldPaintSession.end() * and paintSession.begin() *

* - * @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. *

* This object will be drawn to the screen as a preview and refreshed appropriately * until the selection is either cleared or committed. *

* * @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. *

* Erases any rubberband objects on the screen then clears the selection. *

*/ 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. *

* Redraws any rubberband objects on the screen as permanent objects then clears the selection. *

*/ public void commitRubberbandSelection() { rubberband.draw(imageFDC); if (isRubberbandHidden()) rubberband.draw(displayFDC); rubberband.clear(); } /** * Hides the rubberband (but does not eliminate it). *

* Increments by one the rubberband "hide" nesting count. The rubberband * is hidden from view (but remains active) if it wasn't already hidden. *

*/ 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. *

* 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. *

*/ 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 da27e96033..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintTool.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.eclipse.swt.examples.paint; -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - 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 174de42e8d..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PaintView.java +++ /dev/null @@ -1,496 +0,0 @@ -package org.eclipse.swt.examples.paint; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.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 ee51916ce9..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PencilTool.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.eclipse.swt.examples.paint; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.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 07fedbd352..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PointFigure.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.eclipse.swt.examples.paint; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.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 f2db962fd0..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/PolyLineTool.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.eclipse.swt.examples.paint; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.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 a2b4625fe6..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RectangleFigure.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.eclipse.swt.examples.paint; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.*; -import org.eclipse.swt.graphics.*; - -/** - * 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 2da6fa3296..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RectangleTool.java +++ /dev/null @@ -1,67 +0,0 @@ -package org.eclipse.swt.examples.paint; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.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 2dd0bfd29c..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RoundedRectangleFigure.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.eclipse.swt.examples.paint; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.*; -import org.eclipse.swt.graphics.*; - -/** - * 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 beec38ec56..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/RoundedRectangleTool.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.eclipse.swt.examples.paint; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.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 d1697eb2eb..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SegmentedPaintSession.java +++ /dev/null @@ -1,155 +0,0 @@ -package org.eclipse.swt.examples.paint; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.events.*; -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 123417fd5e..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidEllipseFigure.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.eclipse.swt.examples.paint; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.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 30b47100b4..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidPolygonFigure.java +++ /dev/null @@ -1,55 +0,0 @@ -package org.eclipse.swt.examples.paint; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.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 9f2d7b64a3..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidRectangleFigure.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.eclipse.swt.examples.paint; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.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 de07824310..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/SolidRoundedRectangleFigure.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.eclipse.swt.examples.paint; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.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 9317772e94..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/TextFigure.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.eclipse.swt.examples.paint; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.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 bf051dc1d3..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/TextTool.java +++ /dev/null @@ -1,123 +0,0 @@ -package org.eclipse.swt.examples.paint; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.jface.dialogs.*; -import org.eclipse.swt.events.*; - -/** - * 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 6c5aee8e72..0000000000 --- a/examples/org.eclipse.swt.examples.paint/src/org/eclipse/swt/examples/paint/ToolSettings.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.eclipse.swt.examples.paint; -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - import org.eclipse.swt.*; import org.eclipse.swt.graphics.*; - /** * 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 *

One of ftNone, ftOutline, ftSolid.

*/ 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 07ce282125..0000000000 --- a/examples/org.eclipse.swt.examples/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - 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/.project b/examples/org.eclipse.swt.examples/.project deleted file mode 100644 index 7dfd92eb80..0000000000 --- a/examples/org.eclipse.swt.examples/.project +++ /dev/null @@ -1,29 +0,0 @@ - - - org.eclipse.swt.examples - - - org.eclipse.swt - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/examples/org.eclipse.swt.examples/about.html b/examples/org.eclipse.swt.examples/about.html deleted file mode 100644 index 9db411aab9..0000000000 --- a/examples/org.eclipse.swt.examples/about.html +++ /dev/null @@ -1,30 +0,0 @@ - - - -About - - - -

About This Content

- -

20th June, 2002

-

License

-

Eclipse.org makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the -Common Public License Version 1.0 ("CPL"). A copy of the CPL is available at http://www.eclipse.org/legal/cpl-v10.html. -For purposes of the CPL, "Program" will mean the Content.

- -

Contributions

- -

If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise -made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such -Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.

- -

If this Content is licensed to you under license terms and conditions other than the CPL ("Other License"), any modifications, enhancements and/or -other code and/or documentation ("Modifications") uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the -host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available -to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also -providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of -the CPL.

- - - \ No newline at end of file diff --git a/examples/org.eclipse.swt.examples/build.properties b/examples/org.eclipse.swt.examples/build.properties deleted file mode 100755 index 62ce80a8a4..0000000000 --- a/examples/org.eclipse.swt.examples/build.properties +++ /dev/null @@ -1,9 +0,0 @@ -bin.includes = doc-html/,\ - plugin.properties,\ - plugin.xml,\ - about.html,\ - swtexamples.jar - -src.includes = about.html - -source.swtexamples.jar = src/ diff --git a/examples/org.eclipse.swt.examples/doc-html/hglegal2002.htm b/examples/org.eclipse.swt.examples/doc-html/hglegal2002.htm deleted file mode 100644 index 74393f08f3..0000000000 --- a/examples/org.eclipse.swt.examples/doc-html/hglegal2002.htm +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - Legal Notices - - - -

-Notices

-(c) Copyright IBM Corp. 2000, 2002. All Rights Reserved. - - diff --git a/examples/org.eclipse.swt.examples/doc-html/ngibmcpy2002.gif b/examples/org.eclipse.swt.examples/doc-html/ngibmcpy2002.gif deleted file mode 100644 index 61cef48521..0000000000 Binary files a/examples/org.eclipse.swt.examples/doc-html/ngibmcpy2002.gif and /dev/null 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 74a6801bd3..0000000000 --- a/examples/org.eclipse.swt.examples/doc-html/swt_addressbook_ex.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - SWT - Address Book Example - - - -

SWT Standalone Example - Address Book

- -

-The AddressBook example shows how the Table control can be used to -present information in a tabular format. The application can save and load data -from a file, sort the entries, and search for strings within the fields. -

- -

Running the example

-

-Follow the Manual Setup -instructions to install and run the example from your workspace. -

-

-The "Main" class is org.eclipse.swt.examples.addressbook.AddressBook. -

-

-This example can also be run using the Example Launcher. -Select the Address Book item from the Standalone category and click Run. -

-

Copyright IBM Corporation and others 2000, 2002.  All Rights Reserved.

- - diff --git a/examples/org.eclipse.swt.examples/doc-html/swt_controls_ex.html b/examples/org.eclipse.swt.examples/doc-html/swt_controls_ex.html deleted file mode 100644 index 80d63e227d..0000000000 --- a/examples/org.eclipse.swt.examples/doc-html/swt_controls_ex.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - SWT - Controls Overview - - - -

SWT Standalone Example - Controls Example

- -

-The Controls example is a simple demonstration of common SWT controls. -It consists of a tab folder where each tab in the folder allows the user -to interact with a different control. -The user can change styles and settings and view how this affects the control. -

- -

Running the example

-

-Follow the Manual Setup -instructions to install and run the example from your workspace. -

-

-The "Main" class is org.eclipse.swt.examples.controlexample.ControlExample. -

- - -

Copyright IBM Corporation and others 2000, 2002.  All Rights Reserved.

- - 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 a3d06c10af..0000000000 --- a/examples/org.eclipse.swt.examples/doc-html/swt_fileviewer_ex.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - SWT - File Viewer Example - - - -

SWT Standalone Example - File Viewer

- -

-The File Viewer example shows how a simple application can be implemented using SWT. -This application provides the ability to navigate files and folders and manipulate them via Drag and Drop. -It includes the use of alternate threads for long actions and demonstrates the use of the Tree, -Table, Toolbar and Program. -

- -

Running the example

-

-Follow the Manual Setup -instructions to install and run the example from your workspace. -

-

-The "Main" class is org.eclipse.swt.examples.fileviewer.FileViewer. -

-

-This example can also be run using the Example Launcher. -Select the File Viewer item from the Standalone category and click Run. -

- -

Copyright IBM Corporation and others 2000, 2002.  All Rights Reserved.

- - 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 f9e8953276..0000000000 --- a/examples/org.eclipse.swt.examples/doc-html/swt_helloworld_ex.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - SWT - Hello World Examples - - - -

SWT Standalone Example - Hello World

- -

-The Hello World examples are a set of introductory examples to show how to get started -creating an application with SWT. They cover creating a shell, using event listeners, -processing events in an event loop, using layouts, and drawing with a Graphic Context. -

- -

Hello World 1

-

-This example demonstrates how to open a Shell and process the events. -

- -

Hello World 2

-

-This example builds on HelloWorld1 and demonstrates how to display a Label inside the Shell. -

- -

Hello World 3

-

-This example builds on HelloWorld2 and demonstrates how to resize the Label -when the Shell resizes using a Listener mechanism. -

- -

Hello World 4

-

-This example builds on HelloWorld2 and demonstrates how to resize the Label -when the Shell resizes using a Layout. -

- -

Hello World 5

-

-This example builds on HelloWorld1 and demonstrates how to draw directly -on an SWT Control using a graphic context. -

- -

Running the example

- -

-Follow the Manual Setup -instructions to install and run the example from your workspace. -

-

-The "Main" class is org.eclipse.swt.examples.helloworld.HelloWorld[1-5]. -

-

-This example can also be run using the Example Launcher. -Select the Hello World item from the Standalone category and click Run. -

- -

Copyright IBM Corporation and others 2000, 2002.  All Rights Reserved.

- - 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 29712faba7..0000000000 --- a/examples/org.eclipse.swt.examples/doc-html/swt_hoverhelp_ex.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - SWT - Hover Help Example - - - -

SWT Standalone Example - Hover Help

- -

-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. -The example implements its own tooltip and hover help support. -To see the custom tooltips in action, hover over an item or button in the UI. -Notice that images appear in the left-hand corner of the tooltip. -To see the custom hover help in action, hover over an item or button in the UI until -the tooltip is displayed. Without moving the mouse, hit F1. A new Shell will pop up with the -extended hover help information for the UI element in question. -

- -

Running the example

-

-Follow the Manual Setup -instructions to install and run the example from your workspace. -

-

-The "Main" class is org.eclipse.swt.examples.hoverhelp.HoverHelp. -

-

-This example can also be run using the Example Launcher. -Select the Hover Help item from the Standalone category and click Run. -

- -

Copyright IBM Corporation and others 2000, 2002.  All Rights Reserved.

- - 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 5a25923051..0000000000 --- a/examples/org.eclipse.swt.examples/doc-html/swt_imageanalyzer_ex.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - SWT - Image Analyzer Example - - - -

SWT Standalone Example - Image Analyzer

- -

-The ImageAnalyzer opens image files and displays the visual contents of the file along with a -summary of the data in the image file. -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. -

-

-The ImageAnalyzer will load and display image files of type GIF, JPEG, BMP, ICO, and PNG. -To open a file, use the File --> Open... menu item, and select the image file in the FileDialog. -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. -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. If a GIF defines a background color, -as many animated GIFs do, selecting Background will use the GIF's background color. -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. You can change the background color of the ImageAnalyzer to see the transparency work. -To turn off the transparency, deselect Display Transparency. -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. -File --> Save As... can be used to save the currently loaded image to another type of image file. If the image has transparency, -File --> Save Mask As... saves the image's transparency mask. -

-

-When SWT loads an image file, an instance of org.eclipse.swt.graphics.ImageData is created. (In the case of an ICO file or -multi-image GIF, an array of ImageData instances is created). The ImageAnalyzer displays all of the data stored in the ImageData -instance(s) for the currently loaded image file, including the pixel data. Hovering over a pixel in the image display will show the RGB -color data for that pixel. For certain images (particularly animated GIFs) additional data is stored in the org.eclipse.swt.graphics.ImageLoader -instance used to load the image. The ImageAnalyzer displays this data as well. -

- -

Running the example

- -

-Follow the Manual Setup -instructions to install and run the example from your workspace. -

-

-The "Main" class is org.eclipse.swt.examples.imageanalyzer.ImageAnalyzer. -

-

-This example can also be run using the Example Launcher. -Select the Image Analyzer item from the Standalone category and click Run. -

- -

Copyright IBM Corporation and others 2000, 2002.  All Rights Reserved.

- - 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 be071be4b3..0000000000 --- a/examples/org.eclipse.swt.examples/doc-html/swt_javaviewer_ex.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - SWT - Java Syntax Viewer Example - - - -

SWT Standalone Example - Java Syntax Viewer

- -

-This example demonstrates how to implement a user-defined line styler for the StyledText widget. -The example provides a typical editor interface. -To see the effect of the line styler, open a *.java file. -When the contents of the file are displayed in the editor area, notice that the keywords have been highlighted. -

- -

Running the example

-

-Follow the Manual Setup -instructions to install and run the example from your workspace. -

-

-The "Main" class is org.eclipse.swt.examples.javaviewer.JavaViewer. -

-

-This example can also be run using the Example Launcher. -Select the Java Syntax Viewer item from the Standalone category and click Run. -

- -

Copyright IBM Corporation and others 2000, 2002.  All Rights Reserved.

- - diff --git a/examples/org.eclipse.swt.examples/doc-html/swt_launcher_ex.html b/examples/org.eclipse.swt.examples/doc-html/swt_launcher_ex.html deleted file mode 100644 index 9f882bd4dc..0000000000 --- a/examples/org.eclipse.swt.examples/doc-html/swt_launcher_ex.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - SWT - Example Launcher - - - -

SWT Example Launcher

- -

-The Example Launcher is used to launch SWT examples which can either be Workbench Views, -or Standalone applications. -

- -
    -
  • Workbench Views are examples that are integrated into Eclipse. When the Launcher -starts a Workbench View, it is opened in the currently active perspective. -
  • Standalone applications are launched in a separate window. -
- -

-For information on how to run the standalone examples without the SWT Example Launcher, -refer to Manual Setup. -

-

-The SWT workbench view examples can also be launched directly without using the SWT Example -Launcher. SWT workbench view examples can be found under the SWT Examples category of the -Show Views dialog. -

- -

Running the Example Launcher

- -

-From the Window menu, select Show View --> Other. -In the Show View dialog, expand SWT Examples and select the SWT Example Launcher view. -A view containing a list of examples will appear in your current perspective. -Select an example from the list. A brief description of the example is displayed. -Click on the Run button to launch the example. -

- - -

Details

-

The example launcher view contains a tree list, a text area, and a button. -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 -displays a short description of the example. The selected example can -be launched by clicking on the Run button. Standalone examples are run in the -same thread as the workbench's UI but they are not integrated into the perspective. -The launcher invokes the open() method of the standalone example. -

- -

Copyright IBM Corporation and others 2000, 2002.  All Rights Reserved.

- - diff --git a/examples/org.eclipse.swt.examples/doc-html/swt_layout_ex.html b/examples/org.eclipse.swt.examples/doc-html/swt_layout_ex.html deleted file mode 100644 index 51dced6386..0000000000 --- a/examples/org.eclipse.swt.examples/doc-html/swt_layout_ex.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - SWT - Layout Example - - - -

SWT Standalone Example - Layout Example

- -

-This example is a simple demonstration of common SWT layouts. -It consists of a tab folder where each tab in the folder allows the -user to interact with a different SWT layout. -The user can insert widgets into a layout and set the values of the layout data -using a property sheet. When the user has a suitable arrangement, code can be -generated by clicking on the Code button. -

- -

Running the example

-

-Follow the Manual Setup -instructions to install and run the example from your workspace. -

-

-The "Main" class is org.eclipse.swt.examples.layoutexample.LayoutExample. -

- -

Copyright IBM Corporation and others 2000, 2002.  All Rights Reserved.

- - \ No newline at end of file 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 9f36ca2756..0000000000 --- a/examples/org.eclipse.swt.examples/doc-html/swt_manual_setup.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - - SWT Standalone Examples Setup - - - -

SWT Standalone Examples Setup

- -

Importing Example Source

- -

-*** In the following description, substitute the location in which you installed Eclipse for INSTALLDIR *** -

- -

Import the example code and all its required resources into your workspace:

- -
    -
  1. Create a Java Project called "SWT Examples". -
  2. Select the project "SWT Examples" in the Packages view. -
  3. Select the File --> Import menu. Select Zip File. Click on Next. -
  4. Locate the source zip file for the SWT examples. For example: -
      -
    • win32: INSTALLDIR\eclipse\plugins\org.eclipse.swt.examples_2.0.0\swtexamplessrc.zip -
    • *nix: INSTALLDIR/eclipse/plugins/org.eclipse.swt.examples_2.0.0/swtexamplessrc.zip -
    -
  5. Click on Finish. -
  6. Select the File --> Import menu. In the Import dialog, select Zip File. Click on Next. -
  7. Locate the jar file for the SWT examples. For example: -
      -
    • win32: INSTALLDIR\eclipse\plugins\org.eclipse.swt.examples_2.0.0\swtexamples.jar -
    • *nix: INSTALLDIR/eclipse/plugins/org.eclipse.swt.examples_2.0.0/swtexamples.jar -
    -
  8. Expand the top level directory of the zip file (/). Uncheck "org" and "META-INF". -
  9. Click on Finish. -
- -

Now you need to compile the SWT examples. In order to do this, you must add the SWT jar(s) to -the compile path:

-
    -
  1. Select the project "SWT Examples" in the Packages view and from the pop up menu select Properties. -
  2. Select the Java Build Path item. -
  3. Go to the Libraries tab. -
  4. Click on the Add External JARS... button. -
  5. Locate the swt jar for the platform on which you wish to run:
    -
      -
    • win32: INSTALLDIR\eclipse\plugins\org.eclipse.swt.win32_2.0.0\ws\win32\swt.jar -
    • gtk: INSTALLDIR/eclipse/plugins/org.eclipse.swt.gtk_2.0.0/ws/gtk/swt.jar -
    • motif: INSTALLDIR/eclipse/plugins/org.eclipse.swt.motif_2.0.0/ws/motif/swt.jar -
    • photon: INSTALLDIR/eclipse/plugins/org.eclipse.swt.photon_2.0.0/ws/photon/swt.jar -
    • macosx: INSTALLDIR/eclipse/plugins/org.eclipse.swt.carbon_2.0.0/ws/carbon/swt.jar -
    -
  6. Click on OK. -
-

NOTE: For some platforms (such as GTK), more than one jar is required to run SWT (on -GTK there is a swt.jar and a swt-pi.jar file). In this case, all the required jars must -be added to the class path. This is done by repeating the steps above for each jar file. -All jar files are located in the same directory/folder.

- -

At this point your SWT examples should be compiled without any errors. Check the Task -view for errors. If you get an error like "java.lang.Object not found" it means -you have not configured a JRE. Go to the Window --> Preferences dialog. -Select Java --> Installed JREs and ensure that a JRE is installed -and that the path to the JRE is correct.

- -

Running the Example

- -

Now you have to configure Eclipse to run the example. This requires putting the SWT -JNI libraries on the library path so that the VM can find them: - -

    -
  1. Open the Java Perspective. -
  2. In the Packages view, select the Main class that you want to run. - For example, the Main class for the Address Book example is -     org.eclipse.swt.examples.addressbook.AddressBook. -
  3. SelectRun --> Run... from the main menu. -
  4. In the Launch Configurations dialog that appears, select Java Application and click - on the New button. -
  5. Fill in the Name, Project and Main class fields according to the example you wish to run. -
  6. Select the Arguments tab. In the VM Arguements area specify the location of the SWT - library depending on your target platform as follows: -
      -
    • win32: -Djava.library.path=INSTALLDIR\plugins\org.eclipse.swt.win32_2.0.0\os\win32\x86 -
    • linux gtk: -Djava.library.path=INSTALLDIR/eclipse/plugins/org.eclipse.swt.gtk_2.0.0/os/linux/x86 -
    • linux motif: -Djava.library.path=INSTALLDIR/eclipse/plugins/org.eclipse.swt.motif_2.0.0/os/linux/x86 -
    • solaris motif: -Djava.library.path=INSTALLDIR/eclipse/plugins/org.eclipse.swt.motif_2.0.0/os/solaris/sparc -
    • aix motif: -Djava.library.path=INSTALLDIR/eclipse/plugins/org.eclipse.swt.motif_2.0.0/os/aix/ppc -
    • hpux motif: -Djava.library.path=INSTALLDIR/eclipse/plugins/org.eclipse.swt.motif_2.0.0/os/hpux/PA_RISC -
    • photon qnx: -Djava.library.path=INSTALLDIR/eclipse/plugins/org.eclipse.swt.photon_2.0.0/os/qnx/x86 -
    • macosx: -Djava.library.path=INSTALLDIR/eclipse/plugins/org.eclipse.swt.carbon_2.0.0/os/macosx/ppc -
    -
  7. Click on the Run button. -
- - -

Examples Overview

-

-Consult the documentation of each individual example for the names of -its Main class and additional details. -

-

-The following examples are included in the swtexamples.jar: -

- - -


Copyright IBM Corporation and others 2000, 2002.  All Rights Reserved. - - 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 3d5571b25f..0000000000 --- a/examples/org.eclipse.swt.examples/doc-html/swt_texteditor_ex.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - SWT - Text Editor Example - - - -

SWT Standalone Example - Text Editor

- -

-This example demonstrates how to use the StyledText widget to implement -a text editor with formatting support. -The example has a typical text editor interface. -The Edit 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. -

- -

Running the example

-

-Follow the Manual Setup -instructions to install and run the example from your workspace. -

-

-The "Main" class is org.eclipse.swt.examples.texteditor.TextEditor. -

-

-This example can also be run using the Example Launcher. -Select the Text Editor item from the Standalone category and click Run. -

- -

Copyright IBM Corporation and others 2000, 2002.  All Rights Reserved.

- - diff --git a/examples/org.eclipse.swt.examples/plugin.properties b/examples/org.eclipse.swt.examples/plugin.properties deleted file mode 100755 index 6382611aed..0000000000 --- a/examples/org.eclipse.swt.examples/plugin.properties +++ /dev/null @@ -1,113 +0,0 @@ -providerName = Eclipse.org -plugin.SWTStandaloneExampleSet.name = SWT Standalone Examples Plugin - -launchcategory.SWTStandaloneExamples.name = Standalone -launchcategory.SWTStandaloneExamples.description = \ - A collection of Standard Widget Toolkit examples that run independant \ - of the Eclipse Platform. - -launchitem.AddressBook.name = Address Book -launchitem.AddressBook.description = \ - The AddressBook example shows how the Table control can be used to \ - present information in a tabular format.\n\n\ - The application can save and load data from a file, sort the entries, and \ - search for strings within the fields. - -launchitem.ControlExample.name = SWT Controls Example -launchitem.ControlExample.description = \ - The Controls example is a simple demonstration of common SWT controls. \n\n\ - It consists of a tab folder where each tab in the folder allows the user \ - to interact with a different control. \ - The user can change styles and settings and view how this affects the control. - -launchitem.FileViewer.name = File Viewer -launchitem.FileViewer.description = \ - The File Viewer example shows how a simple application can be implemented using SWT.\n\n\ - This application provides the ability to navigate files and folders and manipulate them via Drag and Drop. \ - It includes the use of alternate threads for long actions and demonstrates the use of the Tree, \ - Table, Toolbar and Program. - -launchitem.HoverHelp.name = Hover Help -launchitem.HoverHelp.description = \ - 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.\n\n\ - The example implements its own tooltip and hover help support. \ - To see the custom tooltips in action, hover over an item or button in the UI. \ - An image appears in the left-hand corner of the tooltip.\n\n\ - To see the custom hover help in action, hover over an item or button in the UI until \ - the tooltip is displayed. Without moving the mouse, hit F1. A new Shell will pop up with the \ - extended hover help information for the UI element in question - -launchitem.HelloWorld1.name = Hello World (1) -launchitem.HelloWorld1.description = \ - This example demonstrates how to open a Shell and process the events. - -launchitem.HelloWorld2.name = Hello World (2) -launchitem.HelloWorld2.description = \ - This example builds on HelloWorld1 and demonstrates how to display a Label inside the Shell. - -launchitem.HelloWorld3.name = Hello World (3) -launchitem.HelloWorld3.description = \ - This example builds on HelloWorld2 and demonstrates how to resize the Label \ - when the Shell resizes using a Listener mechanism. - -launchitem.HelloWorld4.name = Hello World (4) -launchitem.HelloWorld4.description = \ - This example builds on HelloWorld2 and demonstrates how to resize the Label \ - when the Shell resizes using a Layout. - -launchitem.HelloWorld5.name = Hello World (5) -launchitem.HelloWorld5.description = \ - This example builds on HelloWorld1 and demonstrates how to draw directly on an SWT Control using a graphic context. - -launchitem.ImageAnalyzer.name = Image Analyzer -launchitem.ImageAnalyzer.description = \ - The ImageAnalyzer opens image files and displays the visual contents of the file along with a \ - summary of the data in the image file.\n\n\ - 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.\n\n\ - The ImageAnalyzer will load and display image files of type GIF, JPEG, BMP, ICO, and PNG. \ - To open a file, use the File->Open... menu item, and select the image file in the FileDialog.\n\n\ - 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.\n\n\ - 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. If a GIF defines a background color, \ - as many animated GIFs do, selecting Background will use the GIF's background color.\n\n\ - 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. You can change the background color of the ImageAnalyzer to see the transparency work. \ - To turn off the transparency, deselect Display Transparency.\n\n\ - 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.\n\n\ - File->Save As... can be used to save the currently loaded image to another type of image file. If the image has transparency, \ - File->Save Mask As... saves the image's transparency mask.\n\n\ - When SWT loads an image file, an instance of org.eclipse.swt.graphics.ImageData is created. (In the case of an ICO file or \ - multi-image GIF, an array of ImageData instances is created). The ImageAnalyzer displays all of the data stored in the ImageData \ - instance(s) for the currently loaded image file, including the pixel data. Hovering over a pixel in the image display will show the RGB \ - color data for that pixel. For certain images (particularly animated GIFs) additional data is stored in the org.eclipse.swt.graphics.ImageLoader \ - instance used to load the image. The ImageAnalyzer displays this data as well. - -launchitem.JavaViewer.name = Java Syntax Viewer -launchitem.JavaViewer.description = \ - This example demonstrates how to implement a user-defined line styler for the StyledText widget.\n\n\ - The example provides a typical editor interface. \ - To see the effect of the line styler, open a *.java file. \ - When the contents of the file are displayed in the editor area, notice that the keywords have been highlighted. - -launchitem.LayoutExample.name = Layout Example -launchitem.LayoutExample.description = \ - This example is a simple demonstration of common SWT layouts. \n\n\ - It consists of a tab folder where each tab in the folder allows the \ - user to interact with a different SWT layout. \ - The user can insert widgets into a layout and set the values of the layout data \ - using a property sheet. When the user has a suitable arrangement, code can be \ - generated by clicking on the Code button. - -launchitem.TextEditor.name = Text Editor -launchitem.TextEditor.description = \ - This example demonstrates how to use the StyledText widget to implement \ - a text editor with formatting support.\n\n\ - The example has a typical text editor interface. \ - The Edit 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. - \ No newline at end of file diff --git a/examples/org.eclipse.swt.examples/plugin.xml b/examples/org.eclipse.swt.examples/plugin.xml deleted file mode 100755 index 3562e1fc6d..0000000000 --- a/examples/org.eclipse.swt.examples/plugin.xml +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/org.eclipse.swt.examples/src/examples_addressbook.properties b/examples/org.eclipse.swt.examples/src/examples_addressbook.properties deleted file mode 100644 index b416bed826..0000000000 --- a/examples/org.eclipse.swt.examples/src/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/src/examples_control.properties b/examples/org.eclipse.swt.examples/src/examples_control.properties deleted file mode 100644 index d7d3a6640a..0000000000 --- a/examples/org.eclipse.swt.examples/src/examples_control.properties +++ /dev/null @@ -1,139 +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 -Item_Styles = Item Styles -Dialog_Result = Dialog Result -ColorDialog = ColorDialog -DirectoryDialog = DirectoryDialog -FileDialog = FileDialog -FontDialog = FontDialog -PrintDialog = PrintDialog -MessageBox = MessageBox -Multi_line = A multi line text widget. -Example_string = The quick brown fox jumps over the lazy dog. -Header_Visible = Header Visible -Lines_Visible = Lines Visible -Locked = Locked -Node_1 = Node 1 -Node_2 = Node 2 -Node_3 = Node 3 -Node_4 = Node 4 -Node_1_1 = Node 1.1 -Node_2_1 = Node 2.1 -Node_3_1 = Node 3.1 -Node_2_2 = Node 2.2 -Node_2_2_1 = Node 2.2.1 -Parent = Parent -No_Parent = No Parent -Decoration_Styles = Decoration Styles -Create_Shell = Create Shell -Close_All_Shells = Close All Shells -Push = Push -Radio = Radio -Check = Check -Drop_Down = Drop Down -Images_failed = Warning: Failed to load images -readme_txt = readme.txt -Index = Index: -Title = Title: -Close = Close -Result = Result: {0} -FilterName_0 = Text Files -FilterName_1 = Batch Files -FilterName_2 = Doc Files -TableTitle_0 = Name -TableTitle_1 = Type -TableTitle_2 = Size -TableTitle_3 = Modified -TableLine0_0 = -TableLine0_1 = classes -TableLine0_2 = 0 -TableLine0_3 = today -TableLine1_0 = -TableLine1_1 = databases -TableLine1_2 = 2556 -TableLine1_3 = -TableLine2_0 = -TableLine2_1 = images -TableLine2_2 = 91571 -TableLine2_3 = yesterday -ListData0_0 = Line 1 -ListData0_1 = Line 2 -ListData0_2 = Line 3 -ListData0_3 = Line 4 -ListData0_4 = Line 5 -ListData0_5 = Line 6 -ListData0_6 = Line 7 -ListData0_7 = Line 8 -ListData0_8 = Longest Line In List -ListData1_0 = Apples -ListData1_1 = Oranges -ListData1_2 = Bananas -ListData1_3 = Grapefruit -ListData1_4 = Peaches -ListData1_5 = Kiwi -ListData1_6 = Apricots -ListData1_7 = Strawberries -ListData1_8 = The Longest String -DropDownData_0 = Apples -DropDownData_1 = Oranges -DropDownData_2 = -DropDownData_3 = Grapefruit -DropDownData_4 = Peaches -DropDownData_5 = Kiwi -DropDownData_6 = -DropDownData_7 = Strawberries -DropDownData_8 = The Longest String -Slider_and_Scale = Slider and Scale -Colors = Colors and Font -Table_Item_Colors = Index:0 Table Item Colors -Background_Color = Background Color -Foreground_Color = Foreground Color -Item_Background_Color = Item Background Color -Item_Foreground_Color = Item Foreground Color -Font = Set Font -Wrap_Text = Jack and Jill went up the hill to fetch a pail of water, \ - Jack fell down and broke his crown and Jill came tumbling after! -Foreground_Style = Foreground Style -Background_Style = Background Style -StyledText_Styles = StyledText Styles -StyledText_Style_Instructions = Select text, then style. -Bold = Bold -Fill = Horizontal Fill diff --git a/examples/org.eclipse.swt.examples/src/examples_fileviewer.properties b/examples/org.eclipse.swt.examples/src/examples_fileviewer.properties deleted file mode 100644 index 3fc373efdf..0000000000 --- a/examples/org.eclipse.swt.examples/src/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/src/examples_helloworld.properties b/examples/org.eclipse.swt.examples/src/examples_helloworld.properties deleted file mode 100644 index 2db6671c37..0000000000 --- a/examples/org.eclipse.swt.examples/src/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/src/examples_hoverhelp.properties b/examples/org.eclipse.swt.examples/src/examples_hoverhelp.properties deleted file mode 100644 index b1e118e3fa..0000000000 --- a/examples/org.eclipse.swt.examples/src/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/src/examples_images.properties b/examples/org.eclipse.swt.examples/src/examples_images.properties deleted file mode 100644 index 3f1d7b7384..0000000000 --- a/examples/org.eclipse.swt.examples/src/examples_images.properties +++ /dev/null @@ -1,101 +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} -Time_to_load_initial = Time to load: -Time_to_load_value = Time to load: {0} ms -Animation_size_initial = Animation size: -Animation_size_value = Animation size: {0,number,integer} x {1,number,integer} -Background_pixel_initial = Background pixel: -Background_pixel_value = Background pixel: {0} -Image_location_initial = Image location: -Image_location_value = Image location: ({0,number,integer}, {1,number,integer}) -Disposal_initial = Disposal: -Disposal_value = Disposal: {0,number,integer} ({1}) -Delay_initial = Delay: -Delay_value = Delay: {0,number,integer} ms (using {1,number,integer} ms) -Delay_used = Delay: {0,number,integer} ms -Repeats_initial = Repeats: -Repeats_value = Repeats: {0,number,integer} -Repeats_forever = Repeats: {0,number,integer} (forever) -Palette_initial = Palette: -Palette_direct = Palette: Direct -Palette_value = Palette size: {0,number,integer} -Pixel_data_initial = Pixel data: -Pixel_data_value = Pixel data: Bytes per line: {0,number,integer} \ - Scanline pad: {1,number,integer} {2} -File = &File -OpenFile = &Open File...\tCtrl+O -OpenURL = Open &URL...\tCtrl+U -Reopen = &Reopen -Save = &Save\tCtrl+S -Save_as = Save &As... -Save_mask_as = Save &Mask As... -Print = &Print\tCtrl+P -Exit = E&xit -Alpha = Alpha -OpenURLDialog = Open URL -EnterURL = Enter the URL for an image (bmp, gif, ico, jpg, jpeg, png): -All_images = All Image Files -Loading_lc = loading -Saving_lc = saving -Unknown_extension = Unknown file extension: {0}\nPlease use bmp, gif, ico, \ - jpg, jpeg, or png. -Overwrite = Overwrite {0}? -Analyzer_on = Image Analyzer on: {0} -Reloading_lc = reloading -Color_at = Image color at ({0,number,integer}, {1,number,integer}) \ - index {2,number,integer} (0x{3}) is {4} -Color_at_trans = Image color at ({0,number,integer}, {1,number,integer}) \ - index {2,number,integer} (0x{3}) is {4} (transparent) -Creating_image = Creating image # {0,number,integer} from -OK = OK -Cancel = Cancel -Stop = &Stop -Creating_from = Creating image read from -Palette_direct = Palette: Direct -Palette_size = Palette size: {0,number,integer} -Bytes_per_line = Bytes per line: -Scanline_pad = Scanline pad: -Printing_error = Printing error: -Error = Error {0} file\n{1}\n\n -Pixels_per_byte = pixels per byte -Byte_per_pixel = byte per pixel -Bytes_per_pixel = bytes per pixel -Unsupported_lc = unsupported -None_lc = none -Background_lc = background -Previous_lc = previous -Unspecified_lc = unspecified -Unknown_ac = UNKNOWN -Forever_lc = forever -Depth_info = Depth: {0,number,integer} -- {1} -One_byte = 1 byte per pixel -Multi_bytes = {0,number,integer} bytes per pixel -Multi_pixels = {0,number,integer} pixels per byte {1} -Max_length_string = Transparent pixel: -1 (none) \ No newline at end of file diff --git a/examples/org.eclipse.swt.examples/src/examples_javaviewer.properties b/examples/org.eclipse.swt.examples/src/examples_javaviewer.properties deleted file mode 100644 index 8c589d1470..0000000000 --- a/examples/org.eclipse.swt.examples/src/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/src/examples_layout.properties b/examples/org.eclipse.swt.examples/src/examples_layout.properties deleted file mode 100644 index 5861297461..0000000000 --- a/examples/org.eclipse.swt.examples/src/examples_layout.properties +++ /dev/null @@ -1,41 +0,0 @@ -window.title = SWT Layouts - -Add = &Add -Delete = &Delete -Clear = &Clear -Children = Children -Type = Type -Layout = Layout -Preferred_Size = Preferred Size -Code = C&ode -Generated_Code = Generated Code -Parameters = Parameters -Properties = Properties -Margins = Margins -Margins_Spacing = Margins and Spacing -Columns = Columns -Attach_Edit = Edit -Left_Attachment = Edit Left Attachment -Right_Attachment = Edit Right Attachment -Top_Attachment = Edit Top Attachment -Bottom_Attachment = Edit Bottom Attachment -Position = Position -Control = Control -Offset = Offset [+/-] -Item = Item {0} -Combo_Index = Combo {0} -Group_Index = Group {0} -Label_Index = Label {0} -Button_Index = Button {0} -StyledText_Index = StyledText {0} -Text_Index = Text {0} -OK = OK -Cancel = Cancel -Edit = &Edit -Select_All = Select &All\tCtrl+A -Copy = &Copy\tCtrl+C -Exit = E&xit -Name_Title = Enter Names -Name_Label = Enter names for your controls -Invalid_Name = Invalid Name - Please enter valid variable names for your controls -Default = Default \ No newline at end of file diff --git a/examples/org.eclipse.swt.examples/src/examples_texteditor.properties b/examples/org.eclipse.swt.examples/src/examples_texteditor.properties deleted file mode 100644 index e53ce09e38..0000000000 --- a/examples/org.eclipse.swt.examples/src/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/src/import.properties b/examples/org.eclipse.swt.examples/src/import.properties deleted file mode 100644 index 97c82204c2..0000000000 --- a/examples/org.eclipse.swt.examples/src/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 = <> -vmargs.org/eclipse/swt/examples/addressbook/AddressBook.java%AddressBook = "-Djava.library.path=<>" -vmargs.org/eclipse/swt/examples/controlexample/ControlExample.java%ControlExample = "-Djava.library.path=<>" -vmargs.org/eclipse/swt/examples/fileviewer/FileViewer.java%FileViewer = "-Djava.library.path=<>" -vmargs.org/eclipse/swt/examples/helloworld/HelloWorld1.java%HelloWorld1 = "-Djava.library.path=<>" -vmargs.org/eclipse/swt/examples/helloworld/HelloWorld2.java%HelloWorld2 = "-Djava.library.path=<>" -vmargs.org/eclipse/swt/examples/helloworld/HelloWorld3.java%HelloWorld3 = "-Djava.library.path=<>" -vmargs.org/eclipse/swt/examples/helloworld/HelloWorld4.java%HelloWorld4 = "-Djava.library.path=<>" -vmargs.org/eclipse/swt/examples/helloworld/HelloWorld5.java%HelloWorld5 = "-Djava.library.path=<>" -vmargs.org/eclipse/swt/examples/hoverhelp/HoverHelp.java%HoverHelp = "-Djava.library.path=<>" -vmargs.org/eclipse/swt/examples/imageanalyzer/ImageAnalyzer.java%ImageAnalyzer = "-Djava.library.path=<>" -vmargs.org/eclipse/swt/examples/javaviewer/JavaViewer.java%JavaViewer = "-Djava.library.path=<>" -vmargs.org/eclipse/swt/examples/texteditor/TextEditor.java%TextEditor = "-Djava.library.path=<>" diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/AddressBook.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/AddressBook.java deleted file mode 100755 index 33697edfdf..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/AddressBook.java +++ /dev/null @@ -1,857 +0,0 @@ -package org.eclipse.swt.examples.addressbook; - -/* - * Copyright (c) 2000, 2002 IBM Corp. All rights reserved. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -/* Imports */ -import java.io.*; -import java.util.*; - -import org.eclipse.swt.*; -import org.eclipse.swt.events.*; -import org.eclipse.swt.graphics.*; -import org.eclipse.swt.layout.*; -import org.eclipse.swt.widgets.*; - -/** - * AddressBookExample is an example that uses org.eclipse.swt - * libraries to implement a simple address book. This application has - * save, load, sorting, and searching functions common - * to basic address books. - */ -public class AddressBook { - - private static ResourceBundle resAddressBook = ResourceBundle.getBundle("examples_addressbook"); - private Shell shell; - - private Table table; - private SearchDialog searchDialog; - - private File file; - private boolean isModified; - - private String[] copyBuffer; - - private static final String DELIMITER = "\t"; - private static final String[] columnNames = {resAddressBook.getString("Last_name"), - resAddressBook.getString("First_name"), - resAddressBook.getString("Business_phone"), - resAddressBook.getString("Home_phone"), - resAddressBook.getString("Email"), - resAddressBook.getString("Fax")}; - -public static void main(String[] args) { - Display display = new Display(); - AddressBook application = new AddressBook(); - Shell shell = application.open(display); - while(!shell.isDisposed()){ - if(!display.readAndDispatch()) - display.sleep(); - } - display.dispose(); -} -public Shell open(Display display) { - shell = new Shell(display); - shell.setLayout(new FillLayout()); - shell.addShellListener(new ShellAdapter() { - public void shellClosed(ShellEvent e) { - e.doit = closeAddressBook(); - } - }); - - createMenuBar(); - - searchDialog = new SearchDialog(shell); - searchDialog.setSearchAreaNames(columnNames); - searchDialog.setSearchAreaLabel(resAddressBook.getString("Column")); - searchDialog.addFindListener(new FindListener () { - public boolean find() { - return findEntry(); - } - }); - - table = new Table(shell, SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION); - table.setHeaderVisible(true); - table.setMenu(createPopUpMenu()); - table.addSelectionListener(new SelectionAdapter() { - public void widgetDefaultSelected(SelectionEvent e) { - TableItem[] items = table.getSelection(); - if (items.length > 0) editEntry(items[0]); - } - }); - for(int i = 0; i < columnNames.length; i++) { - TableColumn column = new TableColumn(table, SWT.NONE); - column.setText(columnNames[i]); - column.setWidth(150); - final int columnIndex = i; - column.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - sort(columnIndex); - } - }); - } - - newAddressBook(); - - shell.setSize(table.computeSize(SWT.DEFAULT, SWT.DEFAULT).x, 300); - shell.open(); - return shell; -} - -private boolean closeAddressBook() { - if(isModified) { - //ask user if they want to save current address book - MessageBox box = new MessageBox(shell, SWT.ICON_WARNING | SWT.YES | SWT.NO | SWT.CANCEL); - box.setText(shell.getText()); - box.setMessage(resAddressBook.getString("Close_save")); - - int choice = box.open(); - if(choice == SWT.CANCEL) { - return false; - } else if(choice == SWT.YES) { - if (!save()) return false; - } - } - - TableItem[] items = table.getItems(); - for (int i = 0; i < items.length; i ++) { - items[i].dispose(); - } - - return true; -} -/** - * Creates the menu at the top of the shell where most - * of the programs functionality is accessed. - * - * @return The Menu widget that was created - */ -private Menu createMenuBar() { - Menu menuBar = new Menu(shell, SWT.BAR); - shell.setMenuBar(menuBar); - - //create each header and subMenu for the menuBar - createFileMenu(menuBar); - createEditMenu(menuBar); - createSearchMenu(menuBar); - createHelpMenu(menuBar); - - return menuBar; -} - -/** - * Converts an encoded String to a String array representing a table entry. - */ -private String[] decodeLine(String line) { - if(line == null) return null; - - String[] parsedLine = new String[table.getColumnCount()]; - for(int i = 0; i < parsedLine.length - 1; i++) { - 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; -} -private void newAddressBook() { - shell.setText(resAddressBook.getString("Title_bar") + resAddressBook.getString("New_title")); - file = null; - isModified = false; -} -private void newEntry() { - DataEntryDialog dialog = new DataEntryDialog(shell); - dialog.setLabels(columnNames); - String[] data = dialog.open(); - if (data != null) { - TableItem item = new TableItem(table, SWT.NONE); - item.setText(data); - isModified = true; - } -} - -private void openAddressBook() { - FileDialog fileDialog = new FileDialog(shell, SWT.OPEN); - - fileDialog.setFilterExtensions(new String[] {"*.adr;", "*.*"}); - fileDialog.setFilterNames(new String[] {resAddressBook.getString("Book_filter_name") + " (*.adr)", - resAddressBook.getString("All_filter_name") + " (*.*)"}); - 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]); - } - - Arrays.sort(tableInfo, new RowComparator(0)); - - for (int i = 0; i < tableInfo.length; i++) { - TableItem item = new TableItem(table, SWT.NONE); - item.setText(tableInfo[i]); - } - shell.setText(resAddressBook.getString("Title_bar")+fileDialog.getFileName()); - isModified = false; - this.file = file; -} -private boolean save() { - if(file == null) return saveAs(); - - Cursor waitCursor = new Cursor(shell.getDisplay(), SWT.CURSOR_WAIT); - shell.setCursor(waitCursor); - - TableItem[] items = table.getItems(); - String[] lines = new String[items.length]; - for(int i = 0; i < items.length; i++) { - String[] itemText = new String[table.getColumnCount()]; - for (int j = 0; j < itemText.length; j++) { - itemText[j] = items[i].getText(j); - } - lines[i] = encodeLine(itemText); - } - - FileWriter fileWriter = null; - try { - fileWriter = new FileWriter(file.getAbsolutePath(), false); - for (int i = 0; i < lines.length; i++) { - fileWriter.write(lines[i]); - } - } catch(FileNotFoundException e) { - displayError(resAddressBook.getString("File_not_found") + "\n" + file.getName()); - return false; - } catch(IOException e ) { - displayError(resAddressBook.getString("IO_error_write") + "\n" + file.getName()); - return false; - } finally { - shell.setCursor(null); - waitCursor.dispose(); - - if(fileWriter != null) { - try { - fileWriter.close(); - } catch(IOException e) { - displayError(resAddressBook.getString("IO_error_close") + "\n" + file.getName()); - return false; - } - } - } - - shell.setText(resAddressBook.getString("Title_bar")+file.getName()); - isModified = false; - return true; -} -private boolean saveAs() { - - FileDialog saveDialog = new FileDialog(shell, SWT.SAVE); - saveDialog.setFilterExtensions(new String[] {"*.adr;", "*.*"}); - saveDialog.setFilterNames(new String[] {"Address Books (*.adr)", "All Files "}); - - saveDialog.open(); - String name = saveDialog.getFileName(); - - if(name.equals("")) return false; - - if(name.indexOf(".adr") != name.length() - 4) { - name += ".adr"; - } - - File file = new File(saveDialog.getFilterPath(), name); - if(file.exists()) { - MessageBox box = new MessageBox(shell, SWT.ICON_WARNING | SWT.YES | SWT.NO); - box.setText(resAddressBook.getString("Save_as_title")); - box.setMessage(resAddressBook.getString("File") + file.getName()+" "+resAddressBook.getString("Query_overwrite")); - if(box.open() != SWT.YES) { - return false; - } - } - this.file = file; - return save(); -} -private void sort(int column) { - if(table.getItemCount() <= 1) return; - - TableItem[] items = table.getItems(); - String[][] data = new String[items.length][table.getColumnCount()]; - for(int i = 0; i < items.length; i++) { - for(int j = 0; j < table.getColumnCount(); j++) { - data[i][j] = items[i].getText(j); - } - } - - Arrays.sort(data, new RowComparator(column)); - - 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 Menu that file contain - * the File submenu. - */ -private void createFileMenu(Menu menuBar) { - //File menu. - MenuItem item = new MenuItem(menuBar, SWT.CASCADE); - item.setText(resAddressBook.getString("File_menu_title")); - Menu menu = new Menu(shell, SWT.DROP_DOWN); - item.setMenu(menu); - /** - * Adds a listener to handle enabling and disabling - * some items in the Edit submenu. - */ - menu.addMenuListener(new MenuAdapter() { - public void menuShown(MenuEvent e) { - Menu menu = (Menu)e.widget; - MenuItem[] items = menu.getItems(); - items[1].setEnabled(table.getSelectionCount() != 0); // edit contact - items[5].setEnabled((file != null) && isModified); // save - items[6].setEnabled(table.getItemCount() != 0); // save as - } - }); - - - //File -> New Contact - MenuItem subItem = new MenuItem(menu, SWT.NULL); - subItem.setText(resAddressBook.getString("New_contact")); - subItem.setAccelerator(SWT.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 Menu that file contain - * the Edit submenu. - * - * @see #createSortMenu() - */ -private MenuItem createEditMenu(Menu menuBar) { - //Edit menu. - MenuItem item = new MenuItem(menuBar, SWT.CASCADE); - item.setText(resAddressBook.getString("Edit_menu_title")); - Menu menu = new Menu(shell, SWT.DROP_DOWN); - item.setMenu(menu); - - /** - * Add a listener to handle enabling and disabling - * some items in the Edit submenu. - */ - menu.addMenuListener(new MenuAdapter() { - public void menuShown(MenuEvent e) { - Menu menu = (Menu)e.widget; - MenuItem[] items = menu.getItems(); - int count = table.getSelectionCount(); - items[0].setEnabled(count != 0); // edit - items[1].setEnabled(count != 0); // copy - items[2].setEnabled(copyBuffer != null); // paste - items[3].setEnabled(count != 0); // delete - items[5].setEnabled(table.getItemCount() != 0); // sort - } - }); - - //Edit -> Edit - MenuItem subItem = new MenuItem(menu, SWT.CASCADE); - subItem.setText(resAddressBook.getString("Edit")); - subItem.setAccelerator(SWT.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 Menu that file contain - * the Search submenu. - */ -private void createSearchMenu(Menu menuBar) { - //Search menu. - MenuItem item = new MenuItem(menuBar, SWT.CASCADE); - item.setText(resAddressBook.getString("Search_menu_title")); - Menu searchMenu = new Menu(shell, SWT.DROP_DOWN); - item.setMenu(searchMenu); - - //Search -> Find... - item = new MenuItem(searchMenu, SWT.NULL); - item.setText(resAddressBook.getString("Find")); - item.setAccelerator(SWT.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 Menu that file contain - * the Help submenu. - */ -private void createHelpMenu(Menu menuBar) { - - //Help Menu - MenuItem item = new MenuItem(menuBar, SWT.CASCADE); - item.setText(resAddressBook.getString("Help_menu_title")); - Menu menu = new Menu(shell, SWT.DROP_DOWN); - item.setMenu(menu); - - //Help -> About Text Editor - MenuItem subItem = new MenuItem(menu, SWT.NULL); - subItem.setText(resAddressBook.getString("About")); - subItem.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - MessageBox box = new MessageBox(shell, SWT.NONE); - box.setText(resAddressBook.getString("About_1") + shell.getText()); - box.setMessage(shell.getText() + resAddressBook.getString("About_2")); - box.open(); - } - }); -} - -/** - * To compare entries (rows) by the given column - */ -private class RowComparator implements Comparator { - private int column; - - /** - * Constructs a RowComparator given the column index - * @param col The index (starting at zero) of the column - */ - public RowComparator(int col) { - column = col; - } - - /** - * Compares two rows (type String[]) using the specified - * column entry. - * @param obj1 First row to compare - * @param obj2 Second row to compare - * @return negative if obj1 less than obj2, positive if - * obj1 greater than obj2, and zero if equal. - */ - public int compare(Object obj1, Object obj2) { - String[] row1 = (String[])obj1; - String[] row2 = (String[])obj2; - - return row1[column].compareTo(row2[column]); - } -} -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/DataEntryDialog.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/DataEntryDialog.java deleted file mode 100755 index 6be9f908bc..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/DataEntryDialog.java +++ /dev/null @@ -1,159 +0,0 @@ -package org.eclipse.swt.examples.addressbook; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -/* Imports */ -import org.eclipse.swt.*; -import org.eclipse.swt.events.*; -import org.eclipse.swt.layout.*; -import org.eclipse.swt.widgets.*; -import java.util.ResourceBundle; - -/** - * DataEntryDialog class uses org.eclipse.swt - * libraries to implement a dialog that accepts basic personal information that - * is added to a Table widget or edits a TableItem entry - * to represent the entered data. - */ -public class DataEntryDialog { - - private static ResourceBundle resAddressBook = ResourceBundle.getBundle("examples_addressbook"); - - Shell shell; - String[] values; - String[] labels; - -public DataEntryDialog(Shell parent) { - shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.PRIMARY_MODAL); - shell.setLayout(new GridLayout()); -} - -private void addTextListener(final Text text) { - text.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e){ - Integer index = (Integer)(text.getData("index")); - values[index.intValue()] = text.getText(); - } - }); -} -private void createControlButtons() { - Composite composite = new Composite(shell, SWT.NULL); - composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER)); - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - composite.setLayout(layout); - - Button okButton = new Button(composite, SWT.PUSH); - okButton.setText(resAddressBook.getString("OK")); - okButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - shell.close(); - } - }); - - Button cancelButton = new Button(composite, SWT.PUSH); - cancelButton.setText(resAddressBook.getString("Cancel")); - cancelButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - values = null; - shell.close(); - } - }); - - shell.setDefaultButton(okButton); -} - -private void createTextWidgets() { - if (labels == null) return; - - Composite composite = new Composite(shell, SWT.NULL); - composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - GridLayout layout= new GridLayout(); - layout.numColumns = 2; - composite.setLayout(layout); - - if (values == null) - values = new String[labels.length]; - - for (int i = 0; i < labels.length; i++) { - Label label = new Label(composite, SWT.RIGHT); - label.setText(labels[i]); - Text text = new Text(composite, SWT.BORDER); - GridData gridData = new GridData(); - gridData.widthHint = 400; - text.setLayoutData(gridData); - if (values[i] != null) { - text.setText(values[i]); - } - text.setData("index", new Integer(i)); - addTextListener(text); - } -} - -public String[] getLabels() { - return labels; -} -public String getTitle() { - return shell.getText(); -} -/** - * Returns the contents of the Text widgets in the dialog in a - * String array. - * - * @return String[] - * The contents of the text widgets of the dialog. - * May return null if all text widgets are empty. - */ -public String[] getValues() { - return values; -} -/** - * Opens the dialog in the given state. Sets Text widget contents - * and dialog behaviour accordingly. - * - * @param dialogState int - * The state the dialog should be opened in. - */ -public String[] open() { - createTextWidgets(); - createControlButtons(); - shell.pack(); - shell.open(); - Display display = shell.getDisplay(); - while(!shell.isDisposed()){ - if(!display.readAndDispatch()) - display.sleep(); - } - - return getValues(); -} -public void setLabels(String[] labels) { - this.labels = labels; -} -public void setTitle(String title) { - shell.setText(title); -} -/** - * Sets the values of the Text widgets of the dialog to - * the values supplied in the parameter array. - * - * @param itemInfo String[] - * The values to which the dialog contents will be set. - */ -public void setValues(String[] itemInfo) { - if (labels == null) return; - - if (values == null) - values = new String[labels.length]; - - int numItems = Math.min(values.length, itemInfo.length); - for(int i = 0; i < numItems; i++) { - values[i] = itemInfo[i]; - } -} -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/FindListener.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/FindListener.java deleted file mode 100755 index ab0f020fa6..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/FindListener.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.eclipse.swt.examples.addressbook; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -public interface FindListener { - -public boolean find(); - -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/SearchDialog.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/SearchDialog.java deleted file mode 100755 index 4835dc06af..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/SearchDialog.java +++ /dev/null @@ -1,198 +0,0 @@ -package org.eclipse.swt.examples.addressbook; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -/* Imports */ -import org.eclipse.swt.*; -import org.eclipse.swt.widgets.*; -import org.eclipse.swt.layout.*; -import org.eclipse.swt.events.*; -import java.util.ResourceBundle; - -/** - * SearchDialog is a simple class that uses org.eclipse.swt - * libraries to implement a basic search dialog. - */ -public class SearchDialog { - - private static ResourceBundle resAddressBook = ResourceBundle.getBundle("examples_addressbook"); - - Shell shell; - Text searchText; - Combo searchArea; - Label searchAreaLabel; - Button matchCase; - Button matchWord; - Button findButton; - Button down; - FindListener findHandler; - -/** - * Class constructor that sets the parent shell and the table widget that - * the dialog will search. - * - * @param parent Shell - * The shell that is the parent of the dialog. - */ -public SearchDialog(Shell parent) { - shell = new Shell(parent, SWT.CLOSE | SWT.BORDER | SWT.TITLE); - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - shell.setLayout(layout); - shell.setText(resAddressBook.getString("Search_dialog_title")); - shell.addShellListener(new ShellAdapter(){ - public void shellClosed(ShellEvent e) { - // don't dispose of the shell, just hide it for later use - e.doit = false; - shell.setVisible(false); - } - }); - - Label label = new Label(shell, SWT.LEFT); - label.setText(resAddressBook.getString("Dialog_find_what")); - searchText = new Text(shell, SWT.BORDER); - GridData gridData = new GridData(GridData.FILL_HORIZONTAL); - gridData.widthHint = 200; - searchText.setLayoutData(gridData); - searchText.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - boolean enableFind = (searchText.getCharCount() != 0); - findButton.setEnabled(enableFind); - } - }); - - searchAreaLabel = new Label(shell, SWT.LEFT); - searchArea = new Combo(shell, SWT.DROP_DOWN | SWT.READ_ONLY); - gridData = new GridData(GridData.FILL_HORIZONTAL); - gridData.widthHint = 200; - searchArea.setLayoutData(gridData); - - matchCase = new Button(shell, SWT.CHECK); - matchCase.setText(resAddressBook.getString("Dialog_match_case")); - gridData = new GridData(); - gridData.horizontalSpan = 2; - matchCase.setLayoutData(gridData); - - matchWord = new Button(shell, SWT.CHECK); - matchWord.setText(resAddressBook.getString("Dialog_match_word")); - gridData = new GridData(); - gridData.horizontalSpan = 2; - matchWord.setLayoutData(gridData); - - Group direction = new Group(shell, SWT.NONE); - gridData = new GridData(); - gridData.horizontalSpan = 2; - direction.setLayoutData(gridData); - direction.setLayout (new FillLayout ()); - direction.setText(resAddressBook.getString("Dialog_direction")); - - Button up = new Button(direction, SWT.RADIO); - up.setText(resAddressBook.getString("Dialog_dir_up")); - up.setSelection(false); - - down = new Button(direction, SWT.RADIO); - down.setText(resAddressBook.getString("Dialog_dir_down")); - down.setSelection(true); - - Composite composite = new Composite(shell, SWT.NONE); - gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - gridData.horizontalSpan = 2; - composite.setLayoutData(gridData); - layout = new GridLayout(); - layout.numColumns = 2; - layout.makeColumnsEqualWidth = true; - composite.setLayout(layout); - - findButton = new Button(composite, SWT.PUSH); - findButton.setText(resAddressBook.getString("Dialog_find")); - findButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); - findButton.setEnabled(false); - findButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - if (!findHandler.find()){ - MessageBox box = new MessageBox(shell, SWT.ICON_INFORMATION | SWT.OK | SWT.PRIMARY_MODAL); - box.setText(shell.getText()); - box.setMessage(resAddressBook.getString("Cannot_find") + "\"" + searchText.getText() + "\""); - box.open(); - } - } - }); - - Button cancelButton = new Button(composite, SWT.PUSH); - cancelButton.setText(resAddressBook.getString("Cancel")); - cancelButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING)); - cancelButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - shell.setVisible(false); - } - }); - - shell.pack(); -} -public String getSearchAreaLabel(String label) { - return searchAreaLabel.getText(); -} - -public String[] getsearchAreaNames() { - return searchArea.getItems(); -} -public boolean getMatchCase() { - return matchCase.getSelection(); -} -public boolean getMatchWord() { - return matchWord.getSelection(); -} -public String getSearchString() { - return searchText.getText(); -} -public boolean getSearchDown(){ - return down.getSelection(); -} -public int getSelectedSearchArea() { - return searchArea.getSelectionIndex(); -} -public void open() { - if (shell.isVisible()) { - shell.setFocus(); - } else { - shell.open(); - } - searchText.setFocus(); -} -public void setSearchAreaNames(String[] names) { - for (int i = 0; i < names.length; i++) { - searchArea.add(names[i]); - } - searchArea.select(0); -} -public void setSearchAreaLabel(String label) { - searchAreaLabel.setText(label); -} -public void setMatchCase(boolean match) { - matchCase.setSelection(match); -} -public void setMatchWord(boolean match) { - matchWord.setSelection(match); -} -public void setSearchDown(boolean searchDown){ - down.setSelection(searchDown); -} -public void setSearchString(String searchString) { - searchText.setText(searchString); -} - -public void setSelectedSearchArea(int index) { - searchArea.select(index); -} -public void addFindListener(FindListener listener) { - this.findHandler = listener; -} -public void removeFindListener(FindListener listener) { - this.findHandler = null; -} -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/AlignableTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/AlignableTab.java deleted file mode 100755 index 0ae087ce9c..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/AlignableTab.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.eclipse.swt.examples.controlexample; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.*; -import org.eclipse.swt.widgets.*; -import org.eclipse.swt.layout.*; -import org.eclipse.swt.events.*; - -/** - * AlignableTab is the abstract - * superclass of example controls that can be - * aligned. - */ -abstract class AlignableTab extends Tab { - - /* Allignment Controls */ - Button leftButton, rightButton, centerButton; - - /* Alignment Group */ - Group allignmentGroup; - - /** - * Creates the Tab within a given instance of ControlExample. - */ - AlignableTab(ControlExample instance) { - super(instance); - } - - /** - * Creates the "Control" group. - */ - void createControlGroup () { - super.createControlGroup (); - - /* Create the group */ - allignmentGroup = new Group (controlGroup, SWT.NULL); - allignmentGroup.setLayout (new GridLayout ()); - allignmentGroup.setLayoutData (new GridData(GridData.HORIZONTAL_ALIGN_FILL | - GridData.VERTICAL_ALIGN_FILL)); - allignmentGroup.setText (ControlExample.getResourceString("Alignment")); - - /* Create the controls */ - leftButton = new Button (allignmentGroup, SWT.RADIO); - leftButton.setText (ControlExample.getResourceString("Left")); - centerButton = new Button (allignmentGroup, SWT.RADIO); - centerButton.setText(ControlExample.getResourceString("Center")); - rightButton = new Button (allignmentGroup, SWT.RADIO); - rightButton.setText (ControlExample.getResourceString("Right")); - - /* Add the listeners */ - SelectionListener selectionListener = new SelectionAdapter () { - public void widgetSelected(SelectionEvent event) { - if (!((Button) event.widget).getSelection ()) return; - setExampleWidgetAlignment (); - }; - }; - leftButton.addSelectionListener (selectionListener); - centerButton.addSelectionListener (selectionListener); - rightButton.addSelectionListener (selectionListener); - } - - /** - * Sets the alignment of the "Example" widgets. - */ - abstract void setExampleWidgetAlignment (); - - /** - * Sets the state of the "Example" widgets. - */ - void setExampleWidgetState () { - super.setExampleWidgetState (); - Control [] controls = getExampleWidgets (); - if (controls.length != 0) { - leftButton.setSelection ((controls [0].getStyle () & SWT.LEFT) != 0); - centerButton.setSelection ((controls [0].getStyle () & SWT.CENTER) != 0); - rightButton.setSelection ((controls [0].getStyle () & SWT.RIGHT) != 0); - } - } -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ButtonTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ButtonTab.java deleted file mode 100755 index fcc841449a..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ButtonTab.java +++ /dev/null @@ -1,193 +0,0 @@ -package org.eclipse.swt.examples.controlexample; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.*; -import org.eclipse.swt.widgets.*; -import org.eclipse.swt.layout.*; -import org.eclipse.swt.events.*; - -/** - * ButtonTab is the class that - * demonstrates SWT buttons. - */ -class ButtonTab extends AlignableTab { - - /* Example widgets and groups that contain them */ - Button button1, button2, button3, button4, button5, button6; - Group textButtonGroup, imageButtonGroup; - - /* Allignment widgets added to the "Control" group */ - Button upButton, downButton; - - /* Style widgets added to the "Style" group */ - Button pushButton, checkButton, radioButton, toggleButton, arrowButton, flatButton; - - /** - * Creates the Tab within a given instance of ControlExample. - */ - ButtonTab(ControlExample instance) { - super(instance); - } - - /** - * Creates the "Control" group. - */ - void createControlGroup () { - super.createControlGroup (); - - /* Create the controls */ - upButton = new Button (allignmentGroup, SWT.RADIO); - upButton.setText (ControlExample.getResourceString("Up")); - downButton = new Button (allignmentGroup, SWT.RADIO); - downButton.setText (ControlExample.getResourceString("Down")); - - /* Add the listeners */ - SelectionListener selectionListener = new SelectionAdapter() { - public void widgetSelected(SelectionEvent event) { - if (!((Button) event.widget).getSelection()) return; - setExampleWidgetAlignment (); - }; - }; - upButton.addSelectionListener(selectionListener); - downButton.addSelectionListener(selectionListener); - } - - /** - * Creates the "Example" group. - */ - void createExampleGroup () { - super.createExampleGroup (); - - /* Create a group for text buttons */ - textButtonGroup = new Group(exampleGroup, SWT.NONE); - GridLayout gridLayout = new GridLayout (); - textButtonGroup.setLayout(gridLayout); - gridLayout.numColumns = 3; - textButtonGroup.setLayoutData (new GridData (GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - textButtonGroup.setText (ControlExample.getResourceString("Text_Buttons")); - - /* Create a group for the image buttons */ - imageButtonGroup = new Group(exampleGroup, SWT.NONE); - gridLayout = new GridLayout(); - imageButtonGroup.setLayout(gridLayout); - gridLayout.numColumns = 3; - imageButtonGroup.setLayoutData (new GridData (GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - imageButtonGroup.setText (ControlExample.getResourceString("Image_Buttons")); - } - - /** - * Creates the "Example" widgets. - */ - void createExampleWidgets () { - - /* Compute the widget style */ - int style = SWT.NONE; - if (pushButton.getSelection()) style |= SWT.PUSH; - if (checkButton.getSelection()) style |= SWT.CHECK; - if (radioButton.getSelection()) style |= SWT.RADIO; - if (toggleButton.getSelection()) style |= SWT.TOGGLE; - if (arrowButton.getSelection()) style |= SWT.ARROW; - if (flatButton.getSelection()) style |= SWT.FLAT; - if (borderButton.getSelection()) style |= SWT.BORDER; - - /* Create the example widgets */ - button1 = new Button(textButtonGroup, style); - button1.setText(ControlExample.getResourceString("One")); - button2 = new Button(textButtonGroup, style); - button2.setText(ControlExample.getResourceString("Two")); - button3 = new Button(textButtonGroup, style); - button3.setText(ControlExample.getResourceString("Three")); - button4 = new Button(imageButtonGroup, style); - button4.setImage(instance.images[ControlExample.ciClosedFolder]); - button5 = new Button(imageButtonGroup, style); - button5.setImage(instance.images[ControlExample.ciOpenFolder]); - button6 = new Button(imageButtonGroup, style); - button6.setImage(instance.images[ControlExample.ciTarget]); - } - - /** - * Creates the "Style" group. - */ - void createStyleGroup() { - super.createStyleGroup (); - - /* Create the extra widgets */ - pushButton = new Button (styleGroup, SWT.RADIO); - pushButton.setText("SWT.PUSH"); - checkButton = new Button (styleGroup, SWT.RADIO); - checkButton.setText ("SWT.CHECK"); - radioButton = new Button (styleGroup, SWT.RADIO); - radioButton.setText ("SWT.RADIO"); - toggleButton = new Button (styleGroup, SWT.RADIO); - toggleButton.setText ("SWT.TOGGLE"); - arrowButton = new Button (styleGroup, SWT.RADIO); - arrowButton.setText ("SWT.ARROW"); - flatButton = new Button (styleGroup, SWT.CHECK); - flatButton.setText ("SWT.FLAT"); - borderButton = new Button (styleGroup, SWT.CHECK); - borderButton.setText ("SWT.BORDER"); - } - - /** - * Gets the "Example" widget children. - */ - Control [] getExampleWidgets () { - return new Control [] {button1, button2, button3, button4, button5, button6}; - } - - /** - * Gets the text for the tab folder item. - */ - String getTabText () { - return "Button"; - } - - /** - * Sets the alignment of the "Example" widgets. - */ - void setExampleWidgetAlignment () { - int allignment = 0; - if (leftButton.getSelection ()) allignment = SWT.LEFT; - if (centerButton.getSelection ()) allignment = SWT.CENTER; - if (rightButton.getSelection ()) allignment = SWT.RIGHT; - if (upButton.getSelection ()) allignment = SWT.UP; - if (downButton.getSelection ()) allignment = SWT.DOWN; - button1.setAlignment (allignment); - button2.setAlignment (allignment); - button3.setAlignment (allignment); - button4.setAlignment (allignment); - button5.setAlignment (allignment); - button6.setAlignment (allignment); - } - - /** - * Sets the state of the "Example" widgets. - */ - void setExampleWidgetState () { - super.setExampleWidgetState (); - if (arrowButton.getSelection ()) { - upButton.setEnabled (true); - centerButton.setEnabled (false); - downButton.setEnabled (true); - } else { - upButton.setEnabled (false); - centerButton.setEnabled (true); - downButton.setEnabled (false); - } - upButton.setSelection ((button1.getStyle () & SWT.UP) != 0); - downButton.setSelection ((button1.getStyle () & SWT.DOWN) != 0); - pushButton.setSelection ((button1.getStyle () & SWT.PUSH) != 0); - checkButton.setSelection ((button1.getStyle () & SWT.CHECK) != 0); - radioButton.setSelection ((button1.getStyle () & SWT.RADIO) != 0); - toggleButton.setSelection ((button1.getStyle () & SWT.TOGGLE) != 0); - arrowButton.setSelection ((button1.getStyle () & SWT.ARROW) != 0); - flatButton.setSelection ((button1.getStyle () & SWT.FLAT) != 0); - borderButton.setSelection ((button1.getStyle () & SWT.BORDER) != 0); - } -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ComboTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ComboTab.java deleted file mode 100755 index 6c8af38278..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ComboTab.java +++ /dev/null @@ -1,114 +0,0 @@ -package org.eclipse.swt.examples.controlexample; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.*; -import org.eclipse.swt.widgets.*; -import org.eclipse.swt.layout.*; - -class ComboTab extends Tab { - - /* Example widgets and groups that contain them */ - Combo combo1; - Group comboGroup; - - /* Style widgets added to the "Style" group */ - Button dropDownButton, readOnlyButton, simpleButton; - - static String [] ListData = {ControlExample.getResourceString("ListData0_0"), - ControlExample.getResourceString("ListData0_1"), - ControlExample.getResourceString("ListData0_2"), - ControlExample.getResourceString("ListData0_3"), - ControlExample.getResourceString("ListData0_4"), - ControlExample.getResourceString("ListData0_5"), - ControlExample.getResourceString("ListData0_6"), - ControlExample.getResourceString("ListData0_7"), - ControlExample.getResourceString("ListData0_8")}; - - /** - * Creates the Tab within a given instance of ControlExample. - */ - ComboTab(ControlExample instance) { - super(instance); - } - - /** - * Creates the "Example" group. - */ - void createExampleGroup () { - super.createExampleGroup (); - - /* Create a group for the combo box */ - comboGroup = new Group (exampleGroup, SWT.NULL); - comboGroup.setLayout (new GridLayout ()); - comboGroup.setLayoutData (new GridData (GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - comboGroup.setText ("Combo"); - } - - /** - * Creates the "Example" widgets. - */ - void createExampleWidgets () { - - /* Compute the widget style */ - int style = SWT.NONE; - if (dropDownButton.getSelection ()) style |= SWT.DROP_DOWN; - if (readOnlyButton.getSelection ()) style |= SWT.READ_ONLY; - if (simpleButton.getSelection ()) style |= SWT.SIMPLE; - if (borderButton.getSelection ()) style |= SWT.BORDER; - - /* Create the example widgets */ - combo1 = new Combo (comboGroup, style); - combo1.setItems (ListData); - if (ListData.length >= 3) { - combo1.setText(ListData [2]); - } - } - - /** - * Creates the "Style" group. - */ - void createStyleGroup () { - super.createStyleGroup (); - - /* Create the extra widgets */ - dropDownButton = new Button (styleGroup, SWT.RADIO); - dropDownButton.setText ("SWT.DROP_DOWN"); - simpleButton = new Button (styleGroup, SWT.RADIO); - simpleButton.setText("SWT.SIMPLE"); - readOnlyButton = new Button (styleGroup, SWT.CHECK); - readOnlyButton.setText ("SWT.READ_ONLY"); - borderButton = new Button (styleGroup, SWT.CHECK); - borderButton.setText ("SWT.BORDER"); - } - - /** - * Gets the "Example" widget children. - */ - Control [] getExampleWidgets () { - return new Control [] {combo1}; - } - - /** - * Gets the text for the tab folder item. - */ - String getTabText () { - return "Combo"; - } - - /** - * Sets the state of the "Example" widgets. - */ - void setExampleWidgetState () { - super.setExampleWidgetState (); - dropDownButton.setSelection ((combo1.getStyle () & SWT.DROP_DOWN) != 0); - simpleButton.setSelection ((combo1.getStyle () & SWT.SIMPLE) != 0); - readOnlyButton.setSelection ((combo1.getStyle () & SWT.READ_ONLY) != 0); - borderButton.setSelection ((combo1.getStyle () & SWT.BORDER) != 0); - } -} diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java deleted file mode 100755 index 300e4333a7..0000000000 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java +++ /dev/null @@ -1,179 +0,0 @@ -package org.eclipse.swt.examples.controlexample; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -import org.eclipse.swt.*; -import org.eclipse.swt.graphics.*; -import org.eclipse.swt.layout.*; -import org.eclipse.swt.widgets.*; - -import java.text.*; -import java.util.*; - -public class ControlExample { - private static ResourceBundle resourceBundle = - ResourceBundle.getBundle("examples_control"); - private ShellTab shellTab; - private TabFolder tabFolder; - - static final int - ciClosedFolder = 0, - ciOpenFolder = 1, - ciTarget = 2; - static final String[] imageLocations = { - "closedFolder.gif", - "openFolder.gif", - "target.gif" }; - Image images[]; - - /** - * Creates an instance of a ControlExample embedded inside - * the supplied parent Composite. - * - * @param parent the container of the example - */ - public ControlExample(Composite parent) { - initResources(); - tabFolder = new TabFolder (parent, SWT.NULL); - Tab [] tabs = new Tab [] { - new ButtonTab (this), - new ComboTab (this), - new CoolBarTab (this), - new DialogTab (this), - new LabelTab (this), - new ListTab (this), - new ProgressBarTab (this), - new SashTab (this), - shellTab = new ShellTab(this), - new SliderTab (this), - new TableTab (this), - new TextTab (this), - new ToolBarTab (this), - new TreeTab (this), - }; - for (int i=0; i